[arch-projects] [initscripts][PATCH 2/2] rc.d: allow specific daemons to be listed

Lukas Fleischer archlinux at cryptocrack.de
Sun Jul 31 09:04:05 EDT 2011


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 at 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


More information about the arch-projects mailing list