Compare commits

...

9 Commits

Author SHA1 Message Date
Daniel Robbins
c420f56856 FL-786: localmount: support filesystem mounting on openvz 2013-10-08 12:06:09 -05:00
Natanael Copa
5b0f323da9 librc: fix off-by-one bug
We need allocate space for both the added leading '-' and the trailing
'\0'.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2013-10-08 12:06:09 -05:00
Natanael Copa
d86853538a librc: fix a read off-by-one bug
We should first check if we are within bounds and then read rather than
the opposite.

This makes valgrind happy.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2013-10-08 12:06:09 -05:00
William Hubbs
f2c0e700c6 netmount: add -lxc keyword
Netmount should not run on lxc, thanks to Mark van Dijk <funtoo@internecto.net>.
2013-10-08 12:06:09 -05:00
William Hubbs
b1de9d7324 start-stop-daemon: fix do_stop calls
Several calls to do_stop were forcing the test parameter to be true,
which was causing extra output to the terminal, such as:

* Would send signal 0 to pid xxxxx

This should only happen if the --test command line option was used.

Conflicts:
	src/rc/start-stop-daemon.c
2013-10-08 12:06:09 -05:00
William Hubbs
5b4886d23e start-stop-daemon: fix eerorr calls in get_pid
The eerror calls in this function make it too verbose, so change them to
ewarnv() calls instead. This means that they will only print if the
--verbose option is used or EINFO_VERBOSE=yes is set in the environment.
2013-10-08 12:06:09 -05:00
William Hubbs
2a53efbc07 start work on OpenRC-0.12.2 2013-10-08 12:03:47 -05:00
William Hubbs
a530722f65 fix cgroup_cleanup function
The yesno test for rc_cgroup_cleanup belongs at the point where this
function is called from runscript, not in the function itself.

X-Gentoo-Bug: 486210
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=486210
2013-10-02 05:43:51 -05:00
William Hubbs
661e9cf002 start work on OpenRC 0.12.1 2013-10-02 05:40:18 -05:00
8 changed files with 12 additions and 13 deletions

View File

@@ -1,3 +1,3 @@
NAME= openrc
VERSION= 0.12
VERSION= 0.12.2
PKG= ${NAME}-${VERSION}

View File

@@ -9,7 +9,7 @@ depend()
need fsck
use lvm modules mtab
after lvm modules
keyword -jail -openvz -prefix -vserver -lxc
keyword -jail -prefix -vserver -lxc
}
start()

View File

@@ -12,7 +12,7 @@ depend()
config /etc/fstab
use afc-client amd autofs openvpn
use dns
keyword -jail -prefix -vserver
keyword -jail -prefix -vserver -lxc
}
start()

View File

@@ -116,7 +116,7 @@ cgroup_set_limits()
cgroup_cleanup()
{
yesno "${rc_cgroup_cleanup:-no}" && cgroup_running || return 0
cgroup_running || return 0
ebegin "starting cgroups cleanup"
for sig in TERM QUIT INT; do
cgroup_get_pids || { eend 0 "finished" ; return 0 ; }

View File

@@ -308,6 +308,7 @@ while [ -n "$1" ]; do
fi
[ "$(command -v cgroup_cleanup)" = "cgroup_cleanup" -a \
"$1" = "stop" ] && \
yesno "${rc_cgroup_cleanup}" && \
cgroup_cleanup
shift
continue 2

View File

@@ -856,7 +856,7 @@ rc_deptree_update(void)
* work for them. This doesn't stop them from being run directly. */
if (sys) {
len = strlen(sys);
nosys = xmalloc(len + 1);
nosys = xmalloc(len + 2);
nosys[0] = '-';
for (i = 0; i < len; i++)
nosys[i + 1] = (char)tolower((unsigned char)sys[i]);

View File

@@ -193,7 +193,7 @@ file_regex(const char *file, const char *regex)
str += strlen(str) + 1;
/* len is the size of allocated buffer and we don't
want call regexec BUFSIZE times. find next str */
while (*str == '\0' && str < line + len)
while (str < line + len && *str == '\0')
str++;
} while (str < line + len);
}

View File

@@ -316,14 +316,12 @@ get_pid(const char *pidfile, bool quiet)
return -1;
if ((fp = fopen(pidfile, "r")) == NULL) {
if (!quiet)
eerror("%s: fopen `%s': %s", applet, pidfile, strerror(errno));
ewarnv("%s: fopen `%s': %s", applet, pidfile, strerror(errno));
return -1;
}
if (fscanf(fp, "%d", &pid) != 1) {
if (!quiet)
eerror("%s: no pid found in `%s'", applet, pidfile);
ewarnv("%s: no pid found in `%s'", applet, pidfile);
fclose(fp);
return -1;
}
@@ -461,7 +459,7 @@ run_stop_schedule(const char *exec, const char *const *argv,
{
if ((nrunning = do_stop(exec, argv,
pid, uid, 0, true, false,
true)) == 0)
test)) == 0)
return 0;
@@ -1088,7 +1086,7 @@ start_stop_daemon(int argc, char **argv)
pid = 0;
if (do_stop(exec, (const char * const *)margv, pid, uid,
0, true, false, true) > 0)
0, true, false, test) > 0)
eerrorx("%s: %s is already running", applet, exec);
if (test) {
@@ -1366,7 +1364,7 @@ start_stop_daemon(int argc, char **argv)
} else
pid = 0;
if (do_stop(exec, (const char *const *)margv,
pid, uid, 0, true, false, true) > 0)
pid, uid, 0, true, false, test) > 0)
alive = true;
}