Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
incorrect pid in --pidfile using --make-pidfile in rc-script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
bigV
Tux's lil' helper
Tux's lil' helper


Joined: 05 Dec 2002
Posts: 102
Location: Southampton, UK

PostPosted: Sat Jan 18, 2003 12:42 pm    Post subject: incorrect pid in --pidfile using --make-pidfile in rc-script Reply with quote

I have created an rc-script file to start/stop a daemon. When I use --make-pidfile in conjunction with start-stop-daemon, the pid written to the file I specify is the real pid -1
i.e. a ps -auxww returns 4288 but --make-pidfile writes 4287 to the pid file. Hence when I come to use start-stop-daemon --pidfile, the pid is incorrect and I get an error stating so!!

Any Ideas

Thanks
Back to top
View user's profile Send private message
slartibartfasz
Veteran
Veteran


Joined: 29 Oct 2002
Posts: 1462
Location: Vienna, Austria

PostPosted: Sat Jan 18, 2003 3:01 pm    Post subject: Reply with quote

this may be due to forking of the process - some demons fork when they are started so u have to kill the 'next' process, however u cant count on this - the quick and very(!) dirty solution is to simply add '1' to the pid you try to kill...
_________________
To an engineer the glass is neither half full, nor half empty - it is just twice as big as it needs to be.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum