From 07c0313187d9a29d93500f42b927ed1719c8447d Mon Sep 17 00:00:00 2001 From: Tait Hoyem Date: Sat, 4 Nov 2023 11:29:38 -0600 Subject: [PATCH] Add plain version of systemd service file --- systemd-service-files/plain_command.service | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 systemd-service-files/plain_command.service diff --git a/systemd-service-files/plain_command.service b/systemd-service-files/plain_command.service new file mode 100644 index 0000000..aa5065a --- /dev/null +++ b/systemd-service-files/plain_command.service @@ -0,0 +1,31 @@ +# to install the file, place completed file in /etc/systemd/user/ +# you can start it with: +# `systemctl start FILE_NAME_WITHOUT_DOT_SERVICE` +# or enable it at boot with: +# `systemctl enable FILE_NAME_WITHOUT_DOT_SERVICE` + +[Unit] +# basic description of service; replace with legit description +Description=DESCRIPTION + +[Service] +# change lowercase "user" to the user which will be running the program: this is usually the one whoes home directory the project is in +User=USER +# change to where the directory of the project is +WorkingDirectory=WORKDIR +# leave Type= and RemainAfterExit= alone; these specify the type of program that is being run +Type=simple +RemainAfterExit=yes +# replace with FULL PATH of command you want to run, +# you can find that by running `which MY_COMMAND_HERE` +ExecStart=MY_COMMAND_WITH_ARGUMENTS_HERE +# instructions on how to kill the process +# this is a graceful exit and should not be modified unless you know which signal +# can properly shutdown your program +ExecStop=/bin/kill -HUP $MAINPID +# if process dies, should you restart it? leave it as always to auto restart +Restart=always + +[Install] +# WantedBy=multi-user.target allows it to be enabled with systemctl to start on boot +WantedBy=multi-user.target