Giter VIP home page Giter VIP logo

raspi-systemd-quickstart's Introduction

Overview

This guide will show you how to create a systemd service on your Raspberry Pi so that you can have your scripts start on boot & to restart any service that fails.

This repository contains a few simple examples to quickly get started.

Getting Started

Download and move inside this repository.

git clone https://github.com/matrix-io/raspi-systemd-quickstart ~/services

cd ~/services

Turn the bash script into an executable.

# This is only required for the bash example
chmod +x ~/services/bash_example.sh

Add read permissions for each service file

chmod 644 ~/services/*.service

Create a symbolic link in systemd for each service. This allows us to neatly store all our services in a home folder.

sudo ln -s ~/services/*.service /etc/systemd/system/

Commands For Managing Your Services

Helpful .service file options

Your services are now setup! Use any of the commands below to control your services.

# Load Any Changes Made To All .service Files
sudo systemctl daemon-reload

# Start
sudo systemctl start YOUR_SERVICE_NAME.service

# Stop
sudo systemctl stop YOUR_SERVICE_NAME.service

# Restart
sudo systemctl restart YOUR_SERVICE_NAME.service

# Run On System Boot
sudo systemctl enable YOUR_SERVICE_NAME.service

# Stop Running On System Boot
sudo systemctl disable YOUR_SERVICE_NAME.service

# View Service Logs
sudo systemctl status YOUR_SERVICE_NAME.service

raspi-systemd-quickstart's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.