shibd removes the pidfile even if it didn't create it

Description

Shibd should not touch the pid file when started with the -t or the -f option, because that may cripple a running daemon.
Suggested patch attached.

Environment

None

Attachments

1
  • 07 Dec 2009, 06:19 AM

Activity

Scott Cantor December 17, 2010 at 2:39 PM

Closing after release.

Scott Cantor December 9, 2009 at 10:30 AM

I don't close issues until I cut a release with the fix anyway.

Ferenc Wágner December 9, 2009 at 9:46 AM
Edited

I confirm that the patch in SVN fixes this issue. Thanks again!
Unfortunately I can't find a way to close it.

Ferenc Wágner December 7, 2009 at 9:33 AM
Edited

You are right on both points: I meant -F and broke the normal shutdown.

The current code (with your fix included) looks good, but isn't transparent, as it hinges on -t implying -F during argument processing.
Below is how I'd do it (gratuitous, jfyi, probably buggy, etc.). Thanks a lot for the fix!

if (shar_checkonly) {
fprintf...
conf.term();
return 0;
}

ListenerService* listener = ...

...

bool success = listener->run(&shibd_shutdown);
listener->term();
conf.term();
if (daemonize && pidfile)
unlink (pidfile);
if (!success) {
fprintf...
return -3;
}
return 0;

Scott Cantor December 7, 2009 at 8:59 AM

http://svn.middleware.georgetown.edu/view/cpp-sp?view=rev&revision=3209

Slightly revised, your patch wasn't removing the file even on normal shutdown of the daemon.

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Created December 7, 2009 at 6:19 AM
Updated June 22, 2021 at 10:58 PM
Resolved December 7, 2009 at 8:59 AM