Compare commits

...

9 Commits

Author SHA1 Message Date
William Hubbs
422795e2ce Update ChangeLog 2017-11-16 16:34:44 -06:00
William Hubbs
00ad99a292 s6 supervisor fixes
Add the ability to force-kill a service if it does not go down
successfully. Also, adjust the default wait time for an s6 service to go
down to 60 seconds.
2017-11-16 16:03:08 -06:00
William Hubbs
f026c2c541 version 0.34.8 2017-11-16 16:03:03 -06:00
William Hubbs
4d20309ffe Update ChangeLog 2017-11-13 17:54:52 -06:00
William Hubbs
65439ba023 rc_find_pids: namespace fix
Ignore namespaces if there are errors reading either the pid namespace
for the current process or the process we aare testing.

This fixes https://github.com/openrc/openrc/issues/180.
2017-11-13 17:47:56 -06:00
William Hubbs
86162f3f47 version 0.34.7 2017-11-13 17:35:02 -06:00
William Hubbs
b98e83ee91 Update ChangeLog 2017-11-07 16:01:08 -06:00
William Hubbs
d59197fafe 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
2017-11-07 15:38:11 -06:00
William Hubbs
b66c86c9ee version 0.34.6 2017-11-07 15:37:43 -06:00
7 changed files with 102 additions and 46 deletions

106
ChangeLog
View File

@@ -1,3 +1,69 @@
commit 00ad99a29223e1567752191e748822710e1042e6
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
s6 supervisor fixes
Add the ability to force-kill a service if it does not go down
successfully. Also, adjust the default wait time for an s6 service to go
down to 60 seconds.
commit f026c2c541f43eadbaed51b93379fdf56e1f1d0a
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
version 0.34.8
commit 4d20309ffeb5f0211957bbbc5c875dab434b5079
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Update ChangeLog
commit 65439ba023195786e71316f6638b52603e102f60
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
rc_find_pids: namespace fix
Ignore namespaces if there are errors reading either the pid namespace
for the current process or the process we aare testing.
This fixes https://github.com/openrc/openrc/issues/180.
commit 86162f3f47c393fc173de0458eeeb322c0bb61f2
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
version 0.34.7
commit b98e83ee9195eb052fafebc440515f0b2d055a91
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Update ChangeLog
commit d59197fafef164fe7319f9d87f544a8cc8e25044
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit b66c86c9ee6d34d0a9d77140b8e7612709ba19d1
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
version 0.34.6
commit f7eb236f6fd8c10af211c6667940e8e1650c12da
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Update ChangeLog
commit 1936d73eb1aecf31029d53e75e6bb14e307f8e1c
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
@@ -1580,43 +1646,3 @@ Commit: William Hubbs <w.d.hubbs@gmail.com>
selinux: fix SIGSEGV with invalid contexts
Fixes: https://github.com/openrc/openrc/issues/104
commit 4f9bd7e4db185ce6debbebb5242344d8ffadc3ae
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
init.d/loopback.in: drop the route to the loopback interface on Linux
This is related to #103.
commit bf539f2196290864ce5c5fd0d679b74ee016e2da
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
init.d/mount-ro: do not remount /usr read only if it is premounted
X-Gentoo-Bug: 573760
X-Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=573760
commit 20b60ea904612669dfb744beffcd8e7e447f69ef
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
conf.d/net-online: clarify comment about interfaces setting
This setting refers to all interfaces that support ethernet
commit f53c8baef3a6215077c00901759cbbcbe8f10e9b
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
init.d/net-online: remove interfaces and timeout from local declarations
X-Gentoo-Bug: 598621
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=598621
commit be06cd250e12e63b8eb704bb2508e06fb9791251
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
src/rc/rc: do not try to start services if fork fails

View File

@@ -1,3 +1,3 @@
NAME= openrc
VERSION= 0.34.5
VERSION= 0.34.8
PKG= ${NAME}-${VERSION}

View File

@@ -111,9 +111,12 @@ The path to the s6 service directory if you are monitoring this service
with S6. The default is /var/svc.d/${RC_SVCNAME}.
.It Ar s6_svwait_options_start
The options to pass to s6-svwait when starting the service via s6.
.It Ar s6_force_kill
Should we force-kill this service if s6_service_timeout_stop expires
but the service doesn't go down during shutdown? The default is yes.
.It Ar s6_service_timeout_stop
The amount of time, in milliseconds, s6-svc should wait for the service
to go down when stopping the service. The default is 10000.
to go down when stopping the service. The default is 60000.
.It Ar start_stop_daemon_args
List of arguments passed to start-stop-daemon when starting the daemon.
.It Ar command

View File

@@ -39,6 +39,10 @@ s6_service_path - the path to the s6 service directory. The default is
s6_svwait_options_start - the options to pass to s6-svwait when starting
the service. If this is not set, s6-svwait will not be called.
s6_force_kill - Should we try to force kill this service if the
s6_service_timeout_stop timeout expires when shutting down this service?
The default is yes.
s6_service_timeout_stop - the amount of time, in milliseconds, s6-svc
should wait for a service to go down when stopping.

View File

@@ -12,6 +12,20 @@
[ -z "${s6_service_path}" ] && s6_service_path="/var/svc.d/${RC_SVCNAME}"
_s6_force_kill() {
local pid
s6_service_link="${RC_SVCDIR}/s6-scan/${s6_service_path##*/}"
pid="${3%)}"
[ -z "${pid}" ] && return 0
if kill -0 "${pid}" 2> /dev/null; then
ewarn "Sending DOWN & KILL for ${RC_SVCNAME}"
s6-svc -dk "${s6_service_link}"
sleep 1
kill -0 "${pid}" 2>/dev/null && return 1
fi
return 0
}
s6_start()
{
if [ ! -d "${s6_service_path}" ]; then
@@ -41,7 +55,11 @@ s6_stop()
fi
s6_service_link="${RC_SVCDIR}/s6-scan/${s6_service_path##*/}"
ebegin "Stopping ${name:-$RC_SVCNAME}"
s6-svc -wD -d -T ${s6_service_timeout_stop:-10000} "${s6_service_link}"
s6-svc -d -wD -T ${s6_service_timeout_stop:-60000} "${s6_service_link}"
set -- $(s6-svstat "${s6_service_link}")
[ "$1" = "up" ] &&
yesno "${s6_force_kill:-yes}" &&
_s6_force_kill "$@"
set -- $(s6-svstat "${s6_service_link}")
[ "$1" = "down" ]
eend $? "Failed to stop ${name:-$RC_SVCNAME}"

View File

@@ -155,7 +155,7 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid)
if (rc <= 0)
proc_ns[0] = '\0';
}
if (strcmp(my_ns, proc_ns))
if (strlen(my_ns) && strlen (proc_ns) && strcmp(my_ns, proc_ns))
continue;
if (uid) {
snprintf(buffer, sizeof(buffer), "/proc/%d", p);

View File

@@ -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);