systemctl

also see journalctl

systemctl list-units [ --all | --type=service ]
  • show all enabled and disabled services
    systemctl list-unit-files

create service file

vi /etc/systemd/system/<name>.service

(manage systemd)

user services

run systemctl (without sudo) and with the --user option

service files are created under '$HOME/.config/systemd/user'

example user service file

[Unit]
Description=This is an example

[Service]
ExecStart=/path/to/command

[Install]
WantedBy=default.target
(writing user units)

enable and start the user service (without sudo)

systemctl --user enable <service>
systemctl --user start <service>
systemctl --user status <service>