installing a script as startup service in ubuntu

Posted by Jibin on Server Fault See other posts from Server Fault or by Jibin
Published on 2012-02-21T04:07:20Z Indexed on 2014/08/24 16:22 UTC
Read the original article Hit count: 252

I have a script openerp-server.py in ~/openerp/stable6/server/bin/.I want it to be run at startup.(As a service or not - I don't know the difference)

These are the steps I followed

1 Created a script 'openerp-server' with the following lines in /etc/init.d/

#!/bin/sh
cd ~/openerp/stable6/server/bin/
exec /usr/bin/python ./openerp-server.py $@

2 Made the script executable by using the following command

sudo chmod +x /etc/init.d/openerp-server

3 Made the link run on startup by using the following command

sudo update-rc.d openerp-server 

I checked using sysv-rc-conf.And openerp-server was selected for run level 2,3,4,5.

Now after restarting I checked if the openerp-server.py is running, it was not running.

Please help.

© Server Fault or respective owner

Related posts about scripting

Related posts about service