Re: [CentOS] making a script into a service

2013-12-09 Thread Larry Martell
On Mon, Dec 9, 2013 at 9:05 AM, John Doe wrote: > From: Larry Martell > >> We have a python script that is currently run from cron. We want to >> make it into a service so it can be controlled with service >> start/stop/restart. Can anyone point me at site that has instructions >> on how to do th

Re: [CentOS] making a script into a service

2013-12-09 Thread Larry Martell
On Mon, Dec 9, 2013 at 8:40 AM, Liam O'Toole wrote: > On 2013-12-09, Larry Martell wrote: >> On Mon, Dec 9, 2013 at 8:00 AM, Fabrizio Di Carlo >> wrote: >>> Try to use this >>> http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ >>> it >>> allows you start/stop/restart th

Re: [CentOS] making a script into a service

2013-12-09 Thread John Doe
From: Larry Martell > We have a python script that is currently run from cron. We want to > make it into a service so it can be controlled with service > start/stop/restart. Can anyone point me at site that has instructions > on how to do this? I've googled but haven't found anything. http://fed

Re: [CentOS] making a script into a service

2013-12-09 Thread Liam O'Toole
On 2013-12-09, Larry Martell wrote: > On Mon, Dec 9, 2013 at 8:00 AM, Fabrizio Di Carlo > wrote: >> Try to use this >> http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ >> it >> allows you start/stop/restart the script using the following commands. >> >> python myscript.

Re: [CentOS] making a script into a service

2013-12-09 Thread Matt Garman
Turn it into a daemon as described, then take a look at the existing scripts in /etc/init.d/. There might even be a template in there iirc. Your script will likely be a simple wrapper around your daemonized python program. After that, just do a "chkconfig --add “ where myscript is the name of your

Re: [CentOS] making a script into a service

2013-12-09 Thread Larry Martell
On Mon, Dec 9, 2013 at 8:00 AM, Fabrizio Di Carlo wrote: > Try to use this > http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ it > allows you start/stop/restart the script using the following commands. > > python myscript.py start > python myscript.py stop > python myscr

Re: [CentOS] making a script into a service

2013-12-09 Thread Larry Martell
On Mon, Dec 9, 2013 at 8:00 AM, Andrew Holway wrote: > The keyword your looking for here is "daemonize". I don't just want to make it into a daemon - I want to control it with the service command. > > > > On 9 December 2013 12:54, Larry Martell wrote: >> We have a python script that is currentl

Re: [CentOS] making a script into a service

2013-12-09 Thread Fabrizio Di Carlo
Try to use this http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ it allows you start/stop/restart the script using the following commands. python myscript.py start python myscript.py stop python myscript.py restart Source: http://stackoverflow.com/questions/16420092/ho

Re: [CentOS] making a script into a service

2013-12-09 Thread Andrew Holway
The keyword your looking for here is "daemonize". On 9 December 2013 12:54, Larry Martell wrote: > We have a python script that is currently run from cron. We want to > make it into a service so it can be controlled with service > start/stop/restart. Can anyone point me at site that has instruc