Compare commits

...

9 Commits

Author SHA1 Message Date
William Hubbs
5c8ba80ea7 release openrc-0.11.2 2012-10-22 02:38:31 -05:00
Andrew Gregory
e8ad6d2423 fix typo in rc-status.8
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-10-22 00:12:27 -05:00
Andrew Gregory
aa34435cc8 tmpfilesd: parse arguments with spaces
systemd allows the final arg in tmpfiles to contain spaces.  Using the read()
call to set the variables includes all trailing components in $arg so it
doesn't get cut off.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-10-22 00:12:27 -05:00
Andrew Gregory
68f8e8aac2 tmpfiles: return success from _f/_F on empty $arg
'[ -n "$arg" ] && _w' causes _f/_F to return the failure from the test when
$arg is empty.  Inverting the test causes the test and _f/_F to return success.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-10-21 22:37:39 -05:00
William Hubbs
ee54bfef05 tmpfiles: do not process systemd.conf
This file contains definitions specific to systemd, so we should not
process it.

Reported-by: <andrew.gregory.8@gmail.com>
2012-10-21 14:52:37 -05:00
William Hubbs
7279b469ec release openrc-0.11.1 2012-10-19 22:30:40 -05:00
William Hubbs
8482008559 tmfiles: change need dev to use dev.
This is being changed to use for the reason I stated in the previous
commit. There is no guarantee that someone is using a device manager.
2012-10-19 21:52:20 -05:00
William Hubbs
463d4ef00a devfs: Remove references to specific device managers
There were references in the devfs script to mdev, udev and
udev-mount. These all provide the virtuals dev and dev-mount; that is
how we should refer to them.

I believe in the discussion I had with Tony and Robin about this, we
were going to change the "use" line to "need". However, after thinking
that over, I'm not comfortable doing so because someone could be running
a static /dev with no device manager.

Reported-by: <tokiclover@gmail.com>
X-Gentoo-Bug: 438932
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=438932
2012-10-19 21:50:51 -05:00
William Hubbs
b5629d4ea0 Fix bashism in tmpfilesd scripts
Reported-by: <pesa@gentoo.org>
2012-10-19 13:09:58 -05:00
6 changed files with 19 additions and 30 deletions

View File

@@ -1,3 +1,3 @@
NAME= openrc NAME= openrc
VERSION= 0.11 VERSION= 0.11.2
PKG= ${NAME}-${VERSION} PKG= ${NAME}-${VERSION}

View File

@@ -5,8 +5,8 @@
description="Mount system critical filesystems in /dev." description="Mount system critical filesystems in /dev."
depend() { depend() {
use dev-mount udev-mount use dev-mount
before udev mdev before dev
keyword -prefix -vserver keyword -prefix -vserver
} }

View File

@@ -11,7 +11,7 @@ depend()
start() start()
{ {
ebegin "${description/Create/Creating}" ebegin "Creating ${description#Create }"
@LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts} @LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts}
eend $? eend $?
return 0 return 0

View File

@@ -8,12 +8,12 @@ depend()
{ {
# Convert to 'need dev' when the new udev is ready, for OpenRC 0.11 # Convert to 'need dev' when the new udev is ready, for OpenRC 0.11
#need dev-mount #need dev-mount
need dev use dev
} }
start() start()
{ {
ebegin "${description/Create/Creating}" ebegin "Creating ${description#Create }"
@LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts} @LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts}
eend $? eend $?
return 0 return 0

View File

@@ -46,7 +46,7 @@ Show all runlevels and their services.
List all services that have crashed. List all services that have crashed.
.It Fl l , -list .It Fl l , -list
List all defined runlevels. List all defined runlevels.
.It fl r , -runlevel .It Fl r , -runlevel
Print the current runlevel name. Print the current runlevel name.
.It Fl s , -servicelist .It Fl s , -servicelist
Show all services. Show all services.

View File

@@ -61,7 +61,7 @@ _f() {
if [ ! -e "$path" ]; then if [ ! -e "$path" ]; then
dryrun_or_real install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" dryrun_or_real install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path"
[ -n "$arg" ] && _w "$@" [ -z "$arg" ] || _w "$@"
fi fi
} }
@@ -72,7 +72,7 @@ _F() {
[ $CREATE -gt 0 ] || return 0 [ $CREATE -gt 0 ] || return 0
dryrun_or_real install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" dryrun_or_real install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path"
[ -n "$arg" ] && _w "$@" [ -z "$arg" ] || _w "$@"
} }
_d() { _d() {
@@ -201,6 +201,7 @@ tmpfiles_d=''
# `/run/tmpfiles/foo.conf' will always be read after `/etc/tmpfiles.d/bar.conf' # `/run/tmpfiles/foo.conf' will always be read after `/etc/tmpfiles.d/bar.conf'
for d in ${tmpfiles_dirs} ; do for d in ${tmpfiles_dirs} ; do
[ -d $d ] && for f in ${d}/*.conf ; do [ -d $d ] && for f in ${d}/*.conf ; do
[ "$f" = "$d/systemd.conf" ] && continue
[ -f $f ] && tmpfiles_basenames="${tmpfiles_basenames}\n${f##*/}" [ -f $f ] && tmpfiles_basenames="${tmpfiles_basenames}\n${f##*/}"
done # for f in ${d} done # for f in ${d}
done # for d in ${tmpfiles_dirs} done # for d in ${tmpfiles_dirs}
@@ -252,46 +253,34 @@ for FILE in $tmpfiles_d ; do
# XXX: Upstream says whitespace is NOT permitted in the Path argument. # XXX: Upstream says whitespace is NOT permitted in the Path argument.
# But IS allowed when globs are expanded for the x/r/R/z/Z types. # But IS allowed when globs are expanded for the x/r/R/z/Z types.
while read line; do while read cmd path mode uid gid age arg; do
LINENUM=$(( LINENUM+1 )) LINENUM=$(( LINENUM+1 ))
# This will skip over comments and empty lines
set -- $line
# Unless we have both command and path, skip this line. # Unless we have both command and path, skip this line.
if [ -z "$1" -o -z "$2" ]; then if [ -z "$cmd" -o -z "$path" ]; then
continue continue
fi fi
# whine about invalid entries # whine about invalid entries
case $1 in case $cmd in
f|F|w|d|D|p|L|c|b|x|r|R|z|Z) ;; f|F|w|d|D|p|L|c|b|x|r|R|z|Z) ;;
\#) continue ;; \#) continue ;;
*) warninvalid ; continue ;; *) warninvalid ; continue ;;
esac esac
cmd=$1
path=$2
# fall back on defaults when parameters are passed as '-' # fall back on defaults when parameters are passed as '-'
if [ "$3" = '-' -o "$3" = '' ]; then if [ "$mode" = '-' -o "$mode" = '' ]; then
case ${1} in case "$cmd" in
p|f|F) mode=0644 ;; p|f|F) mode=0644 ;;
d|D) mode=0755 ;; d|D) mode=0755 ;;
z|Z|x|r|R|L) ;; z|Z|x|r|R|L) ;;
esac esac
else
mode=$3
fi fi
uid=$4
gid=$5
age=$6
arg=$7
[ "${4}" = '-' -o "${4}" = '' ] && uid=0 [ "$uid" = '-' -o "$uid" = '' ] && uid=0
[ "${5}" = '-' -o "${5}" = '' ] && gid=0 [ "$gid" = '-' -o "$gid" = '' ] && gid=0
[ "${6}" = '-' -o "${6}" = '' ] && age=0 [ "$age" = '-' -o "$age" = '' ] && age=0
[ "${7}" = '-' -o "${7}" = '' ] && arg='' [ "$arg" = '-' -o "$arg" = '' ] && arg=''
set -- "$path" "$mode" "$uid" "$gid" "$age" "$arg" set -- "$path" "$mode" "$uid" "$gid" "$age" "$arg"
[ "$VERBOSE" -eq "1" ] && echo _$cmd "$@" [ "$VERBOSE" -eq "1" ] && echo _$cmd "$@"