[Zope] start zserver with cronjob

Andrew Altepeter aaltepet@bethel.edu
04 Feb 2003 07:28:32 -0600


> 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 !
> > 
>