Page 1 of 1
Conflicting advice for setting up a daemon for a headless server.
Posted: October 23rd, 2009, 6:20 pm
by tstack77
I am trying to setup my headless intrepid server to be always on and accessible from remote computers only. So far I've been able to get everything up and running fine except for auto-starting sabnzbd.
In the wiki it says to install a script that can be called from init.d to ensure "that SABnzbd is closed properly when a system goes down, otherwise data will be lost."
However, from reading other posts it's said to create a completely different looking startup script and place it in /init.d/sabnzbdplus. Where I get real lost is when I look in /etc/init.d/sabnzdbplus it clearly displays that I should configure /etc/default/sabnzbdplus...beyond adding in the user and Host/Port, what should I be doing?
I really don't have a clue as to the correct way to set this up correctly to ensure not only a correct startup, but a proper shut-down.
Re: Conflicting advice for setting up a daemon for a headless server.
Posted: October 23rd, 2009, 6:26 pm
by inpheaux
You're using the build from the Ubuntu repositories. As you've found, said build comes with an init.d script. Use it. All you have to do is edit the script and fill in the bits it tells you to.
Re: Conflicting advice for setting up a daemon for a headless server.
Posted: October 23rd, 2009, 6:47 pm
by tstack77
Code: Select all
# This file is sourced by /etc/init.d/sabnzbdplus
#
# When SABnzbd+ is started using the init script, the
# --daemon option is always used, and the program is
# started under the account of $USER, as set below.
#
# Each setting is marked either "required" or "optional";
# leaving any required setting unconfigured will cause
# the service to not start.
# [required] user or uid of account to run the program as:
USER=user name for log-in, not OS user
# [optional] full path to the configuration file of your choice;
# otherwise, the default location (in $USER's home
# directory) is used:
CONFIG=
# [optional] hostname/ip and port number to listen on:
HOST=0.0.0.0
PORT=chosen port
# [optional] extra command line options, if any:
EXTRAOPTS=
Thanks for the quick response. I set it up with the info above, but I still need to run sabnzbdplus in the terminal to start it. What have I done wrong here?
EDIT: Got it working, use your user id, not the web log-in id (durr).
Code: Select all
# [required] user or uid of account to run the program as:
USER=user ID
Re: Conflicting advice for setting up a daemon for a headless server.
Posted: October 26th, 2009, 5:00 am
by mollydog
You will need root to assign low system ports but it doesn't look as if you have filled in the information it is asking you to. It is never really a good idea to run web facing apps as root for security reasons. Set the user id to your normal user and choose a port between 1024 and 65535 and see if that helps.
Re: Conflicting advice for setting up a daemon for a headless server.
Posted: October 26th, 2009, 10:28 am
by tstack77
Molly, you are totally correct. I mistakenly used the term root instead of user (huge diff but I at least set it up the right way

). Not sure what I was thinking when I set it up the first time and tried to start the daemon with the web log-in user id...