Author: dnicholson
Date: 2007-04-16 15:39:36 -0600 (Mon, 16 Apr 2007)
New Revision: 8074
Modified:
trunk/bootscripts/ChangeLog
trunk/bootscripts/lfs/init.d/functions
Log:
Return the status of pidofproc in statusproc
Modified: trunk/bootscripts/ChangeLog
===================================================================
--- trunk/bootscripts/ChangeLog 2007-04-16 21:30:58 UTC (rev 8073)
+++ trunk/bootscripts/ChangeLog 2007-04-16 21:39:36 UTC (rev 8074)
@@ -9,6 +9,11 @@
* lfs/init.d/functions: statusproc() has been changed to use pidofproc()
instead of the deprecated getpids(). Additionally, it now accepts
the -p argument to specify a pidfile.
+ * lfs/init.d/functions: Currently, statusproc() always returns
+ successfully, and the only way to know if the process is running
+ is to parse the output. This changes statusproc() to return the
+ status of pidofproc(), which will return unsuccessfully if the
+ requested process is not running.
2007-03-13 Dan Nicholson <[EMAIL PROTECTED]>
* lfs/init.d/functions: If pidofproc() is passed the -p argument
Modified: trunk/bootscripts/lfs/init.d/functions
===================================================================
--- trunk/bootscripts/lfs/init.d/functions 2007-04-16 21:30:58 UTC (rev
8073)
+++ trunk/bootscripts/lfs/init.d/functions 2007-04-16 21:39:36 UTC (rev
8074)
@@ -281,6 +281,7 @@
{
local pidfile=""
local base=""
+ local ret=""
while true
do
@@ -320,6 +321,9 @@
pidofproc -s -p "${pidfile}" "${1}"
fi
+ # Store the return status
+ ret=$?
+
if [ -n "${pidlist}" ]; then
${ECHO} -e "${INFO}${base} is running with Process"\
"ID(s) ${pidlist}.${NORMAL}"
@@ -336,6 +340,9 @@
fi
fi
fi
+
+ # Return the status from pidofproc
+ return $ret
}
# The below functions are documented in the LSB-generic 2.1.0
--
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page