diff --git a/Install-as-a-daemon.md b/Install-as-a-daemon.md new file mode 100644 index 0000000..118f6c0 --- /dev/null +++ b/Install-as-a-daemon.md @@ -0,0 +1,51 @@ +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` + +``` +[Unit] +Description=seasonedShows API + +[Service] +WorkingDirectory=/opt/seasonedShows/seasoned_api +ExecStart=/usr/local/bin/node src/webserver/server.js +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 SEASONED_CONFIG=conf/development.json NODE_PATH=. + +[Install] +WantedBy=multi-user.target +``` +#### Configuration notes +- 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. \ No newline at end of file