aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/functions
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2009-09-08 16:22:20 -0400
committerBill Nottingham <notting@redhat.com>2009-09-08 16:22:20 -0400
commit8fa3e3bee06cfd628d46855e12b80562645f0319 (patch)
tree44c8d400263dc8a20d9e690a06cdb5ded15b357a /rc.d/init.d/functions
parentf074d57699c2f46bb42fe2e08b73174955f4966d (diff)
downloadinitscripts-8fa3e3bee06cfd628d46855e12b80562645f0319.tar
initscripts-8fa3e3bee06cfd628d46855e12b80562645f0319.tar.gz
initscripts-8fa3e3bee06cfd628d46855e12b80562645f0319.tar.bz2
initscripts-8fa3e3bee06cfd628d46855e12b80562645f0319.tar.xz
initscripts-8fa3e3bee06cfd628d46855e12b80562645f0319.zip
Add a -l option to status to pass the lock file name. (#521772)
Diffstat (limited to 'rc.d/init.d/functions')
-rw-r--r--rc.d/init.d/functions13
1 files changed, 10 insertions, 3 deletions
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