Skip to content

Install as a daemon

Kevin edited this page Apr 19, 2018 · 4 revisions

These steps are presented as guidelines. Your results may vary, depending on operating system, installation path and other settings.

Linux (systemd)

Use the following service script for CentOS, Fedora, openSUSE, Ubuntu, etc. that uses systemd. Installation notes:

  1. Rename this file as you want, ensuring that it ends in .service e.g. 'seasoned.service'.
  2. Adjust configuration settings as required. See configuration details below for more details.
  3. Copy this file into your systemd service unit directory, which is often '/et/systemd/system' or '/lib/systemd/system'.
  4. Enable boot-time autostart with the following commands:
    systemctl daemon-reload
    systemctl enable seasoned.service
  5. Start seasonedShows with the following command:
    systemctl start seasoned.service or service seasoned start

Example configuration file:

# seasonedShows - Stats for Plex Media Server usage
#
# Service Unit file for systemd system manager

[Unit]
Description=seasonedShows API

[Service]
WorkingDirectory=/opt/seasonedShows/seasoned_api
ExecStart=/usr/bin/yarn start
Restart=always
# Restart service after 10 seconds if node service crashes
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=seasonedShows

User=seasoned
Group=seasoned
Environment=NODE_ENV=production PROD=true SEASONED_CONFIG=conf/development.json NODE_PATH=.

[Install]
WantedBy=multi-user.target

Configuration details

  • The example settings in this file assume that you will run seasoned as user: seasoned

  • To create this user and give it ownership of the tautulli directory:
    sudo adduser --system --no-create-home seasoned
    sudo chown -R seasoned:seasoned /opt/seasonedShows

  • Option names (e.g. ExecStart=, Type= are case-sensitive)

  • Adjust ExecStart= to point to: Your seasonedShow directory with (../seasonedShows/seasoned_api)

  • Adjust User= and Group= to the user/group you want seasonedShows to run as.

Ubuntu (<15.10)

The path you installed seasonedShows will need to be specified in the run section. A common mistake is that a daemon user has no read and/or write permissions, or that the wrong path is specified for node.

For other versions of ubuntu. TODO

Clone this wiki locally