Resolves: #247034 fix init script

This commit is contained in:
Ivana Varekova 2007-07-25 07:08:51 +00:00
parent 42f996baf2
commit dd6345e8e1
2 changed files with 31 additions and 8 deletions

View File

@ -6,23 +6,43 @@
#
# chkconfig: - 90 10
# description: Starts and stops process accounting
# short-description: Starts and stops process accounting
# Source function library.
. /etc/init.d/functions
# The location of the accounting file
ACCTFILE=/var/account/pacct
LOCKFILE=/var/lock/subsys/psacct
start() {
[ ! -r $ACCTFILE ] && touch $ACCTFILE && chmod 600 $ACCTFILE
if [ -r $ACCTFILE ]; then
action $"Starting process accounting: " /sbin/accton $ACCTFILE
touch /var/lock/subsys/psacct
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
touch $LOCKFILE
else
exit 3
fi
else
exit 1
fi
}
stop() {
action $"Shutting down process accounting: " /sbin/accton
rm -f /var/lock/subsys/psacct
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
rm -f $LOCKFILE
exit 3
else
exit 0
fi
}
# See how we were called.
case "$1" in
start)
@ -32,11 +52,10 @@ case "$1" in
stop
;;
status)
if [ -e /var/lock/subsys/psacct ]; then
if [ -e $LOCKFILE ]; then
echo $"Process accounting is enabled."
else
echo $"Process accounting is disabled."
exit 3
fi
;;
restart|reload)

View File

@ -12,7 +12,7 @@
Summary: Utilities for monitoring process activities
Name: psacct
Version: 6.3.2
Release: 45%{?dist}
Release: 46%{?dist}
License: GPL
Group: Applications/System
Source: ftp://ftp.gnu.org/pub/gnu/acct-6.3.2.tar.gz
@ -169,6 +169,10 @@ fi
%{_infodir}/accounting.info.gz
%changelog
* Wed Jul 25 2007 Ivana Varekova <varekova@redhat.com> - 6.3.2-46
- Resolves: #247034
fix init script
* Mon May 28 2007 Ivana Varekova <varekova@redhat.com> - 6.3.2-45
- fix the return value of "service psacct status" command