1
    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.

    sudo service nzbget start
    sudo service sickrage start

    exit 0

Is this code ok? What else do I need to have to restart the Pi2 and have the services start at boot?

1

If they have init service files (which is the only way that will work -- I presume you've tried sudo service ______ start and it does), then you should just enable them. First check:

grep Required-Start /etc/init.d/nzbget

You should get something like S 2 3 4 5, in which case you can just:

update-rc.d enable S 2

There maybe a bit of a complication if you are using systemd with jessie (it does by default), although I believe it still supports the older methodology.

Or you could just stick with what you have, which should work. You should be able to check post boot w/ service nzbget status.

  • osmc@osmc:~$ service nzbget status * nzbget.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead) – eekfonky Mar 4 '15 at 6:56
  • The same for Sickrage. I really don't want to restart until I know I can get the services back up? – eekfonky Mar 4 '15 at 6:58
  • Apparently the services don't exist. Just because you have a program installed doesn't mean it came with Debian's spin on SysV style init scripts. You can read more about that in /etc/init.d/README, but if what you want to do is run those programs at boot, the easiest thing to do would be to just start them with the command you normally use in rc.local -- except you don't need sudo, because it runs root. Also, if that command blocks (i.e. does not go into the background), you need to follow it with & to put it in the background. – goldilocks Mar 4 '15 at 14:14
  • Using the full path and redirecting the output so you can debug problems is also a good idea, so, e.g. /usr/local/bin/nzbget &> /tmp/nzbget.log &. The &> redirects any output. – goldilocks Mar 4 '15 at 14:15
  • Hmmm -> nzbget.net/Command_line_reference Try which nzbget for the path. – goldilocks Mar 4 '15 at 14:46
1
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

nzbget -D
python /opt/sickrage/SickBeard.py -d

exit 0

This is the file at /etc/rc.local that gets both services running at boot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.