2 Daemonizing
Harvey Tindall edited this page 2020-07-20 18:03:23 +01:00

If you aren't using a container, you'll likely want to daemonize jf-acccounts, so that it can run in the background and start at boot.

systemd

Most Linux distributions use systemd as an init service to start parts of the system, and various programs. A simple service file is included for this.

  • Run
λ jf-accounts -i
Assuming executable path "/home/hrfee/.cache/pypoetry/virtualenvs/jellyfin-accounts-r2jcKHws-py3.8/bin/jf-accounts".
1: systemd
>: 1
service written to the current directory
(/home/hrfee/projects/jellyfin-accounts/jf-accounts.service).
Place this in the appropriate directory, and reload daemons.
  • As above, choose systemd, and a service file jf-accounts.service will be placed in your current directory.
  • If you wish to have jf-accounts run as the current user, place this in ~/.config/systemd/user/ (Creating the directories if necessary).
    • Next, run systemctl --user daemon-reload to detect the new service.
    • To start, you can run systemctl --user start jf-accounts.
    • To enable (start at boot), you can run systemctl --user enable jf-accounts.
  • If you wish to run as root, make sure jellyfin-accounts was installed with root privileges (e.g through sudo pip install jellyfin-accounts). A quick way to do this is to run which jf-accounts. If the resulting directory is in a user's home, you'll need to reinstall as root.
    • Once you've made sure, place jf-accounts.service in either /etc/systemd/system/ or /lib/systemd/system/ (generally the latter is better).
    • You can then run the same systemctl commands as above, but remove --user and run with sudo.