[Xitami] RE: Stopping and restarting (or resetting) Xitamiwithperl

Francis Turner francis.turner at gmail.com
Wed Jan 4 20:04:29 CET 2006


If you look at the /admin page there seems to be a fairly simple way
to cause the server to reset (or halt).

I think you would need to create a perl script with LWP or equivalent
to get (with authentication) http://localhost/admin and then post to
/admin?somemagicstring with post data jsaction=~A47.0 where the
(somemagicstring) is retrieved from the LWP get page.

Writing a server to monitor certain requests and do this when asked is
pretty trivial but I'm not sure you would need to do even that much
because I think the resrat saves the state anyway or queues it so that
it occurs in a safe way

Francis

On 1/4/06, R O <rolinger1 at hotmail.com> wrote:
>
> This all seems  a bit too complicated for a simple process.
>
> The problem with killing and restarting the service via cgi (and I think
> php) is that when you kill the server you will also kill the process that is
> executing the kill/restart commands.  The kill command will work and will
> stop the service, but now that the service is stopped the cgi will be
> terminated which means the second part of the the perl process, "restart",
> won't get executed simply because the CGI process has already been
> terminated.
>
> I know this is a fact for the CGI process but I am not certain about the
> PHP.  CGI is a engine that runs and execute web based perl scripts.  However
> I think the beauty of PHP is that there is no engine managing php scripts,
> which means if a php script is run via a url, that the php script will load
> into memory and execute even if the webserver is killed in the middle of
> being executed. Someone might be able to elaborate on the PHP process but I
> think thats how PHP works.
>
> Someone else suggested use the "server refresh" feature in the defaults.cfg
> but this means its an automated thing and doesn't give you the ability to do
> it remotely, quickly, etc.  when ever you want.  You need another way of
> executing a perl/php script remotely that isn't done via the URL, or via the
> same webserver.  Maybe run a second web service on a different port that
> simply manages the kill/restart of the first service.
>
>
>
> Russel P. Olinger
> (310) 466-3399
> rolinger1 at hotmail.com
>
>
>
>
>
> >From: Martin Bleisteiner <mail at bleisteiner.net>
> >Reply-To: Xitami Users General Discussion <xitami at lists.xitami.org>
> >To: Xitami Users General Discussion <xitami at lists.xitami.org>
> >Subject: RE: [Xitami] RE: Stopping and restarting (or resetting)
> >Xitamiwithperl
> >Date: Wed, 4 Jan 2006 19:33:02 +0100
> >
> >Hello,
> >
> >There are lots of different "kill" tools out there. Most of them can be set
> >to different "brutality" levels. First they try to stop the running task by
> >sending a kind of "Alt-F4" command. When the task is still running properly
> >it will react by closing all open files and terminate the regular way.
> >After this, when no reaction, the running .exe can be really "killed" and
> >can be kicked out of memory.
> >
> >I'm running a scheduled task that is testing the Xitami server every minute
> >by a simple http-Get, and if there is no answer probably Xitami was shot by
> >unknown reason (maybe my own PHP scripts do so by fault). This happens 2-3
> >times a day to me. After a defect is recognized, Xitami becomes killed and
> >restarted in the way I mentioned. I never found problems when doing so. No
> >problems with open files, even when PHP scrips are called.
> >
> >Martin
> >
> >----- Original Message ---------------
> >
> > >Yes but is it safe to kill Xitami just like that whenever you feel like
> > >it? Runing CGIs, open files and all..
> > >
> > >Ayhan
> > >
> > >try to download Windows Command line Tool "kill.exe"
> > >Then try to put two Shell Commands by PHP:
> > >
> > >shell("kill xiwin32.exe");
> > >shell("xiwin32.exe");
> > >
> > >- or something like this.
> > >
> > >First line kills all active tasks of Xitami, the second line starts new
> > >Xitami.
> > >Refer to the manual of the kill.exe tool.
> > >
> > >Martin
> > >
> >
> >
> >--
> >Xitami Users Mailing List -- For Xitami support
> >To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
>
>
>
> --
> Xitami Users Mailing List -- For Xitami support
> To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
>


--
http://www.di2.nu/blog.htm
Faber's Fourth Law:
  Necessity is the mother of strange bedfellows.



More information about the Xitami mailing list