[arch-projects] [initscripts][PATCH 1/2] arch-tmpfiles: avoid subshell in creating empty files
install /dev/null as the new file instead of creating an empty file via a no-op process substitution. Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- arch-tmpfiles | 4 ++-- rc.shutdown | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch-tmpfiles b/arch-tmpfiles index c646ecd..f133a40 100755 --- a/arch-tmpfiles +++ b/arch-tmpfiles @@ -49,7 +49,7 @@ _f() { fi if [[ ! -e $path ]]; then - install -m"$mode" -o"$uid" -g"$gid" <(:) "$path" + install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" fi } @@ -64,7 +64,7 @@ _F() { return fi - install -m"$mode" -o"$uid" -g"$gid" <(:) "$path" + install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" } _d() { diff --git a/rc.shutdown b/rc.shutdown index ebfc22c..c70a4ca 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -27,7 +27,7 @@ run_hook shutdown_postkillall stat_busy "Saving Random Seed" RANDOM_SEED=/var/lib/misc/random-seed - install -TDm 0600 <(:) $RANDOM_SEED + install -TDm 0600 /dev/null $RANDOM_SEED POOL_FILE=/proc/sys/kernel/random/poolsize if [[ -r $POOL_FILE ]]; then read POOL_SIZE < $POOL_FILE -- 1.7.6
We still default to listing all daemons if none are specified. Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- rc.d | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/rc.d b/rc.d index a7b214e..bfc4719 100755 --- a/rc.d +++ b/rc.d @@ -33,7 +33,12 @@ case $1 in list) shift cd /etc/rc.d/ - for d in *; do + if (( $# )); then + daemons=("$@") + else + daemons=(*) + fi + for d in "${daemons[@]}"; do have_daemon "$d" || continue # print running / stopped satus if ! ck_daemon "$d"; then -- 1.7.6
On Sun, Jul 31, 2011 at 08:35:01AM -0400, Dave Reisner wrote:
We still default to listing all daemons if none are specified.
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- rc.d | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/rc.d b/rc.d index a7b214e..bfc4719 100755 --- a/rc.d +++ b/rc.d @@ -33,7 +33,12 @@ case $1 in list) shift cd /etc/rc.d/ - for d in *; do + if (( $# )); then + daemons=("$@") + else + daemons=(*) + fi + for d in "${daemons[@]}"; do
This breaks both `rc.d list started` and `rc.d list stopped`. We either need to introduce exceptions here or create a separate option to list specific daemons only.
have_daemon "$d" || continue # print running / stopped satus if ! ck_daemon "$d"; then -- 1.7.6
On Sun, Jul 31, 2011 at 03:04:05PM +0200, Lukas Fleischer wrote:
On Sun, Jul 31, 2011 at 08:35:01AM -0400, Dave Reisner wrote:
We still default to listing all daemons if none are specified.
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- rc.d | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/rc.d b/rc.d index a7b214e..bfc4719 100755 --- a/rc.d +++ b/rc.d @@ -33,7 +33,12 @@ case $1 in list) shift cd /etc/rc.d/ - for d in *; do + if (( $# )); then + daemons=("$@") + else + daemons=(*) + fi + for d in "${daemons[@]}"; do
This breaks both `rc.d list started` and `rc.d list stopped`. We either need to introduce exceptions here or create a separate option to list specific daemons only.
Wow, I totally breezed over that part... disregard this. d
have_daemon "$d" || continue # print running / stopped satus if ! ck_daemon "$d"; then -- 1.7.6
participants (2)
-
Dave Reisner
-
Lukas Fleischer