minimal systemd unit

Add them in under /etc/systemd/system/

sudo touch /etc/systemd/system/cool_unit.service
sudo chmod 664 /etc/systemd/system/cool_unit.service
sudo vi /etc/systemd/system/cool_unit.service

Description = A good description

Requires = # This unit also activates these units
Wants = # Optional Requires, adviced to use this
Conflicts = # Starting this unit will kill the other and opposite

# Alternative names

# RequiredBy / WantedBy = Same as in Unit, but reverse
WantedBy =

# Which other units should be enabled/disabled with this unit 

Type = simple

# simple    : starts the service immediately. It is expected that the main process of the service is defined in `ExecStart`
# foking    : considers the service started up once the process forks and the parent has exited.
# oneshot   : similar to `simple`, but it is expected that the process has to exit before systemd starts follow-up units (useful for scripts that do a single job and then exit). You may want to set `RemainAfterExit=yes` as well so that systemd still considers the service as active after the process has exited.
# dbus      : similar to `simple`, but considers the service started up when the main process gains a D-Bus name.
# notify    : similar to `simple`, but considers the service started up only after it sends a special signal to systemd.
# idle      : similar to `simple`, but the actual execution of the service binary is delayed until all jobs are finished.

# User/Group to run as
User = root 
Group = root 

# Command to run

# Command to stop

# Commannd to run if unit config is changed
ExecReload = 

# Restart config
Restart = on-failure 

# no            : Never
# on-success    : Only on clean exit
# on-failure    : Everything but clean exit
# on-abnormal   : Unclean signal, timeout, watchdog
# on-watchdog   : Only watchdog trigger
# on-abort      : Only Unclean exit signal
# always        : Always

# Assumed active even after exit
RemainAfterExit = False 


[] zsh/bash function for adding new systemd files

More examples