From: Johnson, M. \(GE Healthcare\) <Mat...@me...> - 2005-04-01 22:25:29
|
Hi all, I've been using webmin under cygwin for some time now (mainly to do my own thing, not using many standard webmin modules). I've just figured out how to get webmin running as a service using cygrunsrv. However to do so, I had to patch miniserv.pl. Basically, to get this working right, I had to keep the main process from forking and exiting. I thought I'd tell you what I did and propose a change if = people think it makes sense. I created a new entry in the miniserv.conf file called nofork=3D1. Then = I made the following change to miniserv.pl. The diff: <STARTDIFF> @@ -437,9 +437,7 @@ } # Split from the controlling terminal -if (!$config{'nofork'}){ - if (fork()) { exit; } -} +if (fork()) { exit; } setsid(); # Close standard file handles <ENDDIFF> Then, I installed the service via cygwin with this script: <STARTSCRIPT> #!/bin/sh cygrunsrv -I webmin \ -p /usr/bin/bash \ -a "-c '/usr/local/webmin/miniserv.pl /etc/webmin/miniserv.conf'" \ -d "Webmin Service" \ -e PERLLIB=3D/usr/local/webmin \ -e LANG=3D \ <ENDSCRIPT> Then, *POOF* you have a windows service managing webmin. I thought I'd suggest making the changes to allow us lowly cygwin users more flexibility. Any problems with this? Any thoughts? /Matt |