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
> I'm trying to follow the instructions here, but when I get to this step:
>
> $ sudo update-rc.d kete_backgroundrb_and_zebra_boot start 99 2 3 4 5 .
> it stops with these messages:
>
> update-rc.d: using dependency based boot sequencing
...
> I am monitoring the server with Munin, and it's running Debian 6.0.5.
>
> Any ideas?
That script is out-of-date. I've updated it to something that will hopefully work. You can grab it here:
https://gist.github.com/walter/5912401
Let me know if that fixes the issue or if you are still having problems.
Tags: boot, Zebra, reboot, backgroundrb, configuration, sysadmin
Thanks, now it worked, with a couple of tweaks:
1. Here is my kete_backgroundrb_and_zebra_boot: https://gist.github.com/MagnusEnger/5925789 I had to change /home/kete/apps/${app}/current to /home/kete/apps/${app} on line 24
2. Running "sudo update-rc.d kete_backgroundrb_and_zebra_boot start 99 2 3 4 5 ." gave an error, but running just "sudo update-rc.d kete_backgroundrb_and_zebra_boot enable" seems to have worked.
Thanks again for your help!
Tags: boot, Zebra, reboot, backgroundrb, configuration, sysadmin
> 1. Here is my kete_backgroundrb_and_zebra_boot:
> https://gist.github.com/MagnusEnger/5925789 I had to change
> /home/kete/apps/${app}/current to /home/kete/apps/${app} on line 24
The NON_DEPLOYED_KETE is meant for apps without a current directory (Capistrano deployed apps usually deploy under $(app)/current with previous deployments under $(app)/releases).
Having said that, we don't use NON_DEPLOYED_KETE much at Katipo and perhaps it isn't working as it should.
Tags: boot, Zebra, reboot, backgroundrb, configuration, sysadmin
magnusenger
said Conflict with Munin?
I'm trying to follow the instructions here, but when I get to this step:
it stops with these messages:
I am monitoring the server with Munin, and it's running Debian 6.0.5.
Any ideas?