It seems that the author of start-stop-daemon deliberately let it slip when the pidfile is missing: from start-stop-daemon.c, line 722: static void do_pidfile(const char *name) { FILE *f; pid_t pid; f = fopen(name, "r"); if (f) { if (fscanf(f, "%d", &pid) == 1) check(pid); fclose(f); } else if (errno != ENOENT) fatal("open pidfile %s: %s", name, strerror(errno)); } that means that if opening the pidfile fails with ENOENT it will not check any pid and will not bail with an errorcode/error message. a fix would trivially be: --- start-stop-daemon.c.orig 2004-05-10 17:21:55.000000000 +0300 +++ start-stop-daemon.c 2004-11-23 00:58:04.688000048 +0200 @@ -730,8 +730,7 @@ if (fscanf(f, "%d", &pid) == 1) check(pid); fclose(f); - } else if (errno != ENOENT) - fatal("open pidfile %s: %s", name, strerror(errno)); + } else fatal("open pidfile %s: %s", name, strerror(errno)); }
I punted this part of the darwin patch, as its not related, and I think this should be reviewed. Personally I think it might go the other way, as the manpage do not say that the pidfile have to exist .. you can for example stack --pidfile and --exec, and the better fix might be: ----- Index: src/start-stop-daemon.c =================================================================== --- src/start-stop-daemon.c (revision 1312) +++ src/start-stop-daemon.c (working copy) @@ -1022,9 +1022,11 @@ { clear(&found); - if (pidfile) + if (pidfile) { do_pidfile(pidfile); - else + if (!found) + do_procinit(); + } else do_procinit(); }
any resolution to this issue? should this we close this as WONTFIX?
(In reply to comment #2) > any resolution to this issue? should this we close this as WONTFIX? No, it's just not something we've gotten around to yet.
OK, this is a problem and will be fixed in baselayout-1.13.0_alpha2
Your both right btw - we need to only error if we're stopping :) Anyway, alpha2 is out so fixed.