Because you are not stopping the daemon correctly, you are leaving behind the process ID file. When the daemon starts, the way it checks to see if another instance is running is to check whether that file exists (obviously, this is the error it is showing you); upon finding it, it exits with the error you see.
The better way to stop the daemon (not that you've told us how you're doing it) is to read your log file where it tells you exactly what to do: 2009-12-26 22:18:21,722 - denyhosts : INFO DenyHosts daemon is now running, pid: 350 2009-12-26 22:18:21,722 - denyhosts : INFO send daemon process a TERM signal to terminate cleanly 2009-12-26 22:18:21,723 - denyhosts : INFO eg. kill -TERM 350 ... so in my current example I would: sudo kill -TERM 350 ... but that is because the current instance of my daemon is running with process ID 350. If you do this correctly, /var/run/denyhosts.pid will be removed by the daemon for you. Another way of finding the pid of the daemon is to simply: cat /var/run/denyhosts.pid ... which would also give you the value of the pid. Cheers, Robert [email protected] wrote: > That is the problem. > WhenI go to stop the daemon, it says it isn't running. > Then I go to start it again, it complains about the file. > So I delete the file, and start it, but the next time I want to repeat > it does the exact same thing. > I guess I am asking why it doesn't recognize that it is running, and why > it possibly doesn't stop it. > > -Michael > > AI5HF > > Http://ai5hf.mtgames.org/ > http://moo.mtgames.org/ > "A world that contained something as amazing as that bumblebee was a > world in which he wanted to live." -- Christopher Paolini, Brisingr > "The songs of the dead are the lamentations of the living." -- > Christopher Paolini, Eldest > skype: lilmike2 > msn: [email protected] > gmail: [email protected] > > pc details: > Intel quad core q6700-2.66 GHz; 4 gb ddr2 duel channel ram; 500 gb > harddrive; windows xp pro. > > > -------------------------------------------------- > From: "Robert Wyatt" <[email protected]> > Sent: Sunday, December 27, 2009 11:06 PM > To: <[email protected]> > Cc: <[email protected]> > Subject: Re: [Denyhosts-user] problem with the denyhosts daemon-control > script > >> [email protected] wrote: >>> Hi, >>> I have a problem with the denyhosts daemon-control script. >>> When I do daemon-control stop, it give me this: >>> DenyHosts is not running >>> r...@mtgames:/usr/share/denyhosts >>> <mailto:r...@mtgames:/usr/share/denyhosts># >>> Then I do start, and: >>> starting DenyHosts: /usr/bin/env python /usr/local/bin/denyhosts.py >>> --daemon >>> --config=/usr/share/denyhosts/denyhosts.cfg >>> DenyHosts could not obtain lock (pid: 5818) >>> [Errno 17] File exists: '/var/run/denyhosts.pid' >> >> Try: >> >> sudo rm /var/run/denyhosts.pid >> >> and then try to restart your daemon. >> >> >>> r...@mtgames:/usr/share/denyhosts >>> <mailto:r...@mtgames:/usr/share/denyhosts># >>> I don't know why it either is not starting when I start it after >>> removing denyhosts.pid, or not stopping, or anything else why it would >>> be doing this. >>> As another note, this is a line from ps ux >>> root 5818 0.0 1.2 9572 4452 ? S 21:35 0:00 python /usr/loc >>> I think that is referring to /usr/local/bin/denyhosts.py, but not sure. >>> Any help is appreciated. >>> -Michael >>> AI5HF >>> Http://ai5hf.mtgames.org/ <http://ai5hf.mtgames.org/> >>> http://moo.mtgames.org/ >>> "A world that contained something as amazing as that bumblebee was a >>> world in which he wanted to live." -- Christopher Paolini, Brisingr >>> "The songs of the dead are the lamentations of the living." -- >>> Christopher Paolini, Eldest >>> skype: lilmike2 >>> msn: [email protected] <mailto:[email protected]> >>> gmail: [email protected] <mailto:[email protected]> >>> pc details: >>> Intel quad core q6700-2.66 GHz; 4 gb ddr2 duel channel ram; 500 gb >>> harddrive; windows xp pro. >> ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Denyhosts-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/denyhosts-user
