BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: Haarg on September 13, 2006, 01:49:23 am

Title: Run BeBot as a Windows service
Post by: Haarg on September 13, 2006, 01:49:23 am
I wrote a couple short scripts that allow BeBot to run directly as a Windows service, without needing FireDaemon or srvany.  It uses the PHP win32service extension, so I think it will only work with PHP5 and up.

The Win32Service module will replace the functionality of the Shutdown module, but only if ran as a service.  If not running as a service, it will silently not load itself, falling back on Shutdown's functionality.

service.php will install, remove, start, and stop the service, as well as providing the service startup code.

To install, extract the scripts to the BeBot directory.  Install the win32service extension (http://pecl4win.php.net/ext.php/php_win32service.dll).  You will probably need to change php.ini to refer to the absolute path to php's extensions directory.
Then just php service.php install to install as a service.  You can start and stop the service through the standard mechanisms, like the services mmc snapin or net start AOBeBot.  You can also start it with php service.php start.

This module isn't very well tested but seems to function fine.  There are versions built for 0.2.8 and 0.3.3.
Title: Re: Run BeBot as a Windows service
Post by: Khalem on September 14, 2006, 02:36:12 am
Definately interesting.

Gonna see about merging this into trunk as having the bot run as a service is definately very handy for those that run bots 24/7 on Windows.
Title: Re: Run BeBot as a Windows service
Post by: Haarg on September 14, 2006, 07:55:17 am
OK, I'm dumb.  I uploaded the wrong files.  Correct versions are attached now.
Title: Re: Run BeBot as a Windows service
Post by: Vonna on October 01, 2006, 02:58:42 pm
Not sure if it's the differences between the 0.2.8 and 0.2.9 builds of BeBot, but this module doesn't seem to work for me. At first the service wouldn't even start, but that was due to spaces in the directory names, fixed by changing:

Code: [Select]
'params'  => "-c " . dirname(realpath($argv[0])) . " " . realpath($argv[0]) . " run",
to:

Code: [Select]
'params'  => "-c \"" . dirname(realpath($argv[0])) . "\" \"" . realpath($argv[0]) . "\" run",
Once that change was made the service starts, but once it has successfully started it instantly dies—unfortunately, since I haven't been able to find a log I have no idea why it's dying.
SimplePortal 2.3.7 © 2008-2025, SimplePortal