Compare commits

..

23 Commits

Author SHA1 Message Date
William Hubbs
46e871a408 netmount: do not handle NFS mounts
Since nfs and nfs4 file systems require extra daemons to be running on
the client to function properly, netmount should not try to handle these
file systems.

Reported-by: <devurandom@gmx.net>
X-Gentoo-Bug: 427996
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=427996
2012-09-15 13:26:31 -05:00
William Hubbs
ed0696443d netmount: add checks for rpc.idmapd for nfs4 filesystems
Reported-by: <devurandom@gmx.net>
X-Gentoo-Bug: 427996
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=427996
2012-09-10 15:56:52 -05:00
William Hubbs
9e18838c83 savecache: make sure $RC_LIBEXECDIR is writable
This is needed in case of a read-only root filesystem such as a diskless
client.

Reported-by: <walter@pratyeka.org>
X-Gentoo-Bug: 430382
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=430382
2012-09-09 19:16:13 -05:00
William Hubbs
f7a3ac2d10 oldnet/iproute2.sh: fix carrier detection
We were not testing for carrier correctly when testing for ipv6
tentative addresses.

Reported-by: <ast@domdv.de>
X-Gentoo-Bug: 433012
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=433012
2012-09-09 19:13:26 -05:00
William Hubbs
604902f6c2 newnet: provide net if configuring more than the loopback interface 2012-09-09 18:53:18 -05:00
Christian Ruppert
eb07d1169f Fix quiet usage
EINFO_QUIET will always been unset when we first do unsetenv("EINFO_QUIET") and
later query it again anyway..
2012-09-09 18:44:40 -05:00
Christian Ruppert
a198ad3d4f Use do_umount's return value instead of eoutdent's. 2012-09-09 18:42:56 -05:00
William Hubbs
0e57fade64 swapfiles: make sure /proc/swaps exists
If CONFIG_SWAP is turned off in the kernel, this file may not exist. In
that case, we should not try to read from it.

reported-by: <walter@pratyeka.org>
X-Gentoo-Bug: 430378
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=430378
2012-09-09 18:40:55 -05:00
Robin H. Johnson
d036b4ad1a sh/tmpfiles: fix quoting for optional arguments
Some optional arguments were missing quotes in the tests, so produced
spurious warnings.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-09-09 18:38:15 -05:00
Robin H. Johnson
84c12adb79 Bug #427152: Port of VLAN code to sysfs/iproue2 from vconfig lost the ability to create different vlans with the same ID but different interfaces on a single system. Implement it now.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-09-09 18:36:20 -05:00
William Hubbs
c78d012dd6 fix reference to dmesg man page
Correct the reference in conf.d/dmesg from dmesg(8) to dmesg(1).

reported-by: <toralf.foerster@gmx.de>
X-Gentoo-Bug: 425370
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=425370
2012-09-09 18:33:06 -05:00
William Hubbs
31dbdf69d2 release openrc-0.10.5 2012-07-04 09:23:49 -05:00
Björn Baumbach
c7e14b2c17 net: fix typo 2012-07-04 09:22:28 -05:00
William Hubbs
6ceb62969a release openrc-0.10.4 2012-07-02 13:50:05 -05:00
William Hubbs
d5ecc9d746 fix handling of /run for vserver
Mount can't be used in vservers, but /run is still needed. So we create
the directory and clear it out instead of mounting a tmpfs in that
situation.

reported-by: <patrick@gentoo.org>
X-Gentoo-Bug: 423739
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=423739
2012-07-02 13:47:58 -05:00
William Hubbs
6df5176462 Release openrc-0.10.3 2012-06-11 16:09:12 -05:00
William Hubbs
0c6df86503 fix consolefont documentation to reflect the default state
conf.d/consolefont was written as though the consolefont service was
active by default. It is not, so this has been fixed.

reported-by: Ikonta@yandex.ru
X-Gentoo-Bug: 420037
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=420037
2012-06-07 10:57:34 -05:00
William Hubbs
cd2d520fd1 net/udhcpc: use -x hostname:NAME option instead of -h name
reported-by: bug@mejor.pl
X-Gentoo-Bug: 417617
X-Gentoo-Bug-URL: https://bugs.gentoo.org/417617
2012-06-07 00:39:14 -05:00
William Hubbs
0e3860e76f net: clarify how to prefer ifconfig over iproute2
reported-by: <vsync@quadium.net>
X-Gentoo-Bug: 417899
X-Gentoo-Bug-Url: https://bugs.gentoo.org/show_bug.cgi?id=417899
2012-06-06 23:23:54 -05:00
William Hubbs
670b72b328 release openrc-0.10.2 2012-05-27 10:28:21 -05:00
William Hubbs
3ebaa31edb termencoding should not run on lxc
reported-by: Alexey Shvetsov <alexxy@gentoo.org>
2012-05-27 10:20:07 -05:00
William Hubbs
0f3813c8cf Release openrc-0.10.1 2012-05-24 10:46:07 -05:00
Mike Frysinger
28c13790ff rc: fix inverted string compare logic
X-Gentoo-Bug: 417227
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=417227
Reported-by: sphakka <marcoep@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-05-24 10:36:11 -05:00
17 changed files with 121 additions and 93 deletions

View File

@@ -1,3 +1,3 @@
NAME= openrc
VERSION= 0.10
VERSION= 0.10.5
PKG= ${NAME}-${VERSION}

View File

@@ -1,9 +1,10 @@
# The consolefont service is not activated by default. If you need to
# use it, you should run "rc-update add consolefont boot" as root.
#
# consolefont specifies the default font that you'd like Linux to use on the
# console. You can find a good selection of fonts in /usr/share/consolefonts;
# you shouldn't specify the trailing ".psf.gz", just the font name below.
# To use the default console font, comment out the CONSOLEFONT setting below.
# This setting is used by the /etc/init.d/consolefont script (NOTE: if you do
# not want to use it, run "rc-update del consolefont boot" as root).
consolefont="default8x16"
# consoletranslation is the charset map file to use. Leave commented to use

View File

@@ -1,3 +1,3 @@
# Sets the level at which logging of messages is done to the
# console. See dmesg(8) for more info.
# console. See dmesg(1) for more info.
dmesg_level="1"

View File

@@ -34,7 +34,7 @@
# In other words, you probably should DO NOTHING HERE...
# Prefer ifconfig over iproute2
#modules="ifconfig"
#modules="!iproute2"
# You can also specify other modules for an interface
# In this case we prefer udhcpc over dhcpcd
@@ -57,7 +57,7 @@
# If you don't specify an interface then we prefer iproute2 if it's installed
# To prefer ifconfig over iproute2
#modules="ifconfig"
#modules="!iproute2"
# For a static configuration, use something like this
# (They all do exactly the same thing btw)
@@ -552,26 +552,34 @@
# You can also configure the VLAN - see for ip man page for more details
# To change the vlan interface name. If not set, the standard "iface.vlanid"
# will be used. This is the replacement for the old 'vconfig set_name_type'
# functionality.
# functionality. If you previously relied on the DEV_PLUS_VID or
# DEV_PLUS_VID_NO_PAD options to have different VLANs with same ID value, on
# different interfaces, please note that you need to use both the interface and
# vlan number in the numbering. This applies for all of the options: name,
# txqueuelen, mac, broadcast, mtu, ingress, egress, flags
#vlan1_name="vlan1"
#vlan2_name="eth0.2"
#eth0_vlan2_name="eth0.2"
#eth1_vlan2_name="eth1.2"
# The following shows the old set_name_type setting and what new option to set:
# Using eth9 & VLAN VID 26 as an example.
# VLAN_PLUS_VID vlan26_name="vlan0026"
# VLAN_PLUS_VID_NO_PAD vlan26_name="vlan26"
# DEV_PLUS_VID vlan26_name="eth9.0026"
# DEV_PLUS_VID_NO_PAD vlan26_name="eth9.26"
# DEV_PLUS_VID eth9_vlan26_name="eth9.0026"
# DEV_PLUS_VID_NO_PAD eth9_vlan26_name="eth9.26"
# Set the vlan flags
#vlan1_flags="reorder_hdr off gvrp on loose_binding on"
#eth0_vlan1_flags="reorder_hdr off gvrp on loose_binding on"
# Configure in/egress maps
#vlan1_ingress="2:6 3:5"
#vlan1_egress="1:2"
#eth0_vlan1_egress="1:2"
#config_vlan1="172.16.3.1/23"
#config_vlan2="172.16.2.1/23"
#config_vlan1="172.16.2.1/24"
#config_vlan2="172.16.3.1/24"
#config_eth0_1="172.16.4.1/24"
#config_eth1_1="172.16.5.1/24"
# NOTE: Vlans can be configured with a . in their interface names
# When configuring vlans with this name type, you need to replace . with a _

View File

@@ -12,6 +12,8 @@ depend()
start()
{
local ret=0
# Flush all pending disk writes now
sync; sync
@@ -39,6 +41,9 @@ start()
do_unmount "umount -r" \
--skip-point-regex "$m" \
"${fs:+--skip-fstype-regex}" $fs --nonetdev
ret=$?
eoutdent
eend $?
eend $ret
}

View File

@@ -2,62 +2,27 @@
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
description="Mounts network shares according to /etc/fstab."
need_portmap()
{
local opts=
local IFS="
"
set -- $(fstabinfo --options --fstype nfs,nfs4)
for opts; do
case ,$opts, in
*,noauto,*|*,nolock,*);;
*) return 0;;
esac
done
return 1
}
description="Mounts network shares, other than NFS, according to /etc/fstab."
# We skip all NFS shares in this script because they require extra
# daemons to be running on the client in order to work correctly.
# It is best to allow nfs-utils to handle all nfs shares.
depend()
{
# Only have portmap as a dependency if there is a nfs mount in fstab
# that is set to mount at boot
local pmap=
if need_portmap; then
pmap="rpc.statd"
[ -x @SYSCONFDIR@/init.d/rpcbind ] \
&& pmap="$pmap rpcbind" \
|| pmap="$pmap portmap"
fi
config /etc/fstab
need net $pmap
need net
use afc-client amd autofs openvpn
use dns nfs nfsmount portmap rpcbind rpc.statd rpc.lockd
use dns
keyword -jail -vserver
}
start()
{
local myneed= myuse= pmap="portmap" nfsmounts=
[ -x @SYSCONFDIR@/init.d/rpcbind ] && pmap="rpcbind"
local x= fs= rc=
for x in $net_fs_list $extra_net_fs_list; do
case "$x" in
nfs|nfs4)
# If the nfsmount script took care of the nfs
# filesystems, then there's no point in trying
# them twice
service_started nfsmount && continue
# Only try to mount NFS filesystems if portmap was
# started. This is to fix "hang" problems for new
# users who do not add portmap to the default runlevel.
if need_portmap && ! service_started "$pmap"; then
continue
fi
continue
;;
esac
fs="$fs${fs:+,}$x"
@@ -82,7 +47,14 @@ stop()
. "$RC_LIBEXECDIR"/sh/rc-mount.sh
for x in $net_fs_list $extra_net_fs_list; do
fs="$fs${fs:+,}$x"
case "$x" in
nfs|nfs4)
continue
;;
*)
fs="$fs${fs:+,}$x"
;;
esac
done
if [ -n "$fs" ]; then
umount -at $fs || eerror "Failed to simply unmount filesystems"
@@ -91,7 +63,14 @@ stop()
eindent
fs=
for x in $net_fs_list $extra_net_fs_list; do
fs="$fs${fs:+|}$x"
case "$x" in
nfs|nfs4)
continue
;;
*)
fs="$fs${fs:+|}$x"
;;
esac
done
[ -n "$fs" ] && fs="^($fs)$"
do_unmount umount ${fs:+--fstype-regex} $fs --netdev

View File

@@ -12,7 +12,10 @@ depend()
{
need localmount
after bootmisc
provide net
provide lo
if [ -n "$(interfaces)" ]; then
provide net
fi
keyword -jail -vserver
}

View File

@@ -13,6 +13,14 @@ start()
return 1
fi
fi
if ! checkpath -W "$RC_LIBEXECDIR"; then
ewarn "WARNING: ${RC_LIBEXECDIR} is not writable!"
if ! yesno "${RC_GOINGDOWN}"; then
ewarn "Unable to save deptree cache"
return 1
fi
return 0
fi
ebegin "Saving dependency cache"
local rc=
if [ ! -d "$RC_LIBEXECDIR"/cache ]; then

View File

@@ -31,14 +31,16 @@ stop()
case "$RC_UNAME" in
Linux)
while read filename type rest; do
case "$type" in
file) swapoff $filename >/dev/null;;
esac
case "$filename" in
/dev/loop*) swapoff $filename >/dev/null;;
esac
done < /proc/swaps
if [ -e /proc/swaps ]; then
while read filename type rest; do
case "$type" in
file) swapoff $filename >/dev/null;;
esac
case "$filename" in
/dev/loop*) swapoff $filename >/dev/null;;
esac
done < /proc/swaps
fi
;;
esac
eend 0

View File

@@ -9,7 +9,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
depend()
{
keyword -openvz -uml -vserver -xenu
keyword -lxc -openvz -uml -vserver -xenu
use root
after bootmisc
}

View File

@@ -212,7 +212,7 @@ _delete_addresses()
_has_carrier()
{
return 0
LC_ALL=C ip link show dev "${IFACE}" | grep -q "LOWER_UP"
}
_tunnel()
@@ -287,7 +287,7 @@ iproute2_pre_start()
_iproute2_ipv6_tentative()
{
# Only check tentative when we have a carrier.
LC_ALL=C ip link show dev "${IFACE}" | grep -q "NO-CARRIER" && return 1
_has_carrier || return 1
LC_ALL=C ip addr show dev "${IFACE}" | \
grep -q "^[[:space:]]*inet6 .* tentative"
}

View File

@@ -61,12 +61,12 @@ udhcpc_start()
esac
case " ${args} " in
*" --hosname="*|*" -h "*|*" -H "*);;
*" --hostname="*|*" -h "*|*" -H "*);;
*)
if ${sendhost}; then
local hname="$(hostname)"
if [ "${hname}" != "(none)" ] && [ "${hname}" != "localhost" ]; then
args="${args} --hostname='${hname}'"
args="${args} -x hostname:'${hname}'"
fi
fi
;;

View File

@@ -66,26 +66,41 @@ vlan_post_start()
einfo "Adding VLAN ${vlan} to ${IFACE}"
# We need to gather all interface configuration options
# 1) naming. Default to the standard "${IFACE}.${vlan}" but it can be anything
eval vname=\$vlan${vlan}_name
eval vname=\$${IFACE}_vlan${vlan}_name
[ -z "${vname}" ] && eval vname=\$vlan${vlan}_name
[ -z "${vname}" ] && vname="${IFACE}.${vlan}"
# 2) flags
eval vflags=\$vlan${vlan}_flags
eval vflags=\$${IFACE}_vlan${vlan}_flags
[ -z "${vname}" ] && eval vflags=\$vlan${vlan}_flags
# 3) ingress/egress map
eval vingress=\$vlan${vlan}_ingress
eval vingress=\$${IFACE}_vlan${vlan}_ingress
[ -z "${vingress}" ] && eval vingress=\$vlan${vlan}_ingress
[ -z "${vingress}" ] || vingress="ingress-qos-map ${vingress}"
eval vegress=\$vlan${vlan}_egress
eval vegress=\$${IFACE}_vlan${vlan}_egress
[ -z "${vegress}" ] && eval vegress=\$vlan${vlan}_egress
[ -z "${vegress}" ] || vegress="egress-qos-map ${vegress}"
# txqueue
local txqueuelen=
eval txqueuelen=\$txqueuelen_vlan${vlan}
eval txqueuelen=\$txqueuelen_${IFACE}_vlan${vlan}
[ -z "${txqueuelen}" ] && eval txqueuelen=\$txqueuelen_vlan${vlan}
# mac
local mac=
eval mac=\$mac_vlan${vlan}
eval mac=\$mac_${IFACE}_vlan${vlan}
[ -z "${mac}" ] && eval mac=\$mac_vlan${vlan}
# broadcast
local broadcast=
eval broadcast=\$broadcast_vlan${vlan}
eval broadcast=\$broadcast_${IFACE}_vlan${vlan}
[ -z "${broadcast}" ] && eval broadcast=\$broadcast_vlan${vlan}
# mtu
local mtu=
eval mtu=\$mtu_vlan${vlan}
eval mtu=\$mtu_${IFACE}_vlan${vlan}
[ -z "${mtu}" ] && eval mtu=\$mtu_vlan${vlan}
# combine it all
local opts="${txqueuelen:+txqueuelen} ${txqueuelen} ${mac:+address} ${mac} ${broadcast:+broadcast} ${broadcast} ${mtu:+mtu} ${mtu}"
veinfo "ip link add link \"${IFACE}\" name \"${vname}\" ${opts} type vlan id \"${vlan}\" ${vflags} ${vingress} ${vegress}"
e="$(ip link add link "${IFACE}" name "${vname}" ${opts} type vlan id "${vlan}" ${vflags} ${vingress} ${vegress} 2>&1 1>/dev/null)"
if [ -n "${e}" ]; then
eend 1 "${e}"

View File

@@ -37,14 +37,23 @@ fi
# /run is a new directory for storing volatile runtime data.
# Read more about /run at https://lwn.net/Articles/436012
sys="$(rc --sys)"
if [ ! -d /run ]; then
eerror "The /run directory does not exist. Unable to continue."
return 1
if [ "$sys" = VSERVER ]; then
if [ -e /run ]; then
rm -rf /run
fi
mkdir /run
else
eerror "The /run directory does not exist. Unable to continue."
return 1
fi
fi
if mountinfo -q /run; then
einfo "/run is already mounted, skipping"
else
if [ "$sys" = VSERVER ]; then
rm -rf /run/*
elif ! mountinfo -q /run; then
ebegin "Mounting /run"
rc=0
if ! fstabinfo --mount /run; then

View File

@@ -268,10 +268,10 @@ for FILE in $tmpfiles_d ; do
age=$6
arg=$7
[ ${4} = '-' ] && uid=0
[ ${5} = '-' ] && gid=0
[ ${6} = '-' ] && age=0
[ ${7} = '-' ] && arg=''
[ "${4}" = '-' -o "${4}" = '' ] && uid=0
[ "${5}" = '-' -o "${5}" = '' ] && gid=0
[ "${6}" = '-' -o "${6}" = '' ] && age=0
[ "${7}" = '-' -o "${7}" = '' ] && arg=''
set -- "$path" "$mode" "$uid" "$gid" "$age" "$arg"
[ "$VERBOSE" -eq "1" ] && echo _$cmd "$@"

View File

@@ -393,8 +393,7 @@ mountinfo(int argc, char **argv)
bool quiet;
char *this_path;
/* Ensure that we are only quiet when explicitly told to be */
unsetenv("EINFO_QUIET");
quiet = rc_yesno(getenv("EINFO_QUIET"));
#define DO_REG(_var) \
if (_var) free(_var); \
@@ -475,7 +474,6 @@ mountinfo(int argc, char **argv)
REG_FREE(args.skip_options_regex);
result = EXIT_FAILURE;
quiet = rc_yesno(getenv("EINFO_QUIET"));
/* We should report the mounts in reverse order to ease unmounting */
TAILQ_FOREACH_REVERSE(s, nodes, rc_stringlist, entries) {

View File

@@ -343,7 +343,7 @@ do_mark_service(int argc, char **argv)
if (service == NULL || *service == '\0')
eerrorx("%s: no service specified", applet);
if (strncmp(applet, "mark_", 5) &&
if (!strncmp(applet, "mark_", 5) &&
(bit = lookup_service_state(applet + 5)))
ok = rc_service_mark(service, bit);
else