Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 307523

Summary: net-proxy/cntlm init script doesn't stop the daemon
Product: Gentoo Linux Reporter: Alexey Sarychev <alx_s>
Component: Current packagesAssignee: Markus Duft (RETIRED) <mduft>
Status: RESOLVED FIXED    
Severity: minor CC: martin.holzer
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch for /etc/init.d/cntlm
Another fix.

Description Alexey Sarychev 2010-03-02 19:49:22 UTC
When I run '/etc/init.d/cntlm stop' cntlm doesn't actually stop, while rc-status shows it as stopped. It has to be killed manually if I want to start it again.
Comment 1 Alexey Sarychev 2010-03-02 20:06:40 UTC
Created attachment 221853 [details, diff]
Patch for /etc/init.d/cntlm

This patch fixes the problem by not using pidfile for cntlm daemon.

The problem with pidfile - if pidfile is created by /sbin/start-stop-daemon then it contains wrong pid - cntlm forks a background child and the parent is exiting while start-stop-daemon puts parent's pid into the pidfile.
If cntlm -P option is used to create a pidfile, then it requires /var/run to be writable by cntlm user, as cntlm will try to create the pidfile only after it changed it's UID to unprivileged cntlm user.

So killing cntlm by process name instead of PID will work, unless you are running multiple cntlm daemons under the same user account and want to be able to start/stop them separately.
Comment 2 Alexey Sarychev 2010-03-02 20:31:35 UTC
Created attachment 221855 [details, diff]
Another fix.

Another fix - this time by telling cntlm to not fork into background - this way standard pidfile logic will work. So take your pick. :)
Comment 3 martin holzer 2011-10-31 07:37:45 UTC
any news on this ?
Comment 4 Miroslaw Mieszczak 2011-11-03 14:50:59 UTC
The latest patch is working, I made it on the same way as Alexy, and it works for me well.
Comment 5 Markus Duft (RETIRED) gentoo-dev 2011-11-07 07:30:27 UTC
applied. thanks for the valid fix alexey :)