Compare commits

..

34 Commits

Author SHA1 Message Date
William Hubbs
9285cb3392 release openrc-0.6.4 2010-11-15 10:17:17 -06:00
William Hubbs
6d9137d6c4 remove support for local.start and local.stop for bug #343709
The openrc ebuild now migrates these files to /etc/conf.d/local, so we
do not need to support them.
2010-11-10 10:55:28 -06:00
William Hubbs
2fa6bb0d48 add warnings about local.start and local.stop for bug #343709
We need to warn users that they should be using /etc/conf.d/local
instead of /etc/conf.d/local.start and /etc/conf.d/local.stop. This adds
those warnings.
2010-11-05 13:42:33 -05:00
William Hubbs
39776d6fb7 update documentation for rc_interactive
rc_interactive is automatically disabled if rc_parallel is set to YES.
Update the documentation in rc.conf to reflect this.
This fixes bug #327305.
2010-11-01 13:57:22 -05:00
Jory A. Pratt
68c021c424 ensure bonding interface is down before we attempt to configure, also
mode has to be configure before any other arguements are passed. Thanks
Ed Wildgoose <gentoo@wildgooses.com> for patch.
2010-10-31 16:40:54 -05:00
Diego Elio Pettenò
09bed967bf Allow cleaning up of pam_mktemp-based temporary directories.
This was blacklisted before, so the .private directories never had their
content cleaned up, even if WIPE_TMP was set to yes.
2010-10-31 16:18:38 -05:00
Jory A. Pratt
060b19e3e3 correction for unmounting volumes with weird characters, thanks Brant
Gurganus <brant@gurganus.name>
2010-10-28 20:35:09 -05:00
William Hubbs
d8a76d1bf6 allow net_fs_list to be extended but not replaced
This fixes bug #342825.
2010-10-27 09:00:02 -05:00
Jory A. Pratt
7653ef89b8 remove 'use hostname' bug 340991, Thanks Diego 2010-10-23 23:52:43 -05:00
Jory A. Pratt
be6c0716ee surpress output of loadkeys, fix setfont path check 2010-09-30 07:33:52 -05:00
William Hubbs
4ea75dd1d6 allow ifplugd to work on wireless interfaces
this fixes bug #335494.
2010-09-14 19:37:52 -05:00
William Hubbs
b708852784 release openrc-0.6.3 2010-09-02 10:15:17 -05:00
William Hubbs
f700243016 Revert "fix bug 266395"
This reverts commit 1a188f8f72.

This revert fixes bug #334663.
2010-09-02 09:42:11 -05:00
Jory A. Pratt
b232e529f1 Fix for make-3.82 breakage. 2010-08-22 15:05:11 -05:00
William Hubbs
ae3186834f release openrc-0.6.2 2010-08-19 17:00:38 -05:00
William Hubbs
23546e27d9 fix detection of renamed vlan interfaces
This fixes bug 327059, thanks to Jonathan for reporting this and for the patch.
2010-08-19 16:17:38 -05:00
William Hubbs
1a188f8f72 fix bug 266395
Do not stop wpa_supplicant or wpa_cli if they are in the background.
Thanks to Slava Gorbunov for the patch.
2010-08-18 15:01:23 -05:00
Anthony G. Basile
89829f6d7c Fixes bug #332383. Thanks Lutz Heermann. 2010-08-13 17:42:23 -04:00
Anthony G. Basile
6e3b3bfc53 Fix bug #332181. Thanks Lutz Heermann. 2010-08-13 17:32:31 -04:00
Jory A. Pratt
14c95ae9a6 update consolefont/keymap to include -lxc in keywords 2010-08-10 08:21:08 -05:00
William Hubbs
d3ccbdb5a9 allow ip to be in /sbin or /bin
This makes it possible for the "ip" program in iproute2 to be installed
in /sbin or /bin.
2010-08-09 20:01:15 -05:00
William Hubbs
1cdf85e1ce fix bug #330173
This fixes a typo in the comments in net.example.
2010-07-28 13:18:33 -05:00
Jory A. Pratt
2982cfab70 Fix bug #301237, update example to list proper package for mii-tool 2010-07-12 22:45:40 -05:00
Jory A. Pratt
761fe99fe2 on_ac_power needs to exit not return bug #322037 2010-07-12 22:19:56 -05:00
William Hubbs
6f24d1cbd8 fix typo
I made a typo while manually transferring over Roy's last commit.  This
fixes that typo.
2010-07-10 15:31:16 -05:00
William Hubbs
898552dcc3 fix metric
This change was also taken from Roy Marples' git.
2010-07-07 19:55:37 -05:00
William Hubbs
6850566be0 remove extra route
This was taken from Roy Marples' git repository.
2010-07-07 19:42:56 -05:00
Mike Frysinger
3036b44798 restore init.d pause option 2010-04-09 02:19:40 -04:00
Mike Frysinger
acc0edb040 restore old e* func output
Gentoo has always used the sytle:
 * moo ...                [ ok ]
Latest openrc now does:
* moo...                    [ok]

Realistically, 4 spaces out of 80 on reduced terminals doesn't make any
sort of realistic difference and it's been just fine for the last 10
years, so keep the default behavior.
2010-04-09 02:19:40 -04:00
Seth Robertson
316a316d9b Allow dhclient per $IFACE arguments. 2010-03-30 09:21:54 +01:00
Michal Gorny
20b4076b12 Support sysfs.
Fixes #214
2010-03-27 08:53:04 +00:00
Roy Marples
4d86d34635 Fix -s and -S. 2010-03-26 22:10:03 +00:00
Roy Marples
ae7a92ae7b Try and describe bonding errors a bit more. 2010-03-24 20:41:18 +00:00
Roy Marples
67b538fd26 Fix tentative ip addresses 2010-03-24 20:25:42 +00:00
22 changed files with 119 additions and 67 deletions

View File

@@ -1,3 +1,3 @@
NAME= openrc NAME= openrc
VERSION= 0.6.1 VERSION= 0.6.4
PKG= ${NAME}-${VERSION} PKG= ${NAME}-${VERSION}

View File

@@ -896,7 +896,7 @@
# and you're done :) # and you're done :)
# By default we don't wait for netplug/ifplugd to configure the interface. # 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. # then you can specify a timeout here.
#plug_timeout="10" #plug_timeout="10"
# A value of 0 means wait forever. # A value of 0 means wait forever.
@@ -936,8 +936,8 @@
#preup() { #preup() {
# # Test for link on the interface prior to bringing it up. This # # Test for link on the interface prior to bringing it up. This
# # only works on some network adapters and requires the mii-diag # # only works on some network adapters and requires the
# # package to be installed. # # sys-apps/net-tools package to be installed.
# if mii-tool "${IFACE}" 2> /dev/null | grep -q 'no link'; then # if mii-tool "${IFACE}" 2> /dev/null | grep -q 'no link'; then
# ewarn "No link on ${IFACE}, aborting configuration" # ewarn "No link on ${IFACE}, aborting configuration"
# return 1 # return 1

View File

@@ -11,7 +11,8 @@
# Set rc_interactive to "YES" and you'll be able to press the I key during # Set rc_interactive to "YES" and you'll be able to press the I key during
# boot so you can choose to start specific services. Set to "NO" to disable # boot so you can choose to start specific services. Set to "NO" to disable
# this feature. # this feature. This feature is automatically disabled if rc_parallel is
# set to YES.
#rc_interactive="YES" #rc_interactive="YES"
# If we need to drop to a shell, you can specify it here. # If we need to drop to a shell, you can specify it here.
@@ -75,8 +76,14 @@
# Set unicode to YES to turn on unicode support for keyboards and screens. # Set unicode to YES to turn on unicode support for keyboards and screens.
#unicode="NO" #unicode="NO"
# Network fstypes. Below is the default. # Below is the default list of network fstypes.
net_fs_list="afs cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre ncpfs nfs nfs4 ocfs2 shfs smbfs" #
# afs cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre ncpfs
# nfs nfs4 ocfs2 shfs smbfs
#
# If you would like to add to this list, you can do so by adding your
# own fstypes to the following variable.
#extra_net_fs_list=""
############################################################################## ##############################################################################
# SERVICE CONFIGURATION VARIABLES # SERVICE CONFIGURATION VARIABLES

View File

@@ -4,7 +4,6 @@
depend() depend()
{ {
use hostname
need localmount need localmount
before logger before logger
after clock sysctl after clock sysctl
@@ -36,6 +35,12 @@ cleanup_tmp_dir()
# Faster than find # Faster than find
rm -rf -- [^ajlq\.]* rm -rf -- [^ajlq\.]*
# pam_mktemp creates a .private directory within which
# each user gets a private directory with immutable
# bit set; remove the immutable bit before trying to
# remove it.
[ -d /tmp/.private ] && chattr -R -a /tmp/.private
find $startopts ! -name . \ find $startopts ! -name . \
! -path "./lost+found" \ ! -path "./lost+found" \
! -path "./lost+found/*" \ ! -path "./lost+found/*" \
@@ -49,8 +54,6 @@ cleanup_tmp_dir()
! -path "./aquota.group/*" \ ! -path "./aquota.group/*" \
! -path "./journal" \ ! -path "./journal" \
! -path "./journal/*" \ ! -path "./journal/*" \
! -path "./.private" \
! -path "./.private/*" \
-exec rm -rf {} \; -exec rm -rf {} \;
eend 0 eend 0
else else

View File

@@ -8,7 +8,7 @@ depend()
{ {
need localmount termencoding need localmount termencoding
after hotplug bootmisc after hotplug bootmisc
keyword -openvz -prefix -uml -vserver -xenu keyword -openvz -prefix -uml -vserver -xenu -lxc
} }
start() start()

View File

@@ -8,7 +8,7 @@ depend()
{ {
need localmount termencoding need localmount termencoding
after bootmisc after bootmisc
keyword -openvz -prefix -uml -vserver -xenu keyword -openvz -prefix -uml -vserver -xenu -lxc
} }
start() start()

View File

@@ -18,11 +18,6 @@ start()
local_start local_start
fi fi
# Support old configs
if [ -e @SYSCONFDIR@/conf.d/local.start ]; then
. @SYSCONFDIR@/conf.d/local.start
fi
eend $? "Failed to start local" eend $? "Failed to start local"
} }
@@ -34,10 +29,5 @@ stop()
local_stop local_stop
fi fi
# Support old configs
if [ -e @SYSCONFDIR@/conf.d/local.stop ]; then
. @SYSCONFDIR@/conf.d/local.stop
fi
eend $? "Failed to stop local" eend $? "Failed to stop local"
} }

View File

@@ -63,17 +63,9 @@ tentative()
case "$RC_UNAME" in case "$RC_UNAME" in
Linux) Linux)
[ -x /sbin/ip ] || return 1 [ -x /sbin/ip ] || [ -x /bin/ip ] || return 1
LC_ALL=C ip addr show | while read inet address rest; do [ -n "$(ip -f inet6 addr show tentative)" ]
case "${inet}" in ;;
inet6)
case "${rest}" in
*" "tentative*) return 2;;
esac
;;
esac
done
[ $? = 2 ]
*) *)
local inet= address= rest= local inet= address= rest=
LC_ALL=C ifconfig -a | while read inet address rest; do LC_ALL=C ifconfig -a | while read inet address rest; do
@@ -169,7 +161,7 @@ runip()
routeflush() routeflush()
{ {
if [ "$RC_UNAME" = Linux ]; then 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 flush scope global
ip route delete default 2>/dev/null ip route delete default 2>/dev/null
else else
@@ -231,8 +223,6 @@ start()
routeflush routeflush
if [ "$RC_UNAME" = "Linux" ]; then if [ "$RC_UNAME" = "Linux" ]; then
ifconfig lo 127.0.0.1 netmask 255.0.0.0 || cr=1 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 \ route add -net 127.0.0.0 netmask 255.0.0.0 \
gw 127.0.0.1 reject 2>/dev/null gw 127.0.0.1 reject 2>/dev/null
else else
@@ -289,9 +279,14 @@ start()
r=5 r=5
while [ $r -gt 0 ]; do while [ $r -gt 0 ]; do
tentative || break tentative || break
[ $r = 5 ] && vebegin "Waiting for tentative addresses"
sleep 1 sleep 1
r=$(($r - 1)) r=$(($r - 1))
done done
if [ $r != 5 ]; then
[ $r != 0 ]
veend $?
fi
if [ -n "$defaultroute" ]; then if [ -n "$defaultroute" ]; then
ebegin "Setting default route $defaultroute" ebegin "Setting default route $defaultroute"
@@ -343,7 +338,7 @@ stop()
then then
veinfo "$int" veinfo "$int"
runargs /etc/ifdown."$int" "$downcmd" 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 # We need to do this, otherwise we may
# fail to add things correctly on restart # fail to add things correctly on restart
ip address flush dev "$int" 2>/dev/null ip address flush dev "$int" 2>/dev/null

View File

@@ -4,7 +4,6 @@
depend() depend()
{ {
use hostname
before bootmisc logger before bootmisc logger
keyword -openvz -prefix -vserver keyword -openvz -prefix -vserver
} }

View File

@@ -15,7 +15,14 @@ _is_bond()
bonding_pre_start() 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 [ -z "${slaves}" ] && return 0
@@ -39,13 +46,31 @@ bonding_pre_start()
return 1 return 1
fi fi
# Configure the bond. # Interface must be down in order to configure
# Nice and dynamic :) _down
# Configure the bond mode, then we can reloop to ensure we configure
# All other options
for x in /sys/class/net/"${IFACE}"/bonding/mode; do
[ -f "${x}" ] || continue
n=${x##*/}
eval s=\$${n}_${IFVAR}
if [ -n "${s}" ]; then
einfo "Setting ${n}: ${s}"
echo "${s}" >"${x}" || \
eerror "Failed to configure $n (${n}_${IFVAR})"
fi
done
# Nice and dynamic for remaining options:)
for x in /sys/class/net/"${IFACE}"/bonding/*; do for x in /sys/class/net/"${IFACE}"/bonding/*; do
[ -f "${x}" ] || continue [ -f "${x}" ] || continue
eval s=\$${x##*/}_${IFVAR} n=${x##*/}
eval s=\$${n}_${IFVAR}
[ "${n}" != "mode" ] || continue
if [ -n "${s}" ]; then if [ -n "${s}" ]; then
echo "${s}" >"${x}" einfo "Setting ${n}: ${s}"
echo "${s}" >"${x}" || \
eerror "Failed to configure $n (${n}_${IFVAR})"
fi fi
done done
@@ -72,6 +97,11 @@ bonding_pre_start()
# finally add in slaves # finally add in slaves
eoutdent eoutdent
if [ -d /sys/class/net ]; then 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 for s in ${slaves}; do
echo "+${s}" >/sys/class/net/"${IFACE}"/bonding/slaves echo "+${s}" >/sys/class/net/"${IFACE}"/bonding/slaves
done done
@@ -117,6 +147,12 @@ bonding_stop()
done done
) )
_down
if [ -d /sys/class/net ]; then
echo "-${IFACE}" > /sys/class/net/bonding_masters
fi
eend 0 eend 0
return 0 return 0
} }

View File

@@ -17,6 +17,7 @@ dhclient_start()
# Get our options # Get our options
# These options only work in Gentoo, and maybe RedHat # These options only work in Gentoo, and maybe RedHat
eval args=\$dhclient_${IFVAR}
eval opts=\$dhcp_${IFVAR} eval opts=\$dhcp_${IFVAR}
[ -z "${opts}" ] && opts=${dhcp} [ -z "${opts}" ] && opts=${dhcp}

View File

@@ -27,8 +27,8 @@ ifplugd_pre_start()
return 0 return 0
fi fi
# We don't work on bonded, bridges, tun/tap, vlan or wireless # We don't work on bonded, bridges, tun/tap or vlan
for f in bond bridge tuntap vlan wireless; do for f in bond bridge tuntap vlan; do
if type "_is_${f}" >/dev/null 2>&1; then if type "_is_${f}" >/dev/null 2>&1; then
if _is_${f}; then if _is_${f}; then
veinfo "ifplugd does not work with ${f}" veinfo "ifplugd does not work with ${f}"

View File

@@ -1,9 +1,18 @@
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name> # Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license. # 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() iproute2_depend()
{ {
program /sbin/ip program $(_ip)
provide interface provide interface
after ifconfig after ifconfig
} }
@@ -160,7 +169,8 @@ _add_route()
# We cannot use a metric if we're using a nexthop # We cannot use a metric if we're using a nexthop
if ! ${have_metric} && \ if ! ${have_metric} && \
[ -n "${metric}" -a -z "${cmd##* nexthop }" ] [ -n "${metric}" -a \
"${cmd##* nexthop }" = "$cmd" ]
then then
cmd="${cmd} metric ${metric}" cmd="${cmd} metric ${metric}"
fi fi

View File

@@ -20,7 +20,7 @@ _is_vlan()
_get_vlans() _get_vlans()
{ {
[ -e /proc/net/vlan/config ] || return 1 [ -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() _check_vlan()

View File

@@ -2,7 +2,8 @@ DIR= ${LIBDIR}/pkgconfig
SRCS= einfo.pc.in openrc.pc.in SRCS= einfo.pc.in openrc.pc.in
INC= einfo.pc openrc.pc 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' SED_EXTRA= -e 's:@VERSION@:${VERSION}:g'

View File

@@ -6,26 +6,30 @@
if [ -f /proc/acpi/ac_adapter/AC*/state ]; then if [ -f /proc/acpi/ac_adapter/AC*/state ]; then
cat /proc/acpi/ac_adapter/AC*/state | while read line; do cat /proc/acpi/ac_adapter/AC*/state | while read line; do
case "$line" in case "$line" in
"state:"*"off-line") return 128;; "state:"*"off-line") exit 128;;
esac esac
done 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 elif [ -f /proc/pmu/info ]; then
cat /proc/pmu/info | while read line; do cat /proc/pmu/info | while read line; do
case "$line" in case "$line" in
"AC Power"*": 0") return 128;; "AC Power"*": 0") exit 128;;
esac esac
done done
elif type envstat >/dev/null 2>&1; then elif type envstat >/dev/null 2>&1; then
# NetBSD has envstat # NetBSD has envstat
envstat -d acpiacad0 2>/dev/null | while read line; do envstat -d acpiacad0 2>/dev/null | while read line; do
case "$line" in case "$line" in
"connected:"*"OFF") return 128;; "connected:"*"OFF") exit 128;;
esac esac
done done
elif sysctl -q hw.acpi.acline >/dev/null 2>/dev/null; then elif sysctl -q hw.acpi.acline >/dev/null 2>/dev/null; then
case $(sysctl -n hw.acpi.acline) in case $(sysctl -n hw.acpi.acline) in
0) return 1;; 0) exit 1;;
*) return 0;; *) exit 0;;
esac esac
else else
exit 255 exit 255

View File

@@ -17,7 +17,7 @@ fi
if [ -e /etc/runlevels/"$RC_DEFAULTLEVEL"/consolefont \ if [ -e /etc/runlevels/"$RC_DEFAULTLEVEL"/consolefont \
-o -e /etc/runlevels/"$RC_BOOTLEVEL"/consolefont ]; then -o -e /etc/runlevels/"$RC_BOOTLEVEL"/consolefont ]; then
printf "\033%s" "$termencoding" >"$CONSOLE" 2>/dev/null printf "\033%s" "$termencoding" >"$CONSOLE" 2>/dev/null
if [ -r "$RC_LIBEXECDIR"/console/font -a -x /bin/setfont ]; then if [ -r "$RC_LIBEXECDIR"/console/font -a -x /usr/bin/setfont ]; then
font="$(cat "$RC_LIBEXECDIR"/console/font)" font="$(cat "$RC_LIBEXECDIR"/console/font)"
[ -c "$CONSOLE" ] && cons="-C $CONSOLE" [ -c "$CONSOLE" ] && cons="-C $CONSOLE"
setfont $cons "$RC_LIBEXECDIR"/console/"$font" 2>/dev/null setfont $cons "$RC_LIBEXECDIR"/console/"$font" 2>/dev/null
@@ -29,7 +29,7 @@ if [ -e /etc/runlevels/"$RC_DEFAULTLEVEL"/keymaps \
-o -e /etc/runlevels/"$RC_BOOTLEVEL"/keymaps ]; then -o -e /etc/runlevels/"$RC_BOOTLEVEL"/keymaps ]; then
kbd_mode $kmode -C "$CONSOLE" 2>/dev/null kbd_mode $kmode -C "$CONSOLE" 2>/dev/null
if [ -r "$RC_LIBEXECDIR"/console/keymap ]; then if [ -r "$RC_LIBEXECDIR"/console/keymap ]; then
loadkeys "$RC_LIBEXECDIR"/console/keymap 2>/dev/null loadkeys -q "$RC_LIBEXECDIR"/console/keymap 2>/dev/null
fi fi
fi fi

View File

@@ -38,7 +38,8 @@ stop_addon()
( import_addon "$1-stop" ) ( import_addon "$1-stop" )
} }
net_fs_list="afs cifs coda davfs fuse gfs ncpfs nfs nfs4 ocfs2 shfs smbfs" net_fs_list="afs cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre
ncpfs nfs nfs4 ocfs2 shfs smbfs $extra_net_fs_list"
is_net_fs() is_net_fs()
{ {
[ -z "$1" ] && return 1 [ -z "$1" ] && return 1

View File

@@ -26,6 +26,8 @@ do_unmount()
# Unmounting a shared mount can unmount other mounts, so # Unmounting a shared mount can unmount other mounts, so
# we need to check the mount is still valid # we need to check the mount is still valid
mountinfo --quiet "$mnt" || continue mountinfo --quiet "$mnt" || continue
# Ensure we interpret all characters properly.
mnt=$(printf "$mnt")
case "$cmd" in case "$cmd" in
umount) umount)

View File

@@ -643,7 +643,7 @@ static int EINFO_PRINTF(3, 0)
fprintf(f, "\n"); fprintf(f, "\n");
if (_eprefix) if (_eprefix)
fprintf(f, "%s%s%s|", _ecolor(f, color), _eprefix, _ecolor(f, ECOLOR_NORMAL)); 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); retval += _eindent(f);
va_copy(ap, va); va_copy(ap, va);
retval += vfprintf(f, fmt, ap) + 3; retval += vfprintf(f, fmt, ap) + 3;
@@ -800,7 +800,7 @@ ebegin(const char *EINFO_RESTRICT fmt, ...)
va_start(ap, fmt); va_start(ap, fmt);
retval = _einfovn(fmt, ap); retval = _einfovn(fmt, ap);
va_end(ap); va_end(ap);
retval += printf("..."); retval += printf(" ...");
if (colour_terminal(stdout)) if (colour_terminal(stdout))
retval += printf("\n"); retval += printf("\n");
LASTCMD("ebegin"); LASTCMD("ebegin");
@@ -817,7 +817,7 @@ _eend(FILE * EINFO_RESTRICT fp, int col, ECOLOR color, const char *msg)
if (!msg) if (!msg)
return; 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 /* cons25 is special - we need to remove one char, otherwise things
* do not align properly at all. */ * 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) if (term_is_cons25)
cols--; 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)) { 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(color), msg,
ecolor(ECOLOR_BRACKET), ecolor(ECOLOR_NORMAL)); ecolor(ECOLOR_BRACKET), ecolor(ECOLOR_NORMAL));
} else { } else {
if (col > 0) if (col > 0)
for (i = 0; i < cols - col; i++) for (i = 0; i < cols - col; i++)
fprintf(fp, " "); 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); va_start(ap, fmt);
retval = _einfovn(fmt, ap); retval = _einfovn(fmt, ap);
retval += printf("..."); retval += printf(" ...");
if (colour_terminal(stdout)) if (colour_terminal(stdout))
retval += printf("\n"); retval += printf("\n");
va_end(ap); va_end(ap);

View File

@@ -773,7 +773,7 @@ handle_bad_signal(int sig)
#endif #endif
#include "_usage.h" #include "_usage.h"
#define getoptstring "o:" getoptstring_COMMON #define getoptstring "o:s:S" getoptstring_COMMON
static const struct option longopts[] = { static const struct option longopts[] = {
{ "override", 1, NULL, 'o' }, { "override", 1, NULL, 'o' },
{ "service", 1, NULL, 's' }, { "service", 1, NULL, 's' },

View File

@@ -1318,6 +1318,12 @@ runscript(int argc, char **argv)
prefix = NULL; prefix = NULL;
retval = svc_exec("status", NULL); retval = svc_exec("status", NULL);
} else { } else {
if (strcmp(optarg, "pause") == 0) {
ewarn("WARNING: 'pause' is deprecated; please use '--nodeps stop'");
deps = false;
optarg = "stop";
}
if (strcmp(optarg, "conditionalrestart") == 0 || if (strcmp(optarg, "conditionalrestart") == 0 ||
strcmp(optarg, "condrestart") == 0) strcmp(optarg, "condrestart") == 0)
{ {