Compare commits
32 Commits
openrc-0.6
...
funtoo-ope
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33803219d4 | ||
|
|
18c08a9d4d | ||
|
|
2406dc4f3e | ||
|
|
8e6d461a7f | ||
|
|
472a3bb99c | ||
|
|
c9a2085699 | ||
|
|
69169b7e95 | ||
|
|
3a11f8af34 | ||
|
|
e2e5b27d85 | ||
|
|
f343360741 | ||
|
|
694fd2027f | ||
|
|
ca76764743 | ||
|
|
19bd9923d7 | ||
|
|
2a844e1122 | ||
|
|
5135412978 | ||
|
|
89829f6d7c | ||
|
|
6e3b3bfc53 | ||
|
|
14c95ae9a6 | ||
|
|
d3ccbdb5a9 | ||
|
|
1cdf85e1ce | ||
|
|
2982cfab70 | ||
|
|
761fe99fe2 | ||
|
|
6f24d1cbd8 | ||
|
|
898552dcc3 | ||
|
|
6850566be0 | ||
|
|
3036b44798 | ||
|
|
acc0edb040 | ||
|
|
316a316d9b | ||
|
|
20b4076b12 | ||
|
|
4d86d34635 | ||
|
|
ae7a92ae7b | ||
|
|
67b538fd26 |
@@ -1,3 +1,3 @@
|
|||||||
NAME= openrc
|
NAME= openrc
|
||||||
VERSION= 0.6.1
|
VERSION= 0.6.5
|
||||||
PKG= ${NAME}-${VERSION}
|
PKG= ${NAME}-${VERSION}
|
||||||
|
|||||||
67
README
67
README
@@ -1,8 +1,9 @@
|
|||||||
OpenRC README
|
OpenRC README
|
||||||
|
=============
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|
||||||
make install
|
make install
|
||||||
Yup, that simple. Works with GNU make and BSD make.
|
Yup, that simple. Works with GNU make and BSD make.
|
||||||
|
|
||||||
@@ -51,34 +52,56 @@ init.d.misc is not installed by default as the scripts will need
|
|||||||
tweaking on a per distro basis. They are also non essential to the operation
|
tweaking on a per distro basis. They are also non essential to the operation
|
||||||
of the system.
|
of the system.
|
||||||
|
|
||||||
|
|
||||||
Reporting Bugs
|
Reporting Bugs
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
If you installed OpenRC from your chosen distribution, you should report
|
If you installed OpenRC from your chosen distribution, you should report
|
||||||
bugs directly to them. For example, if you use Gentoo and emerged OpenRC
|
bugs directly to them. For example, if you use Gentoo and emerged OpenRC
|
||||||
then you should reports bugs to http://bugs.gentoo.org.
|
then you should reports bugs to http://bugs.gentoo.org.
|
||||||
|
|
||||||
Otherwise, you can report them directly to me at
|
History - by Daniel Robbins
|
||||||
http://roy.marples.name/projects/openrc
|
---------------------------
|
||||||
|
|
||||||
|
The Gentoo modular network scripts were created by Daniel Robbins for
|
||||||
|
Gentoo Linux 1.0_rc6, in development during most of 2001 and released
|
||||||
|
in September 2001. After their development, the dependency-based initscript
|
||||||
|
system was maintained by a number of senior developers (add names here....
|
||||||
|
need to look at baselayout cvs logs.)
|
||||||
|
|
||||||
History - by Roy Marples
|
excerpt from http://www.gentoo.org/news/en/gwn/20040426-newsletter.xml
|
||||||
------------------------
|
by Grant Goodyear:
|
||||||
I became a Gentoo/Linux developer in 2004 and wrote the modular network
|
|
||||||
scripts for the Gentoo baselayout package. baselayout is a collection of
|
|
||||||
bash scripts to bring up your computer and its services.
|
|
||||||
Then towards the end of 2005 I found myself as the primary maintainer
|
|
||||||
for baselayout.
|
|
||||||
|
|
||||||
At the start of 2007, baselayout-2 is announced to the world, re-writing the
|
"My recollection is that one of woodchip's more impressive early feats was the
|
||||||
core of baselayout in C and allowing POSIX sh init scripts instead of
|
complete replacement of all of the init scripts in Portage for Gentoo Linux
|
||||||
forcing the use of bash. By Mid 2007 I have re-written everything, including
|
1.0_rc6. Through 1.0_rc5 Gentoo had used fairly standard rc scripts modified
|
||||||
init scripts, and alpha and pre baselayout-2 snapshots where put into Gentoo.
|
from Stampede Linux, but for 1.0_rc6 Daniel Robbins (drobbins) and Martin
|
||||||
Towards the end of 2007 I retired as a Gentoo developer for reasons I won't
|
Schlemmer (azarah) had created a new dependency-based init script system that
|
||||||
go into here. baselayout-2 was still in the pre stage, and aside from the
|
is still used today. Within a span of days Donny rewrote every single init
|
||||||
fbsd users, it was masked everywhere. However, I also desired to keep the
|
script in the Portage tree and committed new masked packages to await the
|
||||||
baselayout-2 project alive, but outside of Gentoo and into other projects
|
release of 1.0_rc6. Thanks to woodchip (and drobbins and azarah, of course) the
|
||||||
such as FreeBSD.
|
transition to the new init scripts was nearly painless."
|
||||||
|
|
||||||
|
Roy Marples became a Gentoo/Linux developer in 2004 and maintained the modular
|
||||||
|
network scripts for the Gentoo baselayout package. Then towards the end of
|
||||||
|
2005, he became the the primary maintainer for baselayout.
|
||||||
|
|
||||||
|
At the start of 2007, Roy Marples announced the ongoing development of
|
||||||
|
baselayout-2, containing a rewritten initscript code in C and allowing POSIX sh
|
||||||
|
init scripts instead of forcing the use of bash. By Mid 2007 Roy Marples had
|
||||||
|
re-implemented the Gentoo initscript design created by Daniel Robbins, using an
|
||||||
|
entirely new code base. Alpha and pre-release baselayout-2 snapshots were
|
||||||
|
added to Gentoo's Portage tree as an optional component.
|
||||||
|
|
||||||
|
Towards the end of 2007, Roy Marples retired as a Gentoo developer Baselayout-2
|
||||||
|
was still in the pre stage, and aside from the fbsd users, it was masked
|
||||||
|
everywhere. However, Roy Marples desired to keep the baselayout-2 project
|
||||||
|
alive, but outside of Gentoo and into other projects such as FreeBSD.
|
||||||
|
|
||||||
|
As such, the Gentoo Council permitted Roy Marples to release OpenRC under the 2
|
||||||
|
clause BSD license, managed by him as an external project. Around mid-2010, Roy
|
||||||
|
Marples decided to no longer maintain OpenRC. At this point, he transferred
|
||||||
|
development back to Gentoo, which continues to maintain the scripts. In
|
||||||
|
addition, Daniel Robbins continues to maintain an independent version OpenRC
|
||||||
|
for Funtoo Linux, which includes a Funtoo-specific network configuration
|
||||||
|
system.
|
||||||
|
|
||||||
As such, the Gentoo Council have allowed the creation of OpenRC under the
|
|
||||||
2 clause BSD license, managed by me as an external project.
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ start()
|
|||||||
done
|
done
|
||||||
|
|
||||||
ebegin "Mounting local filesystems"
|
ebegin "Mounting local filesystems"
|
||||||
mount -at "$types"
|
mount -at "$types" -O no_netdev
|
||||||
eend $? "Some local filesystem failed to mount"
|
eend $? "Some local filesystem failed to mount"
|
||||||
|
|
||||||
# Always return 0 - some local mounts may not be critical for boot
|
# Always return 0 - some local mounts may not be critical for boot
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
depend()
|
depend()
|
||||||
{
|
{
|
||||||
use hostname
|
|
||||||
before bootmisc logger
|
before bootmisc logger
|
||||||
keyword -prefix
|
keyword -prefix
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
depend()
|
depend()
|
||||||
{
|
{
|
||||||
use hostname
|
|
||||||
before bootmisc logger
|
before bootmisc logger
|
||||||
keyword -openvz -prefix -vserver
|
keyword -openvz -prefix -vserver
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
@@ -43,9 +50,12 @@ bonding_pre_start()
|
|||||||
# Nice and dynamic :)
|
# Nice and dynamic :)
|
||||||
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}
|
||||||
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 +82,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 +132,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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ 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
|
||||||
|
mnt=$(printf "$mnt")
|
||||||
|
|
||||||
case "$cmd" in
|
case "$cmd" in
|
||||||
umount)
|
umount)
|
||||||
|
|||||||
@@ -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,9 +831,6 @@ _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,
|
||||||
|
|||||||
@@ -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' },
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user