Page 1 of 1

How to start multiple profiles at boot

Posted: May 29th, 2013, 9:48 am
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.

Re: How to start multiple profiles at boot

Posted: May 29th, 2013, 11:40 am
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.

Re: How to start multiple profiles at boot

Posted: May 29th, 2013, 3:47 pm
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.