Compare commits

...

27 Commits

Author SHA1 Message Date
William Hubbs
900d54b0fc release openrc-0.6.8 2010-12-07 22:32:44 -06:00
William Hubbs
84750f5722 bug 232347: fix netmount to respect _netdev option
The _netdev option in fstab on linux systems indicates
that a filesystem should only be mounted if the network is available.

This commit fixes netmount to support this.
2010-12-07 11:54:03 -06:00
Robin H. Johnson
f8f03bdbbf Bug #345281: If wpa_supplicant is built w/ USE=dbus, we need to start after DBus is up. 2010-12-06 02:54:21 +00:00
Robin Johnson
80d5f7d27b fix selinux context for rc-svcdir (bug #347503) 2010-12-03 23:49:34 -06:00
William Hubbs
449080e145 release openrc-0.6.7 2010-12-03 14:51:30 -06:00
Thomas Pfaff
062223a5df Avoid race condition in runscript (bug #319865)
Under normal conditions, runscript creates one child and waits for its
termination, which is signaled by a pipe write from the SIGCHLD
sighandler.

When running killprocs however more than one SIGHCLD signal is generated, at
least on all of my amd64 boxes running on real hardware and in vmware.

When the first SIGCHLD occurs svc_exec leaves the loop and closes the pipe.
Subsequent SIGCHLDs during the close can lead to a race condition and create an
EBADF error in the pipe write (pipe is closed but the file handle is still !=
-1).

We avoid this by blocking SIGHCHLD during the pipe close.
2010-12-03 14:01:28 -06:00
William Hubbs
18064e19f6 release openrc-0.6.6 2010-11-30 16:04:17 -06:00
William Hubbs
cdf07b5970 localmount should only use the -O option for linux systems
This fixes bug #347307.
2010-11-30 15:40:44 -06:00
William Hubbs
82b265016a send error output from chattr command to /dev/null
This is for bug #346659.
2010-11-26 14:54:30 -06:00
William Hubbs
bdfab242b7 release openrc-0.6.5 2010-11-21 11:08:53 -06:00
William Hubbs
4ca32808dd Revert "allow ifplugd to work on wireless interfaces"
This reverts commit 4ea75dd1d6.
This caused a regression, see bug #345795.

Ifplugd is only designed to support wireless interfaces that use the
older wireless extentions.
2010-11-18 15:06:42 -06:00
William Hubbs
9e5b9abf40 remove "use hostname" from sysctl for bsd systems 2010-11-16 10:03:05 -06:00
William Hubbs
ac37dc2764 do not mount local file systems with the _netdev option in fstab
This fixes #344947.
2010-11-15 12:01:48 -06:00
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
16 changed files with 98 additions and 39 deletions

View File

@@ -1,3 +1,3 @@
NAME= openrc
VERSION= 0.6.2
VERSION= 0.6.8
PKG= ${NAME}-${VERSION}

View File

@@ -11,7 +11,8 @@
# 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
# this feature.
# this feature. This feature is automatically disabled if rc_parallel is
# set to YES.
#rc_interactive="YES"
# 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.
#unicode="NO"
# Network fstypes. Below is the default.
net_fs_list="afs cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre ncpfs nfs nfs4 ocfs2 shfs smbfs"
# Below is the default list of network fstypes.
#
# 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

View File

@@ -4,7 +4,6 @@
depend()
{
use hostname
need localmount
before logger
after clock sysctl
@@ -36,6 +35,12 @@ cleanup_tmp_dir()
# Faster than find
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 2> /dev/null
find $startopts ! -name . \
! -path "./lost+found" \
! -path "./lost+found/*" \
@@ -49,8 +54,6 @@ cleanup_tmp_dir()
! -path "./aquota.group/*" \
! -path "./journal" \
! -path "./journal/*" \
! -path "./.private" \
! -path "./.private/*" \
-exec rm -rf {} \;
eend 0
else

View File

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

View File

@@ -14,13 +14,16 @@ depend()
start()
{
# Mount local filesystems in /etc/fstab.
local types="noproc" x=
local types="noproc" x= no_netdev=
for x in $net_fs_list; do
types="${types},${x}"
done
if [ "$RC_UNAME" = Linux ]; then
no_netdev="-O no_netdev"
fi
ebegin "Mounting local filesystems"
mount -at "$types"
mount -at "$types" $no_netdev
eend $? "Some local filesystem failed to mount"
# Always return 0 - some local mounts may not be critical for boot

View File

@@ -43,7 +43,7 @@ start()
local myneed= myuse= pmap="portmap" nfsmounts=
[ -x @SYSCONFDIR@/init.d/rpcbind ] && pmap="rpcbind"
local x= fs=
local x= fs= rc=
for x in $net_fs_list; do
case "$x" in
nfs|nfs4)
@@ -65,7 +65,12 @@ start()
ebegin "Mounting network filesystems"
mount -at $fs
ewend $? "Could not mount all network filesystems"
rc=$?
if [ "$RC_UNAME" = Linux ]; then
mount -a -O _netdev
rc=$?
fi
ewend $rc "Could not mount all network filesystems"
return 0
}
@@ -93,5 +98,9 @@ stop()
retval=$?
eoutdent
if [ "$RC_UNAME" = Linux ]; then
umount -a -O _netdev
retval=$?
fi
eend $retval "Failed to unmount network filesystems"
}

View File

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

View File

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

View File

@@ -46,12 +46,27 @@ bonding_pre_start()
return 1
fi
# Configure the bond.
# Nice and dynamic :)
# Interface must be down in order to configure
_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
[ -f "${x}" ] || continue
n=${x##*/}
eval s=\$${n}_${IFVAR}
[ "${n}" != "mode" ] || continue
if [ -n "${s}" ]; then
einfo "Setting ${n}: ${s}"
echo "${s}" >"${x}" || \

View File

@@ -3,10 +3,14 @@
wpa_supplicant_depend()
{
if [ -x /usr/sbin/wpa_supplicant ]; then
program start /usr/sbin/wpa_supplicant
else
program start /sbin/wpa_supplicant
wpas=/usr/sbin/wpa_supplicant
[ -x ${wpas} ] || wpas=/sbin/wpa_supplicant
if [ -x ${wpas} ]; then
program start ${wpas}
# bug 345281: if wpa_supplicant is built w/ USE=dbus, we need to start
# dbus before we can start wpa_supplicant.
${wpas} -h |grep DBus -sq
[ $? -eq 0 ] && need dbus
fi
after macnet plug
before interface
@@ -183,11 +187,9 @@ wpa_supplicant_post_stop()
fi
if yesno "${IN_BACKGROUND}"; then
# Don't stop wpa_supplicant & wpa_cli if in background
return 0
# Only stop wpa_supplicant if it's not the controlling daemon
! service_started_daemon "${RC_SVCNAME}" "${wpas}" 1
fi
# Only stop wpa_supplicant if it's not the controlling daemon
! service_started_daemon "${RC_SVCNAME}" "${wpas}" 1
[ $? != 0 ] && return 0
local pidfile="/var/run/wpa_cli-${IFACE}.pid"

View File

@@ -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'

View File

@@ -17,7 +17,7 @@ fi
if [ -e /etc/runlevels/"$RC_DEFAULTLEVEL"/consolefont \
-o -e /etc/runlevels/"$RC_BOOTLEVEL"/consolefont ]; then
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)"
[ -c "$CONSOLE" ] && cons="-C $CONSOLE"
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
kbd_mode $kmode -C "$CONSOLE" 2>/dev/null
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

View File

@@ -6,6 +6,17 @@
# This basically mounts $RC_SVCDIR as a ramdisk.
# The tricky part is finding something our kernel supports
# tmpfs and ramfs are easy, so force one or the other.
svcdir_restorecon()
{
local rc=0
if [ -x /usr/sbin/selinuxenabled -a -c /selinux/null ] &&
selinuxenabled; then
restorecon $RC_SVCDIR
rc=$?
fi
return $rc
}
mount_svcdir()
{
# mount from fstab if we can
@@ -16,8 +27,12 @@ mount_svcdir()
# Some buggy kernels report tmpfs even when not present :(
if grep -Eq "[[:space:]]+tmpfs$" /proc/filesystems; then
mount -n -t tmpfs $fsopts,mode=755,size=${svcsize}k \
rc-svcdir "$RC_SVCDIR" && return 0
local tmpfsopts="${fsopts},mode=755,size=${svcsize}k"
mount -n -t tmpfs $tmpfsopts rc-svcdir "$RC_SVCDIR"
if [ $? -eq 0 ]; then
svcdir_restorecon
[ $? -eq 0 ] && return 0
fi
fi
if grep -Eq "[[:space:]]+ramfs$" /proc/filesystems; then
@@ -38,6 +53,10 @@ mount_svcdir()
fi
mount -n -t "$fs" $fsopts rc-svcdir "$RC_SVCDIR"
if [ $? -eq 0 ]; then
svcdir_restorecon
[ $? -eq 0 ] && return 0
fi
}
. "$RC_LIBEXECDIR"/sh/functions.sh

View File

@@ -38,7 +38,8 @@ stop_addon()
( 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()
{
[ -z "$1" ] && return 1

View File

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

View File

@@ -350,6 +350,8 @@ svc_exec(const char *arg1, const char *arg2)
size_t bytes;
bool prefixed = false;
int slave_tty;
sigset_t sigchldmask;
sigset_t oldmask;
/* Setup our signal pipe */
if (pipe(signal_pipe) == -1)
@@ -439,10 +441,17 @@ svc_exec(const char *arg1, const char *arg2)
}
free(buffer);
sigemptyset (&sigchldmask);
sigaddset (&sigchldmask, SIGCHLD);
sigprocmask (SIG_BLOCK, &sigchldmask, &oldmask);
close(signal_pipe[0]);
close(signal_pipe[1]);
signal_pipe[0] = signal_pipe[1] = -1;
sigprocmask (SIG_SETMASK, &oldmask, NULL);
if (master_tty >= 0) {
/* Why did we do this? */
/* signal (SIGWINCH, SIG_IGN); */