RE: [Zope] start zserver with cronjob
Thanks Andrew, That will do the job, but what if my provider reboots his server Is it possible to run a cronjob to start the zserver after a reboot? Regards, Jos van der Vleuten -----Oorspronkelijk bericht----- Van: Andrew Altepeter [mailto:aaltepet@bethel.edu] Verzonden: dinsdag 4 februari 2003 14:09 Aan: Jos van der Vleuten CC: 'zope@zope.org' Onderwerp: Re: [Zope] start zserver with cronjob Hi Jos, How about ./start & The '&' tells the shell to execute the program in the background. This will allow you to exit your ssh session, and still have zope running. Cheers, Andy On Tue, 2003-02-04 at 06:38, Jos van der Vleuten wrote:
Hello all,
I have installed zope on my webspace at a hosting provider. With ssh i can start the zserver with the ./start command, but when i close the ssh-session the zserver stops executing. Now i want to make a cronjob to automate this task of running the zserver. I'm not very familiar with linux, so can somebody explain me how to do this.
Jos van der Vleuten Programmeur / Analist http://www.walcheren-online.net
UCC Business Solutions
Buizerdlaan 2 Postbus 1534 Nieuwegein Telefoon +31 (0)30 6008600 Fax +31 (0)30 6008601 http://www.ucc.nl
Have a nice day !
That will do the job, but what if my provider reboots his server Is it possible to run a cronjob to start the zserver after a reboot?
Sure there is! You can do something like this: #~/bin/perl $z2_pid = "/proc/".`cat ~/var/Z2.pid`; #as the user that zope runs as if !(-d $z2_pid) { #start zope `~/start &` } This checks the proc filesystem to see if a process with the same pid as zope is running. HTH, Andy
Regards, Jos van der Vleuten
-----Oorspronkelijk bericht----- Van: Andrew Altepeter [mailto:aaltepet@bethel.edu] Verzonden: dinsdag 4 februari 2003 14:09 Aan: Jos van der Vleuten CC: 'zope@zope.org' Onderwerp: Re: [Zope] start zserver with cronjob
Hi Jos,
How about ./start &
The '&' tells the shell to execute the program in the background. This will allow you to exit your ssh session, and still have zope running.
Cheers, Andy
On Tue, 2003-02-04 at 06:38, Jos van der Vleuten wrote:
Hello all,
I have installed zope on my webspace at a hosting provider. With ssh i can start the zserver with the ./start command, but when i close the ssh-session the zserver stops executing. Now i want to make a cronjob to automate this task of running the zserver. I'm not very familiar with linux, so can somebody explain me how to do this.
Jos van der Vleuten Programmeur / Analist http://www.walcheren-online.net
UCC Business Solutions
Buizerdlaan 2 Postbus 1534 Nieuwegein Telefoon +31 (0)30 6008600 Fax +31 (0)30 6008601 http://www.ucc.nl
Have a nice day !
Andrew Altepeter wrote:
That will do the job, but what if my provider reboots his server Is it possible to run a cronjob to start the zserver after a reboot?
Sure there is! You can do something like this:
#~/bin/perl $z2_pid = "/proc/".`cat ~/var/Z2.pid`; #as the user that zope runs as
if !(-d $z2_pid) { #start zope `~/start &` }
Not every OS uses /proc, while thats just a portability issue, this technique is a horrible hack at best. I mean while you're at it why don't you abuse a vi.recover session and procmail rule, sheesh. If you need reliable long running processes ask your administrator, they'll either be willing to help you do it correctly, or they won't; either way, its better to do it right than suffer the wrath of the admin who finds this crap in the crontabs. -- Jamie Heilman http://audible.transient.net/~jamie/ "It's almost impossible to overestimate the unimportance of most things." -John Logue
also sprach Jos van der Vleuten <Jos.van.der.Vleuten@transiciel.nl> [2003.02.04.1419 +0100]:
That will do the job, but what if my provider reboots his server Is it possible to run a cronjob to start the zserver after a reboot?
instead of 0 0 0 0 0 <command> say: @reboot <command> cron does that. -- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck NOTE: The pgp.net keyservers and their mirrors are broken! Get my key here: http://people.debian.org/~madduck/gpg/330c4a75.asc bill gates, 1984: "640 k ought be enough" bill gates, 1995: "the internet is not a primary goal for pc usage" bill gates, 1999: "linux has no impact on microsoft's strategy"
participants (4)
-
Andrew Altepeter -
Jamie Heilman -
Jos van der Vleuten -
martin f krafft