How to start multiple profiles at boot

Support for the Debian/Ubuntu package, created by JCFP.
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
Vorkbaard
Newbie
Newbie
Posts: 22
Joined: August 13th, 2011, 5:43 pm

How to start multiple profiles at boot

Post by Vorkbaard »

How can I have multiple profiles (3 users so 3 ini files) start at boot in Ubuntu 12.04?

I know I can start a specific profile by doing sabnzbdplus --config-file /home/user/.sabnzbd/sabnzbd.ini but I'd like to start three of those. In /etc/default/sabnzbdplus I can enter only one profile.
User avatar
jcfp
Release Testers
Release Testers
Posts: 1004
Joined: February 7th, 2008, 12:45 pm

Re: How to start multiple profiles at boot

Post by jcfp »

Multiple instances of the service, each with their own config:
  • Create copies of both /etc/init.d/sabnzbdplus and /etc/default/sabnzbdplus in their respective directories; i.e. /etc/init.d/sabnzbdplus2 and /etc/default/sabnzbdplus2.
  • Edit the copied init script in /etc/init.d/sabnzbdplus2 so that the SETTINGS var points to the copy of the settings file in /etc/default/sabnzbdplus2. Don't make any other changes.
  • Set a different user and preferably also hardcode a different port in /etc/default/sabnzbdplus2.
  • Hook up the new service:

    Code: Select all

    sudo update-rc.d sabnzbdplus2 defaults 98 02
  • Repeat for sabnzbdplus3, 4, ...
There is the slight disadvantage that the init.d copies will not receive updates with package updates without repeating part of the procedure above. Other than that this should just work.
User avatar
jcfp
Release Testers
Release Testers
Posts: 1004
Joined: February 7th, 2008, 12:45 pm

Re: How to start multiple profiles at boot

Post by jcfp »

Almost forgot, there's also the pid file name... var PIDFILE. Maybe I should just make this stuff dynamic, so additional services could symlink.
Post Reply