Compare commits
23 Commits
openrc-0.6
...
openrc-0.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b708852784 | ||
|
|
f700243016 | ||
|
|
b232e529f1 | ||
|
|
ae3186834f | ||
|
|
23546e27d9 | ||
|
|
1a188f8f72 | ||
|
|
89829f6d7c | ||
|
|
6e3b3bfc53 | ||
|
|
14c95ae9a6 | ||
|
|
d3ccbdb5a9 | ||
|
|
1cdf85e1ce | ||
|
|
2982cfab70 | ||
|
|
761fe99fe2 | ||
|
|
6f24d1cbd8 | ||
|
|
898552dcc3 | ||
|
|
6850566be0 | ||
|
|
3036b44798 | ||
|
|
acc0edb040 | ||
|
|
316a316d9b | ||
|
|
20b4076b12 | ||
|
|
4d86d34635 | ||
|
|
ae7a92ae7b | ||
|
|
67b538fd26 |
@@ -1,3 +1,3 @@
|
||||
NAME= openrc
|
||||
VERSION= 0.6.1
|
||||
VERSION= 0.6.3
|
||||
PKG= ${NAME}-${VERSION}
|
||||
|
||||
@@ -896,7 +896,7 @@
|
||||
# and you're done :)
|
||||
|
||||
# By default we don't wait for netplug/ifplugd to configure the interface.
|
||||
# If you would like it to wait so that other services now that network is up
|
||||
# If you would like it to wait so that other services know that network is up
|
||||
# then you can specify a timeout here.
|
||||
#plug_timeout="10"
|
||||
# A value of 0 means wait forever.
|
||||
@@ -936,8 +936,8 @@
|
||||
|
||||
#preup() {
|
||||
# # Test for link on the interface prior to bringing it up. This
|
||||
# # only works on some network adapters and requires the mii-diag
|
||||
# # package to be installed.
|
||||
# # only works on some network adapters and requires the
|
||||
# # sys-apps/net-tools package to be installed.
|
||||
# if mii-tool "${IFACE}" 2> /dev/null | grep -q 'no link'; then
|
||||
# ewarn "No link on ${IFACE}, aborting configuration"
|
||||
# return 1
|
||||
|
||||
@@ -8,7 +8,7 @@ depend()
|
||||
{
|
||||
need localmount termencoding
|
||||
after hotplug bootmisc
|
||||
keyword -openvz -prefix -uml -vserver -xenu
|
||||
keyword -openvz -prefix -uml -vserver -xenu -lxc
|
||||
}
|
||||
|
||||
start()
|
||||
|
||||
@@ -8,7 +8,7 @@ depend()
|
||||
{
|
||||
need localmount termencoding
|
||||
after bootmisc
|
||||
keyword -openvz -prefix -uml -vserver -xenu
|
||||
keyword -openvz -prefix -uml -vserver -xenu -lxc
|
||||
}
|
||||
|
||||
start()
|
||||
|
||||
@@ -63,17 +63,9 @@ tentative()
|
||||
|
||||
case "$RC_UNAME" in
|
||||
Linux)
|
||||
[ -x /sbin/ip ] || return 1
|
||||
LC_ALL=C ip addr show | while read inet address rest; do
|
||||
case "${inet}" in
|
||||
inet6)
|
||||
case "${rest}" in
|
||||
*" "tentative*) return 2;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
done
|
||||
[ $? = 2 ]
|
||||
[ -x /sbin/ip ] || [ -x /bin/ip ] || return 1
|
||||
[ -n "$(ip -f inet6 addr show tentative)" ]
|
||||
;;
|
||||
*)
|
||||
local inet= address= rest=
|
||||
LC_ALL=C ifconfig -a | while read inet address rest; do
|
||||
@@ -169,7 +161,7 @@ runip()
|
||||
routeflush()
|
||||
{
|
||||
if [ "$RC_UNAME" = Linux ]; then
|
||||
if [ -x /sbin/ip ]; then
|
||||
if [ -x /sbin/ip ] || [ -x /bin/ip ]; then
|
||||
ip route flush scope global
|
||||
ip route delete default 2>/dev/null
|
||||
else
|
||||
@@ -231,8 +223,6 @@ start()
|
||||
routeflush
|
||||
if [ "$RC_UNAME" = "Linux" ]; then
|
||||
ifconfig lo 127.0.0.1 netmask 255.0.0.0 || cr=1
|
||||
route add -net 127.0.0.0 netmask 255.0.0.0 \
|
||||
gw 127.0.0.1 2>/dev/null
|
||||
route add -net 127.0.0.0 netmask 255.0.0.0 \
|
||||
gw 127.0.0.1 reject 2>/dev/null
|
||||
else
|
||||
@@ -289,9 +279,14 @@ start()
|
||||
r=5
|
||||
while [ $r -gt 0 ]; do
|
||||
tentative || break
|
||||
[ $r = 5 ] && vebegin "Waiting for tentative addresses"
|
||||
sleep 1
|
||||
r=$(($r - 1))
|
||||
done
|
||||
if [ $r != 5 ]; then
|
||||
[ $r != 0 ]
|
||||
veend $?
|
||||
fi
|
||||
|
||||
if [ -n "$defaultroute" ]; then
|
||||
ebegin "Setting default route $defaultroute"
|
||||
@@ -343,7 +338,7 @@ stop()
|
||||
then
|
||||
veinfo "$int"
|
||||
runargs /etc/ifdown."$int" "$downcmd"
|
||||
if [ -x /sbin/ip ]; then
|
||||
if [ -x /sbin/ip ] || [ -x /bin/ip ]; then
|
||||
# We need to do this, otherwise we may
|
||||
# fail to add things correctly on restart
|
||||
ip address flush dev "$int" 2>/dev/null
|
||||
|
||||
@@ -15,7 +15,14 @@ _is_bond()
|
||||
|
||||
bonding_pre_start()
|
||||
{
|
||||
local x= s= slaves="$(_get_array "slaves_${IFVAR}")"
|
||||
local x= s= n= slaves= primary=
|
||||
|
||||
slaves="$(_get_array "slaves_${IFVAR}")"
|
||||
unset slaves_${IFVAR}
|
||||
|
||||
eval primary="\$primary_${IFVAR}"
|
||||
unset primary_${IFVAR}
|
||||
|
||||
|
||||
[ -z "${slaves}" ] && return 0
|
||||
|
||||
@@ -43,9 +50,12 @@ bonding_pre_start()
|
||||
# Nice and dynamic :)
|
||||
for x in /sys/class/net/"${IFACE}"/bonding/*; do
|
||||
[ -f "${x}" ] || continue
|
||||
eval s=\$${x##*/}_${IFVAR}
|
||||
n=${x##*/}
|
||||
eval s=\$${n}_${IFVAR}
|
||||
if [ -n "${s}" ]; then
|
||||
echo "${s}" >"${x}"
|
||||
einfo "Setting ${n}: ${s}"
|
||||
echo "${s}" >"${x}" || \
|
||||
eerror "Failed to configure $n (${n}_${IFVAR})"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -72,6 +82,11 @@ bonding_pre_start()
|
||||
# finally add in slaves
|
||||
eoutdent
|
||||
if [ -d /sys/class/net ]; then
|
||||
if [ -n "${primary}" ]; then
|
||||
echo "+${primary}" >/sys/class/net/"${IFACE}"/bonding/slaves
|
||||
echo "${primary}" >/sys/class/net/"${IFACE}"/bonding/primary
|
||||
slaves="${slaves/${primary}/}"
|
||||
fi
|
||||
for s in ${slaves}; do
|
||||
echo "+${s}" >/sys/class/net/"${IFACE}"/bonding/slaves
|
||||
done
|
||||
@@ -117,6 +132,12 @@ bonding_stop()
|
||||
done
|
||||
)
|
||||
|
||||
_down
|
||||
|
||||
if [ -d /sys/class/net ]; then
|
||||
echo "-${IFACE}" > /sys/class/net/bonding_masters
|
||||
fi
|
||||
|
||||
eend 0
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ dhclient_start()
|
||||
|
||||
# Get our options
|
||||
# These options only work in Gentoo, and maybe RedHat
|
||||
eval args=\$dhclient_${IFVAR}
|
||||
eval opts=\$dhcp_${IFVAR}
|
||||
[ -z "${opts}" ] && opts=${dhcp}
|
||||
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
|
||||
# All rights reserved. Released under the 2-clause BSD license.
|
||||
|
||||
_ip()
|
||||
{
|
||||
if [ -x /bin/ip ]; then
|
||||
echo /bin/ip
|
||||
else
|
||||
echo /sbin/ip
|
||||
fi
|
||||
}
|
||||
|
||||
iproute2_depend()
|
||||
{
|
||||
program /sbin/ip
|
||||
program $(_ip)
|
||||
provide interface
|
||||
after ifconfig
|
||||
}
|
||||
@@ -160,7 +169,8 @@ _add_route()
|
||||
|
||||
# We cannot use a metric if we're using a nexthop
|
||||
if ! ${have_metric} && \
|
||||
[ -n "${metric}" -a -z "${cmd##* nexthop }" ]
|
||||
[ -n "${metric}" -a \
|
||||
"${cmd##* nexthop }" = "$cmd" ]
|
||||
then
|
||||
cmd="${cmd} metric ${metric}"
|
||||
fi
|
||||
|
||||
@@ -20,7 +20,7 @@ _is_vlan()
|
||||
_get_vlans()
|
||||
{
|
||||
[ -e /proc/net/vlan/config ] || return 1
|
||||
sed -n -e 's/^\(.*[0-9]\) \(.* \) .*'"${IFACE}"'$/\1/p' /proc/net/vlan/config
|
||||
sed -n -e 's/^\W*\([^ ]*\) \(.* \) .*'"${IFACE}"'$/\1/p' /proc/net/vlan/config
|
||||
}
|
||||
|
||||
_check_vlan()
|
||||
|
||||
@@ -2,7 +2,8 @@ DIR= ${LIBDIR}/pkgconfig
|
||||
SRCS= einfo.pc.in openrc.pc.in
|
||||
INC= einfo.pc openrc.pc
|
||||
|
||||
sed -n -e 's/^VERSION=[[:space:]]*\([^[:space:]]*\).*/#define VERSION "\1${GITVER}\"/p' ../../Makefile > version.h
|
||||
.DEFAULT:
|
||||
${SED} -n -e 's/^VERSION=[[:space:]]*\([^[:space:]]*\).*/#define VERSION "\1${GITVER}\"/p' ../../Makefile > version.h
|
||||
|
||||
SED_EXTRA= -e 's:@VERSION@:${VERSION}:g'
|
||||
|
||||
|
||||
@@ -6,26 +6,30 @@
|
||||
if [ -f /proc/acpi/ac_adapter/AC*/state ]; then
|
||||
cat /proc/acpi/ac_adapter/AC*/state | while read line; do
|
||||
case "$line" in
|
||||
"state:"*"off-line") return 128;;
|
||||
"state:"*"off-line") exit 128;;
|
||||
esac
|
||||
done
|
||||
elif [ -f /sys/class/power_supply/AC*/online ]; then
|
||||
cat /sys/class/power_supply/AC*/online | while read line; do
|
||||
[ "${line}" = 0 ] && exit 128
|
||||
done
|
||||
elif [ -f /proc/pmu/info ]; then
|
||||
cat /proc/pmu/info | while read line; do
|
||||
case "$line" in
|
||||
"AC Power"*": 0") return 128;;
|
||||
"AC Power"*": 0") exit 128;;
|
||||
esac
|
||||
done
|
||||
elif type envstat >/dev/null 2>&1; then
|
||||
# NetBSD has envstat
|
||||
envstat -d acpiacad0 2>/dev/null | while read line; do
|
||||
case "$line" in
|
||||
"connected:"*"OFF") return 128;;
|
||||
"connected:"*"OFF") exit 128;;
|
||||
esac
|
||||
done
|
||||
elif sysctl -q hw.acpi.acline >/dev/null 2>/dev/null; then
|
||||
case $(sysctl -n hw.acpi.acline) in
|
||||
0) return 1;;
|
||||
*) return 0;;
|
||||
0) exit 1;;
|
||||
*) exit 0;;
|
||||
esac
|
||||
else
|
||||
exit 255
|
||||
|
||||
@@ -643,7 +643,7 @@ static int EINFO_PRINTF(3, 0)
|
||||
fprintf(f, "\n");
|
||||
if (_eprefix)
|
||||
fprintf(f, "%s%s%s|", _ecolor(f, color), _eprefix, _ecolor(f, ECOLOR_NORMAL));
|
||||
fprintf(f, "%s*%s ", _ecolor(f, color), _ecolor(f, ECOLOR_NORMAL));
|
||||
fprintf(f, " %s*%s ", _ecolor(f, color), _ecolor(f, ECOLOR_NORMAL));
|
||||
retval += _eindent(f);
|
||||
va_copy(ap, va);
|
||||
retval += vfprintf(f, fmt, ap) + 3;
|
||||
@@ -800,7 +800,7 @@ ebegin(const char *EINFO_RESTRICT fmt, ...)
|
||||
va_start(ap, fmt);
|
||||
retval = _einfovn(fmt, ap);
|
||||
va_end(ap);
|
||||
retval += printf("...");
|
||||
retval += printf(" ...");
|
||||
if (colour_terminal(stdout))
|
||||
retval += printf("\n");
|
||||
LASTCMD("ebegin");
|
||||
@@ -817,7 +817,7 @@ _eend(FILE * EINFO_RESTRICT fp, int col, ECOLOR color, const char *msg)
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
cols = get_term_columns(fp) - (strlen(msg) + 3);
|
||||
cols = get_term_columns(fp) - (strlen(msg) + 5);
|
||||
|
||||
/* cons25 is special - we need to remove one char, otherwise things
|
||||
* do not align properly at all. */
|
||||
@@ -831,18 +831,15 @@ _eend(FILE * EINFO_RESTRICT fp, int col, ECOLOR color, const char *msg)
|
||||
if (term_is_cons25)
|
||||
cols--;
|
||||
|
||||
/* If extra spacing is required around msg, then please change
|
||||
* via a runtime knob and leave this default as is as it saves 2
|
||||
* valuable columns when running on 80 column screens. */
|
||||
if (cols > 0 && colour_terminal(fp)) {
|
||||
fprintf(fp, "%s%s %s[%s%s%s]%s\n", up, tgoto(goto_column, 0, cols),
|
||||
fprintf(fp, "%s%s %s[%s %s %s]%s\n", up, tgoto(goto_column, 0, cols),
|
||||
ecolor(ECOLOR_BRACKET), ecolor(color), msg,
|
||||
ecolor(ECOLOR_BRACKET), ecolor(ECOLOR_NORMAL));
|
||||
} else {
|
||||
if (col > 0)
|
||||
for (i = 0; i < cols - col; i++)
|
||||
fprintf(fp, " ");
|
||||
fprintf(fp, " [%s]\n", msg);
|
||||
fprintf(fp, " [ %s ]\n", msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1030,7 +1027,7 @@ ebeginv(const char *EINFO_RESTRICT fmt, ...)
|
||||
|
||||
va_start(ap, fmt);
|
||||
retval = _einfovn(fmt, ap);
|
||||
retval += printf("...");
|
||||
retval += printf(" ...");
|
||||
if (colour_terminal(stdout))
|
||||
retval += printf("\n");
|
||||
va_end(ap);
|
||||
|
||||
@@ -773,7 +773,7 @@ handle_bad_signal(int sig)
|
||||
#endif
|
||||
|
||||
#include "_usage.h"
|
||||
#define getoptstring "o:" getoptstring_COMMON
|
||||
#define getoptstring "o:s:S" getoptstring_COMMON
|
||||
static const struct option longopts[] = {
|
||||
{ "override", 1, NULL, 'o' },
|
||||
{ "service", 1, NULL, 's' },
|
||||
|
||||
@@ -1318,6 +1318,12 @@ runscript(int argc, char **argv)
|
||||
prefix = NULL;
|
||||
retval = svc_exec("status", NULL);
|
||||
} else {
|
||||
if (strcmp(optarg, "pause") == 0) {
|
||||
ewarn("WARNING: 'pause' is deprecated; please use '--nodeps stop'");
|
||||
deps = false;
|
||||
optarg = "stop";
|
||||
}
|
||||
|
||||
if (strcmp(optarg, "conditionalrestart") == 0 ||
|
||||
strcmp(optarg, "condrestart") == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user