* [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/
@ 2017-10-26 19:01 William Hubbs
0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2017-10-26 19:01 UTC (permalink / raw
To: gentoo-commits
commit: 558ff4d5fb90b751ebc2852ea907873af2c236fa
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Oct 26 18:36:41 2017 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Oct 26 19:01:07 2017 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=558ff4d5
supervise-daemon: log with the service name instead of "supervise-daemon"
src/rc/supervise-daemon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index b232e215..6c3c55bf 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -420,7 +420,6 @@ static void supervisor(char *exec, char **argv)
time_t respawn_now= 0;
time_t first_spawn= 0;
- openlog(applet, LOG_PID, LOG_DAEMON);
#ifndef RC_DEBUG
signal_setup_restart(SIGHUP, handle_signal);
signal_setup_restart(SIGINT, handle_signal);
@@ -561,6 +560,7 @@ int main(int argc, char **argv)
applet = basename_c(argv[0]);
atexit(cleanup);
svcname = getenv("RC_SVCNAME");
+ openlog(svcname, LOG_PID, LOG_DAEMON);
if ((tmp = getenv("SSD_NICELEVEL")))
if (sscanf(tmp, "%d", &nicelevel) != 1)
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/
@ 2017-10-26 19:01 William Hubbs
0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2017-10-26 19:01 UTC (permalink / raw
To: gentoo-commits
commit: d1491e201d3ad364e25a55b29ff8035775a6acac
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Oct 26 17:58:59 2017 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Oct 26 18:18:16 2017 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=d1491e20
supervise-daemon: remove child_pid from saved options during shutdown
This allows us to detect when the supervisor dies unexpectedly because
in that case child_pid will still exist.
src/rc/supervise-daemon.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index 998a01bc..b232e215 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -523,6 +523,7 @@ static void supervisor(char *exec, char **argv)
rc_service_daemon_set(svcname, exec, (const char *const *)argv,
pidfile, false);
rc_service_mark(svcname, RC_SERVICE_STOPPED);
+ rc_service_value_set(svcname, "child_pid", NULL);
}
exit(EXIT_SUCCESS);
}
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/
@ 2017-10-26 19:01 William Hubbs
0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2017-10-26 19:01 UTC (permalink / raw
To: gentoo-commits
commit: 6e6b4ac5fa935eb8052d293f2b8378e0395572e1
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Oct 26 18:57:04 2017 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Oct 26 19:01:07 2017 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=6e6b4ac5
supervise-daemon: log the command line we run to spawn the child process
src/rc/supervise-daemon.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index 6c3c55bf..abb4a59e 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -556,6 +556,7 @@ int main(int argc, char **argv)
int child_argc = 0;
char **child_argv = NULL;
char *str = NULL;
+ char cmdline[PATH_MAX];
applet = basename_c(argv[0]);
atexit(cleanup);
@@ -721,6 +722,13 @@ int main(int argc, char **argv)
if (!pidfile && !reexec)
eerrorx("%s: --pidfile must be specified", applet);
+ *cmdline = '\0';
+ c = argv;
+ while (c && *c) {
+ strcat(cmdline, *c);
+ strcat(cmdline, " ");
+ c++;
+ }
endpwent();
argc -= optind;
argv += optind;
@@ -818,6 +826,7 @@ int main(int argc, char **argv)
parse_schedule(applet, NULL, sig);
einfov("Detaching to start `%s'", exec);
+ syslog(LOG_INFO, "Running command line: %s", cmdline);
/* Remove existing pidfile */
if (pidfile)
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/
@ 2017-10-26 19:19 William Hubbs
0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2017-10-26 19:19 UTC (permalink / raw
To: gentoo-commits
commit: eecf868e3c4a763b08cd4b3803f4839e8e710413
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Oct 26 19:15:40 2017 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Oct 26 19:15:40 2017 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=eecf868e
supervise-daemon: clarify a log message
src/rc/supervise-daemon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index abb4a59e..3c3d7c7e 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -826,7 +826,7 @@ int main(int argc, char **argv)
parse_schedule(applet, NULL, sig);
einfov("Detaching to start `%s'", exec);
- syslog(LOG_INFO, "Running command line: %s", cmdline);
+ syslog(LOG_INFO, "Supervisor command line: %s", cmdline);
/* Remove existing pidfile */
if (pidfile)
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/
@ 2017-10-28 0:29 William Hubbs
0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2017-10-28 0:29 UTC (permalink / raw
To: gentoo-commits
commit: 027438f7759dbbc19ac1bedeff3f502c891e4d4e
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Fri Oct 27 22:34:29 2017 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Oct 27 22:36:56 2017 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=027438f7
supervise-daemon: fix logging for reexec and the child command line
src/rc/supervise-daemon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index bf27ad18..1d0c3407 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -161,7 +161,7 @@ static void cleanup(void)
static void re_exec(void)
{
- syslog(LOG_WARNING, "Re-executing supervise-daemon");
+ syslog(LOG_WARNING, "Re-executing for %s", svcname);
execlp("supervise-daemon", "supervise-daemon", "--reexec", (char *) NULL);
syslog(LOG_ERR, "Unable to execute supervise-daemon: %s",
strerror(errno));
@@ -402,7 +402,7 @@ static void child_process(char *exec, char **argv)
strcat(cmdline, " ");
c++;
}
- syslog(LOG_INFO, "Running command line: %s", cmdline);
+ syslog(LOG_INFO, "Child command line: %s", cmdline);
execvp(exec, argv);
#ifdef HAVE_PAM
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/
@ 2017-10-28 0:29 William Hubbs
0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2017-10-28 0:29 UTC (permalink / raw
To: gentoo-commits
commit: 93e159ae8541b82fd5e1843f60dce135e2eb5517
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Fri Oct 27 20:32:26 2017 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Oct 27 20:32:26 2017 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=93e159ae
log as supervise-daemon not the service
src/rc/supervise-daemon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index 3c3d7c7e..bf27ad18 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -561,7 +561,7 @@ int main(int argc, char **argv)
applet = basename_c(argv[0]);
atexit(cleanup);
svcname = getenv("RC_SVCNAME");
- openlog(svcname, LOG_PID, LOG_DAEMON);
+ openlog(applet, LOG_PID, LOG_DAEMON);
if ((tmp = getenv("SSD_NICELEVEL")))
if (sscanf(tmp, "%d", &nicelevel) != 1)
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/
@ 2017-11-07 21:39 William Hubbs
0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2017-11-07 21:39 UTC (permalink / raw
To: gentoo-commits
commit: 1936d73eb1aecf31029d53e75e6bb14e307f8e1c
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Mon Oct 30 23:21:39 2017 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Oct 30 23:23:11 2017 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=1936d73e
fix issue with --reexec call
src/rc/supervise-daemon.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index 3989cbc7..f3f51ff0 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -162,7 +162,8 @@ static void cleanup(void)
static void re_exec(void)
{
syslog(LOG_WARNING, "Re-executing for %s", svcname);
- execlp("supervise-daemon", "supervise-daemon", "--reexec", (char *) NULL);
+ execlp("supervise-daemon", "supervise-daemon", svcname, "--reexec",
+ (char *) NULL);
syslog(LOG_ERR, "Unable to execute supervise-daemon: %s",
strerror(errno));
exit(EXIT_FAILURE);
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/
@ 2017-11-07 21:39 William Hubbs
0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2017-11-07 21:39 UTC (permalink / raw
To: gentoo-commits
commit: d59197fafef164fe7319f9d87f544a8cc8e25044
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Tue Nov 7 21:30:21 2017 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Nov 7 21:38:11 2017 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=d59197fa
start-stop-daemon: do not use do_stop to verify whether a daemon is running
X-Gentoo-Bug: 636574
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=636574
src/rc/start-stop-daemon.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index dab8b3b1..e98f8ba3 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -279,6 +279,7 @@ int main(int argc, char **argv)
int stdout_fd;
int stderr_fd;
pid_t pid, spid;
+ RC_PIDLIST *pids;
int i;
char *svcname = getenv("RC_SVCNAME");
RC_STRINGLIST *env_list;
@@ -683,10 +684,14 @@ int main(int argc, char **argv)
else
pid = 0;
- if (do_stop(applet, exec, (const char * const *)margv, pid, uid,
- 0, test, false) > 0)
+ if (pid)
+ pids = rc_find_pids(NULL, NULL, 0, pid);
+ else
+ pids = rc_find_pids(exec, (const char * const *) argv, uid, 0);
+ if (pids)
eerrorx("%s: %s is already running", applet, exec);
+ free(pids);
if (test) {
if (rc_yesno(getenv("EINFO_QUIET")))
exit (EXIT_SUCCESS);
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/
@ 2017-11-20 17:56 William Hubbs
0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2017-11-20 17:56 UTC (permalink / raw
To: gentoo-commits
commit: 1732c70fb5e6d75c0d104662d06169978c00a5e8
Author: Doug Freed <dwfreed <AT> mtu <DOT> edu>
AuthorDate: Sun Nov 19 16:05:30 2017 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Nov 20 17:55:46 2017 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=1732c70f
rc-schedules: if given nothing to look for, stop
This avoids trying to kill everything.
X-Gentoo-Bug: 631958
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=631958
src/rc/rc-schedules.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/rc/rc-schedules.c b/src/rc/rc-schedules.c
index d60c2822..8f36f073 100644
--- a/src/rc/rc-schedules.c
+++ b/src/rc/rc-schedules.c
@@ -307,6 +307,9 @@ int run_stop_schedule(const char *applet,
const char *const *p;
bool progressed = false;
+ if (!(pid > 0 || exec || uid || (argv && *argv)))
+ return 0;
+
if (exec)
einfov("Will stop %s", exec);
if (pid > 0)
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/
@ 2017-11-27 19:09 William Hubbs
0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2017-11-27 19:09 UTC (permalink / raw
To: gentoo-commits
commit: bed1a4519295a86f7cc62a79604d73a8ae726103
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Mon Nov 27 17:09:43 2017 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Nov 27 18:49:44 2017 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=bed1a451
fix FreeBSD build
This is for #186.
src/rc/supervise-daemon.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index f3f51ff0..06d0bdb3 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -159,7 +159,7 @@ static void cleanup(void)
free(changeuser);
}
-static void re_exec(void)
+static void re_exec_supervisor(void)
{
syslog(LOG_WARNING, "Re-executing for %s", svcname);
execlp("supervise-daemon", "supervise-daemon", svcname, "--reexec",
@@ -180,7 +180,7 @@ static void handle_signal(int sig)
/* Restore errno */
errno = serrno;
if (! exiting)
- re_exec();
+ re_exec_supervisor();
}
static char * expand_home(const char *home, const char *path)
@@ -435,7 +435,9 @@ static void supervisor(char *exec, char **argv)
signal_setup_restart(SIGUSR1, handle_signal);
signal_setup_restart(SIGUSR2, handle_signal);
signal_setup_restart(SIGBUS, handle_signal);
+#ifdef SIGPOLL
signal_setup_restart(SIGPOLL, handle_signal);
+#endif
signal_setup_restart(SIGPROF, handle_signal);
signal_setup_restart(SIGSYS, handle_signal);
signal_setup_restart(SIGTRAP, handle_signal);
@@ -446,7 +448,9 @@ static void supervisor(char *exec, char **argv)
signal_setup_restart(SIGEMT, handle_signal);
#endif
signal_setup_restart(SIGIO, handle_signal);
+#ifdef SIGPWR
signal_setup_restart(SIGPWR, handle_signal);
+#endif
#ifdef SIGUNUSED
signal_setup_restart(SIGUNUSED, handle_signal);
#endif
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/
@ 2017-11-29 22:10 William Hubbs
0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2017-11-29 22:10 UTC (permalink / raw
To: gentoo-commits
commit: 97a254f599db622d34a0c1bbd3057d1a7050a468
Author: Doug Freed <dwfreed <AT> mtu <DOT> edu>
AuthorDate: Wed Nov 29 20:10:39 2017 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Wed Nov 29 21:53:42 2017 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=97a254f5
start-stop-daemon: properly handle missing pidfile
X-Gentoo-Bug: 639218
X-Gentoo-Bug-URL: https://bugs.gentoo.org/639218
src/rc/start-stop-daemon.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index e98f8ba3..54b89b2a 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -657,8 +657,15 @@ int main(int argc, char **argv)
parse_schedule(applet, "0", sig);
else
parse_schedule(applet, NULL, sig);
+ if (pidfile) {
+ pid = get_pid(applet, pidfile);
+ if (pid == -1)
+ exit(EXIT_FAILURE);
+ } else {
+ pid = 0;
+ }
i = run_stop_schedule(applet, exec, (const char *const *)margv,
- get_pid(applet, pidfile), uid, test, progress, false);
+ pid, uid, test, progress, false);
if (i < 0)
/* We failed to stop something */
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2017-11-29 22:10 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-07 21:39 [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/ William Hubbs
-- strict thread matches above, loose matches on Subject: below --
2017-11-29 22:10 William Hubbs
2017-11-27 19:09 William Hubbs
2017-11-20 17:56 William Hubbs
2017-11-07 21:39 William Hubbs
2017-10-28 0:29 William Hubbs
2017-10-28 0:29 William Hubbs
2017-10-26 19:19 William Hubbs
2017-10-26 19:01 William Hubbs
2017-10-26 19:01 William Hubbs
2017-10-26 19:01 William Hubbs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox