aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2018-11-15 14:15:06 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2018-11-15 14:15:15 -0600
commit0f704402a236d385e8b30083ccf9aca327c0a57e (patch)
treecab8560446f56497eb22946ce006b5a072ba8d5e /src
parent2504a2c25bc0587b36d81a2d85c203b20e2d40cf (diff)
supervise-daemon: make the pidfile an implementation detail
The pidfile of the supervisor doesn't need to be adjustable by the service script. It is only used so the supervisor can stop itself when the --stop option is used.
Diffstat (limited to 'src')
-rw-r--r--src/rc/supervise-daemon.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index 52525c19..99159ef3 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -766,7 +766,7 @@ int main(int argc, char **argv)
break;
case 'p': /* --pidfile <pid-file> */
- pidfile = optarg;
+ ewarn("%s: --pidfile is deprecated and will be removed", applet);
break;
case 'R': /* --retry <schedule>|timeout */
@@ -830,8 +830,6 @@ int main(int argc, char **argv)
case_RC_COMMON_GETOPT
}
- if (!pidfile && !reexec)
- eerrorx("%s: --pidfile must be specified", applet);
endpwent();
argc -= optind;
argv += optind;
@@ -844,6 +842,7 @@ int main(int argc, char **argv)
ch_root = expand_home(home, ch_root);
umask(numask);
+ xasprintf(&pidfile, "/var/run/supervise-%s.pid", svcname);
if (reexec) {
str = rc_service_value_get(svcname, "argc");
@@ -862,7 +861,6 @@ int main(int argc, char **argv)
sscanf(str, "%d", &child_pid);
free(str);
exec = rc_service_value_get(svcname, "exec");
- pidfile = rc_service_value_get(svcname, "pidfile");
retry = rc_service_value_get(svcname, "retry");
if (retry) {
parse_schedule(applet, retry, sig);
@@ -944,7 +942,6 @@ int main(int argc, char **argv)
eerrorx("%s: fopen `%s': %s", applet, pidfile, strerror(errno));
fclose(fp);
- rc_service_value_set(svcname, "pidfile", pidfile);
varbuf = NULL;
xasprintf(&varbuf, "%i", respawn_delay);
rc_service_value_set(svcname, "respawn_delay", varbuf);