Compare commits

...

12 Commits

Author SHA1 Message Date
Oleg Vinichenko
96ef50c2f9 Revert "Make einfo routines private"
This reverts commit de88aff0a8.
2013-10-16 16:50:48 +00:00
Daniel Robbins
edb7e73b34 FL-786: set version to 0.12.1 2013-10-08 17:29:01 +00:00
Daniel Robbins
a1ab17889d Merge branch 'master' into fooby 2013-10-08 17:25:58 +00:00
William Hubbs
4b37d3b16f netmount: add -lxc keyword
Netmount should not run on lxc, thanks to Mark van Dijk <funtoo@internecto.net>.
2013-10-08 10:34:45 -05:00
William Hubbs
82378bd92d 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.
2013-10-06 12:00:37 -05:00
Daniel Robbins
e6df76a377 FL-786: localmount: support filesystem mounting on openvz 2013-10-04 15:16:05 -05:00
Natanael Copa
03c67bcc27 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-04 14:02:02 -05:00
Natanael Copa
681a37e7bd 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-04 14:01:46 -05:00
William Hubbs
56d592866c 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-09-30 16:55:25 -05:00
Oleg Vinichenko
67b2255ebb FL-786: openrc: remove loopback interface 2013-09-30 12:45:36 +00:00
William Hubbs
993e7d7044 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-09-27 15:55:46 -05:00
William Hubbs
de88aff0a8 Make einfo routines private
The libeinfo library has no consumers other than OpenRC, so there is no
reason for it to be maintained as a library. The einfo routines are now
an object that links with the rc binary.
2013-09-26 22:18:21 -05:00
12 changed files with 14 additions and 49 deletions

View File

@@ -1,3 +1,3 @@
NAME= openrc NAME= openrc
VERSION= 0.13 VERSION= 0.12.1
PKG= ${NAME}-${VERSION} PKG= ${NAME}-${VERSION}

1
init.d/.gitignore vendored
View File

@@ -3,7 +3,6 @@ fsck
hostname hostname
local local
localmount localmount
loopback
moused moused
netmount netmount
network network

View File

@@ -1,7 +1,7 @@
include ../mk/net.mk include ../mk/net.mk
DIR= ${INITDIR} DIR= ${INITDIR}
SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in loopback.in \ SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in \
netmount.in root.in savecache.in swap.in swapfiles.in \ netmount.in root.in savecache.in swap.in swapfiles.in \
tmpfiles.setup.in swclock.in sysctl.in urandom.in ${SRCS-${OS}} tmpfiles.setup.in swclock.in sysctl.in urandom.in ${SRCS-${OS}}
BIN= ${OBJS} BIN= ${OBJS}

View File

@@ -1,35 +0,0 @@
#!@SBINDIR@/runscript
# Copyright (c) 2013 William Hubbs <w.d.hubbs@gmail.com>
# Released under the 2-clause BSD license.
description="Configures the loopback interface."
depend()
{
return 0
}
start()
{
if [ "$RC_UNAME" = Linux ]; then
ebegin "Bringing up network interface lo"
if type ip > /dev/null 2>&1; then
ip addr add 127.0.0.1/8 dev lo brd + scope host
ip route add 127.0.0.0/8 dev lo scope host
ip link set lo up
else
ifconfig lo 127.0.0.1 netmask 255.0.0.0
route add -net 127.0.0.0 netmask 255.0.0.0 gw 127.0.0.1
fi
else
ebegin "Bringing up network interface lo0"
ifconfig lo0 127.0.0.1 netmask 255.0.0.0
route -q add -inet 127.0.0.0 -netmask 255.0.0.0 127.0.0.1
fi
eend $?
}
stop()
{
return 0
}

View File

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

View File

@@ -1 +1 @@
MKNET?= yes MKNET?= no

View File

@@ -1,6 +1,6 @@
include ../mk/net.mk include ../mk/net.mk
BOOT= bootmisc fsck hostname localmount loopback \ BOOT= bootmisc fsck hostname localmount \
root swap swapfiles sysctl urandom ${BOOT-${OS}} root swap swapfiles sysctl urandom ${BOOT-${OS}}
DEFAULT= local netmount DEFAULT= local netmount
SHUTDOWN= savecache ${SHUTDOWN-${OS}} SHUTDOWN= savecache ${SHUTDOWN-${OS}}

View File

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

View File

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

View File

@@ -856,7 +856,7 @@ rc_deptree_update(void)
* work for them. This doesn't stop them from being run directly. */ * work for them. This doesn't stop them from being run directly. */
if (sys) { if (sys) {
len = strlen(sys); len = strlen(sys);
nosys = xmalloc(len + 1); nosys = xmalloc(len + 2);
nosys[0] = '-'; nosys[0] = '-';
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
nosys[i + 1] = (char)tolower((unsigned char)sys[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; str += strlen(str) + 1;
/* len is the size of allocated buffer and we don't /* len is the size of allocated buffer and we don't
want call regexec BUFSIZE times. find next str */ want call regexec BUFSIZE times. find next str */
while (*str == '\0' && str < line + len) while (str < line + len && *str == '\0')
str++; str++;
} while (str < line + len); } while (str < line + len);
} }

View File

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