execute god command on reboot(script)

22 views
Skip to first unread message

jags

unread,
Jul 3, 2008, 7:53:16 AM7/3/08
to god.rb
hi guys

i have installed god on ubunty gutsy server
it works fine when i give the command

sudo god -c path/to/config.god .....and supply a password

now how do i do this automatically when the system reboots after a
power failure.

i am currently looking at a tutorial which says i need a create a
script and put it in init.d
and use some rc.d commands

does anybody know how to write the script for executing this command
there is a example script for freebsd but i think for executing the
above command that script is a overkill

thanks
jags

Kevin Clark

unread,
Jul 3, 2008, 1:49:08 PM7/3/08
to god...@googlegroups.com
You can probably just dump the line (sans sudo) in the bottom of
rc.local (usually in /etc/init.d/rc.local I think). It should be
executed by root on startup. One thing to consider, however, is that
the environment is likely to be different, so if your god script
relies on paths to be correct you'll want to make sure it still works.

--
Kevin Clark
http://glu.ttono.us

raghus

unread,
Jul 3, 2008, 5:27:02 PM7/3/08
to god.rb
Kevin: yes, I added "/usr/bin/god -c path/to/config.god" at the bottom
of rc.local and god comes back up and also starts up the mongrels on
reboot.

Except - the mongrels are now running as root. Is this ok?

Kevin Clark

unread,
Jul 7, 2008, 7:27:52 PM7/7/08
to god...@googlegroups.com
On Thu, Jul 3, 2008 at 2:27 PM, raghus <raghu.sr...@gmail.com> wrote:
>
> Kevin: yes, I added "/usr/bin/god -c path/to/config.god" at the bottom
> of rc.local and god comes back up and also starts up the mongrels on
> reboot.
>
> Except - the mongrels are now running as root. Is this ok?

Well, that's up to you. I wouldn't do it personally. You can modify
what user your watched program starts up as with the 'user' and
'group' accessors on the watch.

Reply all
Reply to author
Forward
0 new messages