Compare commits
10 Commits
openrc-0.9
...
openrc-0.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aac509837e | ||
|
|
2a84a8081e | ||
|
|
b27a9003bb | ||
|
|
9fa54a8e80 | ||
|
|
7a1e4ef606 | ||
|
|
0dc9431bdb | ||
|
|
0fa164dff2 | ||
|
|
582c8e9868 | ||
|
|
de6323ba51 | ||
|
|
3272261479 |
@@ -1,3 +1,3 @@
|
||||
NAME= openrc
|
||||
VERSION= 0.9.9.2
|
||||
VERSION= 0.9.9.3
|
||||
PKG= ${NAME}-${VERSION}
|
||||
|
||||
14
TODO
14
TODO
@@ -5,3 +5,17 @@
|
||||
- oldnet[bridging]: Review setting of bridge configuration on dynamic interface add
|
||||
|
||||
- Document rc-depend binary.
|
||||
|
||||
- _ifindex is not a reliable means of calculating metrics:
|
||||
_ifindex is used for calculating metrics for new devices but has a major
|
||||
problem: Since it's only the nth entry in /proc/net/dev
|
||||
And devices may be removed from that file, and reordered, you won't always
|
||||
get the same result.
|
||||
If you do:
|
||||
- add eth0 - _ifindex (eth0=0)
|
||||
- add vlan1 - _ifindex (eth0=0,vlan1=1)
|
||||
- add vlan2 - _ifindex (eth0=0,vlan1=1,vlan2=2)
|
||||
- rem vlan1 - _ifindex (eth0=0,vlan2=1)
|
||||
- add vlan3 - _ifindex (eth0=0,vlan2=1,vlan3=2)
|
||||
Now your routing table has entries for both vlan2 and vlan3 with a metric of 2.
|
||||
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
# you should set it to "local".
|
||||
clock="UTC"
|
||||
|
||||
# If you want to set the system time to the current hardware clock
|
||||
# during bootup, then say "YES" here. You do not need this if you are
|
||||
# running a modern kernel with CONFIG_RTC_HCTOSYS set to y.
|
||||
# If you want the hwclock script to set the system time (software clock)
|
||||
# to match the current hardware clock during bootup, leave this
|
||||
# commented out.
|
||||
# However, you can set this to "NO" ifyou are running a modern kernel
|
||||
# with CONFIG_RTC_HCTOSYS set to y and your hardware clock set to UTC.
|
||||
#clock_hctosys="YES"
|
||||
|
||||
# If you do not want to set the hardware clock to the current system
|
||||
|
||||
@@ -92,7 +92,8 @@ or stopping them.
|
||||
The following variables affect the service script:
|
||||
.Bl -tag -width "RC_DEFAULTLEVEL"
|
||||
.It Ar extra_commands
|
||||
Space separated list of extra commands the service defines.
|
||||
Space separated list of extra commands the service defines. These should
|
||||
not depend on the service being stopped or started.
|
||||
.It Ar extra_started_commands
|
||||
Space separated list of extra commands the service defines. These only work if
|
||||
the service has already been started.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
ifconfig_depend()
|
||||
{
|
||||
program /sbin/ifconfig
|
||||
program /sbin/ifconfig /bin/ifconfig
|
||||
provide interface
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ _down()
|
||||
|
||||
_exists()
|
||||
{
|
||||
grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/dev
|
||||
[ -e /sys/class/net/"$IFACE" ]
|
||||
}
|
||||
|
||||
_ifindex()
|
||||
|
||||
@@ -20,7 +20,7 @@ _down()
|
||||
|
||||
_exists()
|
||||
{
|
||||
grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/dev
|
||||
[ -e /sys/class/net/"$IFACE" ]
|
||||
}
|
||||
|
||||
_ifindex()
|
||||
|
||||
@@ -4,6 +4,22 @@
|
||||
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
|
||||
# Released under the 2-clause BSD license.
|
||||
|
||||
verify_boot()
|
||||
{
|
||||
if [ ! -e ${RC_SVCDIR}/softlevel ]; then
|
||||
eerror "You are attempting to run an openrc service on a"
|
||||
eerror "system which openrc did not boot."
|
||||
eerror "You may be inside a chroot or you may have used"
|
||||
eerror "another initialization system to boot this system."
|
||||
eerror "In this situation, you will get unpredictable results!"
|
||||
eerror
|
||||
eerror "If you really want to do this, issue the following command:"
|
||||
eerror "touch ${RC_SVCDIR}/softlevel"
|
||||
exit 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
sourcex()
|
||||
{
|
||||
if [ "$1" = "-e" ]; then
|
||||
@@ -24,18 +40,6 @@ if sourcex -e "/sbin/livecd-functions.sh"; then
|
||||
livecd_read_commandline
|
||||
fi
|
||||
|
||||
if [ ! -e ${RC_SVCDIR}/softlevel ]; then
|
||||
eerror "You are attempting to run an openrc service on a"
|
||||
eerror "system which openrc did not boot."
|
||||
eerror "You may be inside a chroot or you may have used"
|
||||
eerror "another initialization system to boot this system."
|
||||
eerror "In this situation, you will get unpredictable results!"
|
||||
eerror
|
||||
eerror "If you really want to do this, issue the following command:"
|
||||
eerror "touch ${RC_SVCDIR}/softlevel"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$1" -o -z "$2" ]; then
|
||||
eerror "$RC_SVCNAME: not enough arguments"
|
||||
exit 1
|
||||
@@ -256,7 +260,7 @@ while [ -n "$1" ]; do
|
||||
# we can run this command
|
||||
for _cmd in $extra_started_commands; do
|
||||
if [ "$_cmd" = "$1" ]; then
|
||||
if ! service_started; then
|
||||
if verify_boot && ! service_started; then
|
||||
eerror "$RC_SVCNAME: cannot \`$1' as it has not been started"
|
||||
exit 1
|
||||
fi
|
||||
@@ -266,13 +270,16 @@ while [ -n "$1" ]; do
|
||||
# we can run this command
|
||||
for _cmd in $extra_stopped_commands; do
|
||||
if [ "$_cmd" = "$1" ]; then
|
||||
if ! service_stopped; then
|
||||
if verify_boot && ! service_stopped; then
|
||||
eerror "$RC_SVCNAME: cannot \`$1' as it has not been stopped"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
unset _cmd
|
||||
case $1 in
|
||||
start|stop|status) verify_boot;;
|
||||
esac
|
||||
if [ "$(command -v "$1_pre")" = "$1_pre" ]
|
||||
then
|
||||
"$1"_pre || exit $?
|
||||
|
||||
Reference in New Issue
Block a user