Bug 4699 - smbd does not remove /var/run/smbd.pid file even if signal TERM is given to it
Summary: smbd does not remove /var/run/smbd.pid file even if signal TERM is given to it
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: clustering (show other bugs)
Version: 3.0.9
Hardware: Other Linux
: P3 critical
Target Milestone: none
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
: 4726 5999 (view as bug list)
Depends on:
Reported: 2007-06-14 06:37 UTC by Vishal Mathur
Modified: 2014-10-20 22:38 UTC (History)
5 users (show)

See Also:

Patch for master (4.06 KB, patch)
2009-06-18 04:49 UTC, Volker Lendecke
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vishal Mathur 2007-06-14 06:37:22 UTC
I am having samba version Version 3.0.10-1.4E.6 and my smbd server works fine.
But if I kill the smbd from my C program (or even by console) using sig TERM still it does not clean up the smbd.pid file.
It assumes that it will be alwasy stopped by service smb stop and killproc will clean its pid file.
This happens even if I use smbcontrol command.

Can you please tell me if there is work arround for me so that i can know that smbd server is killed gracefully or got some fault. ??
Comment 1 Gerald (Jerry) Carter (dead mail address) 2007-06-14 07:21:36 UTC
If smbd dies via abort, isgbus, or segv, you will see it recorded
in smbd log files.  I agree that not removing the pid file ourselves
is probably a bug.
Comment 2 Vishal Mathur 2007-06-18 04:37:57 UTC
Yes PID file cleaning up is a method by which server informs users / admin that it is grace fully stopped by manual operation.
It is important for my C monitoring program to know that smbd server is stopped by admin or because of some crash / another issue. This is required so that it can restart smbd if it is stopped because of some crash.

Is there is any other way to find this?
If yes then please let me know so that I can use that method for time being.

IF no then what is the resolution? What is the time frame / patch in which this issue can be resolved?
Comment 3 Debian samba package maintainers (PUBLIC MAILING LIST) 2008-08-11 16:13:05 UTC
*** Bug 4726 has been marked as a duplicate of this bug. ***
Comment 4 Debian samba package maintainers (PUBLIC MAILING LIST) 2008-08-11 16:15:00 UTC
nmdb and windbind don't removed their PID file, too.

Comment 5 Volker Lendecke 2009-06-18 04:49:13 UTC
Created attachment 4304 [details]
Patch for master

Attached find a patch that should solve this. Do we want it?

Comment 6 Jeremy Allison 2009-06-18 18:23:46 UTC
Yes - pushed to master :-). Thanks !
Comment 7 Karolin Seeger 2009-06-19 03:00:54 UTC
Should the patch go into any of the release branches?
Comment 8 Volker Lendecke 2009-06-19 03:10:10 UTC
3.4 if at all. Your call :-)

Comment 9 Karolin Seeger 2009-06-27 03:41:16 UTC
Pushed to v3-4-test.
Closing out bug report.

Comment 10 Björn Jacke 2014-10-20 22:38:11 UTC
*** Bug 5999 has been marked as a duplicate of this bug. ***