From 8fa3e3bee06cfd628d46855e12b80562645f0319 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 8 Sep 2009 16:22:20 -0400 Subject: Add a -l option to status to pass the lock file name. (#521772) --- rc.d/init.d/functions | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'rc.d/init.d/functions') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 82590a16..c8870d3a 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -386,7 +386,7 @@ pidofproc() { } status() { - local base pid pid_file= + local base pid lock_file= pid_file= # Test syntax. if [ "$#" = 0 ] ; then @@ -397,6 +397,10 @@ status() { pid_file=$2 shift 2 fi + if [ "$1" = "-l" ]; then + lock_file=$2 + shift 2 + fi base=${1##*/} # First try "pidof" @@ -420,8 +424,11 @@ status() { return 1 ;; esac - # See if /var/lock/subsys/${base} exists - if [ -f /var/lock/subsys/${base} ]; then + if [ -z "${lock_file}" ]; then + lock_file=${base} + fi + # See if /var/lock/subsys/${lock_file} exists + if [ -f /var/lock/subsys/${lock_file} ]; then echo $"${base} dead but subsys locked" return 2 fi -- cgit v1.2.1