Joshua Parker Ruehlig
Hall of Famer
- Joined
- Dec 5, 2011
- Messages
- 5,949
depends how your user was created. I have no idea how you guys are setting this program up.Is that not created by default?
depends how your user was created. I have no idea how you guys are setting this program up.Is that not created by default?
depending on the flags you gave it would or would not create the home directory.I was using the pw command to add groups/users
service nzbdrone start
I think errors would be directed to the log so you could check there?I just created a new jail and setup the user, this time using adduser and I ensured that a home directory was created. But still, nzbdrone will not start, when I runI do not get any errors, neither mono or nzbdrone is starting.Code:service nzbdrone start
Edit: I wonder if I need to add the user to the "wheel" group, because I believe mono needs elevated privileges to run.
Looks good. Mind checking if my changes works
Changes I made
Future changes
- I simplified nzbdrone_poststart() to utlize a built in variable
- no need deleting a stale pidfile then overwriting it. just overwriting it would do the same thing.
- utilized nzbdrone_dir
- can you specify "nzbdrone_data_dir" as a commandline flag to nzbdrone? if so maybe we should specify it to something like /usr/local/etc/nzbdrone (but this directory would need to be owned by nzbdrone_user). otherwise the variable can be deleted, it's not being used.
- if the above is implemented we might want to specify a user other than nobody to own the config files. it would need to either be a built in account, or people would need to add it. (though this is something a port maintainer would need to think about, not something that needs to be taken care of in this script)
Code:#!/bin/sh # # PROVIDE: nzbdrone # REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # # nzbdrone_enable (bool): Set to NO by default. # Set it to YES to enable it. # nzbdrone_data_dir: Directory where nzbdrone configuration # data is stored. # Default: /home/${nzbdrone_user}/.config/NzbDrone # nzbdrone_user: The user account nzbdrone daemon runs as what # you want it to be. It uses 'nobody' user by # default. Do not sets it as empty or it will run # as root. # nzbdrone_group: The group account nzbdrone daemon runs as what # you want it to be. It uses 'user' group by # default. Do not sets it as empty or it will run # as wheel. . /etc/rc.subr name="nzbdrone" rcvar="${name}_enable" load_rc_config $name start_postcmd="${name}_poststart" pidfile="/var/run/${name}.pid" stop_postcmd="${name}_poststop" : ${nzbdrone_enable:="NO"} : ${nzbdrone_user:="nobody"} #NOTE: DO NOT RUN AS ROOT, IT WILL BURN YOUR HOUSE DOWN AND RAPE YOUR CAT! : ${nzbdrone_group:="user"} : ${nzbdrone_dir:="/opt/NzbDrone"} : ${nzbdrone_data_dir:="/home/${nzbdrone_user}/.config/NzbDrone"} : ${nzbdrone_log:="/var/log/nzbdrone.log"} command="/usr/local/bin/mono" command_args="$nzbdrone_dir/NzbDrone.exe >$nzbdrone_log 2>&1 &" nzbdrone_poststart() { echo $rc_pid > $pidfile } nzbdrone_poststop() { rm $pidfile } run_rc_command "$1"
Also check that the log file and the pid file are owned by the correct user, or not created at all (in which case it will be created at first run).
check process nzbdrone with pidfile /var/run/nzbdrone.pid start program = "/usr/sbin/service nzbdrone start" stop program = "/usr/sbin/service nzbdrone stop" if failed host 0.0.0.0 with port 8989 then restart if 5 restarts within 5 cycles then timeout
Look at monit, it's in ports. Here's a pretty basic monitrc snippet which works with this rc-script:
Code:check process nzbdrone with pidfile /var/run/nzbdrone.pid start program = "/usr/sbin/service nzbdrone start" stop program = "/usr/sbin/service nzbdrone stop" if failed host 0.0.0.0 with port 8989 then restart if 5 restarts within 5 cycles then timeout
/usr/local/etc/monitrc
There will be a monitrc.default or something there as well if you want to learn more
Yes, and if it loads the site, but the site isn't actually working, it won't notice :(
I don't have your problems, but I do have similar ones. I know that nzbdrone is going through a pretty heavy coding phase, so I would suggest trying other builds back in time until you find one that works for you, and then every time a new build gets pushed as a release (not just a daily) try to see if it works for you, but don't overwrite the existing build until you're sure it's good.
That's what I'm doing anyway. The development is going REALLY fast, and that's when bumps in the road turn into crashes...
yeah, the regular SB branch doesn't have that. have you guys tried The Pirate Bay branch recently? tolstyak's 'failed' branch merged into it a few months ago so it has failed download support now. if you Google 'jruehlig freenas' I have my setup outlined which enables this feature.It sees that downloads fail and find a new one.