[Zope] start zserver with cronjob

Jamie Heilman jamie@audible.transient.net
Tue, 4 Feb 2003 13:55:40 -0800


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