collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Run BeBot as a Windows service  (Read 3326 times)

0 Members and 1 Guest are viewing this topic.

Offline Haarg

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Run BeBot as a Windows service
« 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.  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.
« Last Edit: September 14, 2006, 08:03:07 am by Haarg »

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Run BeBot as a Windows service
« Reply #1 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.
BeBot Founder and Fixer Kingpin

Offline Haarg

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Run BeBot as a Windows service
« Reply #2 on: September 14, 2006, 07:55:17 am »
OK, I'm dumb.  I uploaded the wrong files.  Correct versions are attached now.

Offline Vonna

  • BeBot Rookie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: Run BeBot as a Windows service
« Reply #3 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.

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 292
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal