Resolves: #247034 fix init script
This commit is contained in:
parent
42f996baf2
commit
dd6345e8e1
27
psacct.init
27
psacct.init
@ -6,23 +6,43 @@
|
|||||||
#
|
#
|
||||||
# chkconfig: - 90 10
|
# chkconfig: - 90 10
|
||||||
# description: Starts and stops process accounting
|
# description: Starts and stops process accounting
|
||||||
|
# short-description: Starts and stops process accounting
|
||||||
|
|
||||||
|
|
||||||
# Source function library.
|
# Source function library.
|
||||||
. /etc/init.d/functions
|
. /etc/init.d/functions
|
||||||
|
|
||||||
# The location of the accounting file
|
# The location of the accounting file
|
||||||
ACCTFILE=/var/account/pacct
|
ACCTFILE=/var/account/pacct
|
||||||
|
LOCKFILE=/var/lock/subsys/psacct
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
[ ! -r $ACCTFILE ] && touch $ACCTFILE && chmod 600 $ACCTFILE
|
[ ! -r $ACCTFILE ] && touch $ACCTFILE && chmod 600 $ACCTFILE
|
||||||
|
if [ -r $ACCTFILE ]; then
|
||||||
action $"Starting process accounting: " /sbin/accton $ACCTFILE
|
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() {
|
stop() {
|
||||||
|
|
||||||
action $"Shutting down process accounting: " /sbin/accton
|
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.
|
# See how we were called.
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
@ -32,11 +52,10 @@ case "$1" in
|
|||||||
stop
|
stop
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
if [ -e /var/lock/subsys/psacct ]; then
|
if [ -e $LOCKFILE ]; then
|
||||||
echo $"Process accounting is enabled."
|
echo $"Process accounting is enabled."
|
||||||
else
|
else
|
||||||
echo $"Process accounting is disabled."
|
echo $"Process accounting is disabled."
|
||||||
exit 3
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
restart|reload)
|
restart|reload)
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
Summary: Utilities for monitoring process activities
|
Summary: Utilities for monitoring process activities
|
||||||
Name: psacct
|
Name: psacct
|
||||||
Version: 6.3.2
|
Version: 6.3.2
|
||||||
Release: 45%{?dist}
|
Release: 46%{?dist}
|
||||||
License: GPL
|
License: GPL
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
Source: ftp://ftp.gnu.org/pub/gnu/acct-6.3.2.tar.gz
|
Source: ftp://ftp.gnu.org/pub/gnu/acct-6.3.2.tar.gz
|
||||||
@ -169,6 +169,10 @@ fi
|
|||||||
%{_infodir}/accounting.info.gz
|
%{_infodir}/accounting.info.gz
|
||||||
|
|
||||||
%changelog
|
%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
|
* Mon May 28 2007 Ivana Varekova <varekova@redhat.com> - 6.3.2-45
|
||||||
- fix the return value of "service psacct status" command
|
- fix the return value of "service psacct status" command
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user