Systemd intro

Lately, Linux distributions seem to have standardized on systemd to start/stop services.

It does provide a lot more such as:

basic commands

Below is a list of basic commands

-- Action syntax Example
-- Start a service systemctl start [servicename] systemctl start apache2
-- Stop a service systemctl stop [servicename]] systemctl stop postfix
-- restart a service systemctl restart [servicename]]] systemctl restart postfix
-- List services systemctl list-units systemctl list-units
-- Enable a service systemctl enable [servicename] systemectl enable apache2
-- Disable a service systemctl disable [servicename] systemectl disable apache2

Sample service

I created a script to simplify runnning a live youtube radio using ffmpeg available here.

it worked well but to be more reliable, I added a systemd service to start the script on bootup and easy start/stop

The service is below:
Description=Simple Live Stream

ExecStart=/usr/local/stream/ -c /usr/local/stream/conf/stream.conf


Notable script features