Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 307523 - net-proxy/cntlm init script doesn't stop the daemon
Summary: net-proxy/cntlm init script doesn't stop the daemon
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Markus Duft (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-02 19:49 UTC by Alexey Sarychev
Modified: 2011-11-07 07:30 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for /etc/init.d/cntlm (cntlm.path,747 bytes, patch)
2010-03-02 20:06 UTC, Alexey Sarychev
Details | Diff
Another fix. (cntlm.path2,412 bytes, patch)
2010-03-02 20:31 UTC, Alexey Sarychev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 :)