denyhosts activated twice?

Ryan Schmidt ryandesign at macports.org
Fri Aug 20 09:47:20 PDT 2010


On Aug 20, 2010, at 04:20, LuKreme wrote:

> I installed and activated denyhosts from ports, but it is running twice and logging twice to the log file.
> 
> root       135   0.0  0.1  2448616   9100   ??  S     7:53PM   0:04.00 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/denyhosts.py --daemon --config=/opt/local/share/denyhosts/denyhosts.cfg
> root       129   0.0  0.0  2454948   1076   ??  Ss    7:53PM   0:00.09 /opt/local/bin/daemondo --label=denyhosts --start-cmd /opt/local/etc/LaunchDaemons/org.macports.denyhosts/denyhosts.wrapper start ; --stop-cmd /opt/local/etc/LaunchDaemons/org.macports.denyhosts/denyhosts.wrapper stop ; --restart-cmd /opt/local/etc/LaunchDaemons/org.macports.denyhosts/denyhosts.wrapper restart ; --pid=fileclean --pidfile /opt/local/var/run/denyhosts.pid
> root       125   0.0  0.2  2449640  10536   ??  S     7:53PM   0:04.54 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/denyhosts.py --daemon --config=/opt/local/share/denyhosts/denyhosts.cfg
> 
> I looked in /opt/local/etc/LaunchDaemons/org.macports.denyhosts but that contains only two files, the plist and the .wrapper, and the plist just starts the wrapper.
> 
> I tried to use the wrapper to stop denyhosts:
> 
> # ./denyhosts.wrapper stop
> sent DenyHosts SIGTERM
> # psa denyhosts
> root       125   0.0  0.2  2449640  10536   ??  S     7:53PM   0:04.60 [path]/denyhosts.py --daemon --config=/opt/local/share/denyhosts/denyhosts.cfg
> root      3281   0.0  0.0  2442352   2012   ??  S     3:09AM   0:00.01 [path]/denyhosts.py --daemon --config=/opt/local/share/denyhosts/denyhosts.cfg
> root      3276   0.0  0.0  2454948   1076   ??  Ss    3:09AM   0:00.01 /opt/local/bin/daemondo --label=denyhosts --start-cmd /opt/local/etc/LaunchDaemons/org.macports.denyhosts/denyhosts.wrapper start ; --stop-cmd /opt/local/etc/LaunchDaemons/org.macports.denyhosts/denyhosts.wrapper stop ; --restart-cmd /opt/local/etc/LaunchDaemons/org.macports.denyhosts/denyhosts.wrapper restart ; --pid=fileclean --pidfile /opt/local/var/run/denyhosts.pid
> 
> As you can see, one of the processes was left untouched. If I manually kill the extra process it doesn't seem to come back, but I can't do that every time.
> 
> I suppose I could just completely uninstall denyhosts and redo it from start, but that doesn't seem like the ideal solution.

I'm not sure what's happening in your specific case. But note that the whole purpose of using launchd to control server processes is that it will relaunch a process that quits. So if you kill a process that's controlled by launchd, or you use some method other than launchd to stop a process (e.g. manually calling denyhosts.wrapper stop), launchd will assume the process crashed and will launch it again. So you really only want to be using launchd to start and stop processes. Or you can use the MacPorts wrapper around launchd, "sudo port load" and "sudo port unload".




More information about the macports-users mailing list