The mailman init script has the following issues: * when mailman is unconfigured, `service mailman start' should exit with code 6, not 1. * `try-restart' isn't implemented. This is an addition to condrestart and should have the same effect. * stopping mailman doesn't remove its pid file. This is visible when attempting to stop an already stopped service: # service mailman stop Shutting down mailman: No child with pid: 14099 [Errno 3] No such process Stale pid file removed. So this is actually twofold: those two lines are quite scary, the init script shouldn't even attempt to stop the process if it isn't running, or it should handle this case more gracefully. And when stopping it, it should delete the pid file. (it already deletes the lock file) * when /var/lock/subsys/mailman exists but mailman isn't running, and `service mailman status' is executed, the script just prints 'mailman is stopped' and exits with code 3. In this case, it should say that it's dead but its subsys is locked, and exit with code 2. * when no known parameter is passed to the init script, it should exit with code 2, not 3. Version-Release number of selected component (if applicable): mailman-2.1.12-4.fc11 Additional info: See https://fedoraproject.org/wiki/Packaging/SysVInitScript for details.
Created attachment 361918 [details] a proposed patch to address those issues
Thanks, the patch isn't perfect, though. * `service mailman stop` when it's already stopped now prints: Shutting down mailman: No child with pid: 24270 [Errno 3] No such process Stale pid file removed. cat: /var/lock/mailman/master-qrunner: No such file or directory ] * `try-restart' wasn't added among options in the usage message.
thanks, try-restar fix is straightforward, I will analyze the pidfile thing
Created attachment 363654 [details] a new version of the patch try-restart fixed, stopping when stopped fixed
Unfortunately this version broke `status': # service mailman start Starting mailman: [ OK ] # echo $? 0 # service mailman status mailman dead but subsys locked # /usr/lib64/mailman/bin/mailmanctl status mailman (pid 7535) is running... Note that while the lock file is named mailman, the process isn't.
Umm, it was already broken in the previous patch, but I didn't get that far when verifying it.
Created attachment 363839 [details] 3rd version of the patch OK, let's handle "status" as before, but with a special case when the lock file exists
Works great. Thanks!
fixed in rawhide: mailman-2.1.12-10.fc13