Enable systemd services

Enable your containerized services to start automatically at boot. For user services, you must enable lingering to help ensure they persist after logout.

Procedure

Enable the service:
  • To enable a service at system start, no matter if user is logged in or not, enter:
    # systemctl enable <service>

    You have to copy the systemd unit files to the /etc/systemd/system directory.

  • To start a service at user login and stop it at user logout, enter:
    $ systemctl --user enable <service>

    You have to copy the systemd unit files to the $HOME/.config/systemd/user directory.

  • To enable users to start a service at system start and persist over logouts, enter:
    # loginctl enable-linger <username>

    Refer to systemctl(1) and loginctl(1) man pages on your system for more information.