How to turn any command into an auto-restarting Linux service.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SokenDev 9c968b661a Update 'README.md' 1 month ago
README.md Update 'README.md' 1 month ago

README.md

How to create a service on Linux

How to turn any command into an auto-restarting Linux service.

Pre-requisites

  1. You must have systemd installed. This is default for many installations.
  2. You must know exactly what command you want to run. For all intents and purposes, this tutorial will be using a Python installation installed as described here.
  3. You must have access to an account with sudo privileges or the root account. For security purposes, it's recommended that your root account is fully locked and you have passwordless authentication over SSH into your account with sudo privileges.

Steps

  1. Using your favourite linux text editor, let's start writing a new file:
  2. `nano /etc/systemd/system/