Topic: Debian: Restarting Backgroundrb And Zebra on Reboot

Topic type:

Steps required to restart Backgroundrb And Zebra on Reboot, for a Debian operating system.

Init.d Script to Start / Stop BackgroundRB and Zebra

Save the following to  /etc/init.d/kete_backgroundrb_and_zebra_boot    (do not change this path name)

Edit the three variables at the top of the file to suit your environment:

  • RUBY_BIN
    • Where you can find the ruby and rake executables
  • DEPLOYED_KETE
    • The name of the folder containing a deployed application, i.e. /home/kete/apps/[your_app]/current  (space separated)
  • NON_DEPLOYED_KETE
    • The name of the folder containing a non-deployed application, i.e. /home/kete/apps/[your_app]  (space separated)
  • LOG_FILE
    • Where the result of the reboot startup script should be placed. Will be owned by the user that starts up the script (kete).

Getting Debian to use this init.d script

Then run the following as root to symlink the script where it needs to be.

root@host: # cd /etc/init.d
root@host: # chmod 755 kete_backgroundrb_and_zebra_boot
root@host: # chown kete:kete kete_backgroundrb_and_zebra_boot
root@host: # update-rc.d kete_backgroundrb_and_zebra_boot start 99 2 3 4 5 .

We only tell Debian to use it during start up. The 99 means it's one of the last things to come online (after memcache, apache etc) when the system starts up. The "2 3 4 5 ." means that any type of start up (non gui/gui-x11, single/multi user) should trigger this.

Backgroundrb and Zebra can now start up automatically after a start up / restart.

Additional Features

It also provides the ability to run commands outside of start up. For example, run these when logged in as the kete user:

$ /etc/init.d/kete_backgroundrb_and_zebra_boot stop # Free Memory
$ /etc/init.d/kete_backgroundrb_and_zebra_boot start # Start them after stop
$ /etc/init.d/kete_backgroundrb_and_zebra_boot restart # Does both stop, then start

Discuss This Topic

There are 4 comments in this discussion.

Read and join this discussion

join this discussion

Creative Commons Attribution-Share Alike 3.0 New Zealand License
Debian: Restarting Backgroundrb And Zebra on Reboot by Kieran P is licensed under a Creative Commons Attribution-Share Alike 3.0 New Zealand License