psacct/psacct.init

83 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

auto-import changelog data from psacct-6.3.2-18.src.rpm Tue Mar 26 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-18 - Fixed duh in initscript pointing to wrong accounting file (#61939) Sun Mar 17 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-17 - Removed the files usracct and savacct, which are not used by psacct utilities at all, but by the sa program. Our sa uses files in a different location, and so these files are unused and unnecessary. Sat Mar 16 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-16 - Added chkconfig to post and preun scripts for bug (#61191) Tue Mar 12 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-15 - Added new feature - psacct initscript now controls process accounting so that it is not just forced on if installed as was the previous behaviour - Modified the initscripts package to not force psacct on anymore and made the new psacct-6.3.2-15 conflict with previous initscripts packages. - Fixed logrotate config to set perms/owner of new log files, and closed bug (#54165) Thu Mar 07 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-14 - Fixed 64bit bug in calls to ctime() in lastcomm and dump-utmp (#60712) Wed Mar 06 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-13 - Removed Build_7x flag, added FHS_compliant flag, reworked specfile to use new flag, and fixed bug (#60716) Thu Feb 28 2002 Bill Nottingham <notting@redhat.com> 6.3.2-12 - rebuild in new environment for FHS correctness Thu Jan 31 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-11 - Conditionalized acct-6.3.2-config.patch to only be applied for RHL 7.x builds, as it breaks FHS compliance by putting files in nonstandard locations. Also fixed up other places in specfile for FHS 2.2. - Added acct-6.3.2-I-HATE-GNU-AUTOCONK.patch because I hate GNU autoconk really really badly. - Bumped to -11 to avoid buildsystem stupidness
2004-09-09 10:47:19 +00:00
#!/bin/bash
#
# psacct Script to control kernel process accounting
#
# Author: Mike A. Harris <mharris@redhat.com>
#
# chkconfig: - 90 10
# description: Starts and stops process accounting
2007-07-25 07:08:51 +00:00
# short-description: Starts and stops process accounting
2009-09-16 07:20:45 +00:00
### BEGIN INIT INFO
# Required-Start:
# Required-Stop:
# Provides: psacct
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
2009-09-16 07:20:45 +00:00
# Description: Starts and stops process accounting
# Short-Description: Starts and stops process accounting
### END INIT INFO
auto-import changelog data from psacct-6.3.2-18.src.rpm Tue Mar 26 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-18 - Fixed duh in initscript pointing to wrong accounting file (#61939) Sun Mar 17 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-17 - Removed the files usracct and savacct, which are not used by psacct utilities at all, but by the sa program. Our sa uses files in a different location, and so these files are unused and unnecessary. Sat Mar 16 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-16 - Added chkconfig to post and preun scripts for bug (#61191) Tue Mar 12 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-15 - Added new feature - psacct initscript now controls process accounting so that it is not just forced on if installed as was the previous behaviour - Modified the initscripts package to not force psacct on anymore and made the new psacct-6.3.2-15 conflict with previous initscripts packages. - Fixed logrotate config to set perms/owner of new log files, and closed bug (#54165) Thu Mar 07 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-14 - Fixed 64bit bug in calls to ctime() in lastcomm and dump-utmp (#60712) Wed Mar 06 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-13 - Removed Build_7x flag, added FHS_compliant flag, reworked specfile to use new flag, and fixed bug (#60716) Thu Feb 28 2002 Bill Nottingham <notting@redhat.com> 6.3.2-12 - rebuild in new environment for FHS correctness Thu Jan 31 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-11 - Conditionalized acct-6.3.2-config.patch to only be applied for RHL 7.x builds, as it breaks FHS compliance by putting files in nonstandard locations. Also fixed up other places in specfile for FHS 2.2. - Added acct-6.3.2-I-HATE-GNU-AUTOCONK.patch because I hate GNU autoconk really really badly. - Bumped to -11 to avoid buildsystem stupidness
2004-09-09 10:47:19 +00:00
# Source function library.
. /etc/init.d/functions
# The location of the accounting file
ACCTFILE=/var/account/pacct
2007-07-25 07:08:51 +00:00
LOCKFILE=/var/lock/subsys/psacct
auto-import changelog data from psacct-6.3.2-18.src.rpm Tue Mar 26 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-18 - Fixed duh in initscript pointing to wrong accounting file (#61939) Sun Mar 17 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-17 - Removed the files usracct and savacct, which are not used by psacct utilities at all, but by the sa program. Our sa uses files in a different location, and so these files are unused and unnecessary. Sat Mar 16 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-16 - Added chkconfig to post and preun scripts for bug (#61191) Tue Mar 12 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-15 - Added new feature - psacct initscript now controls process accounting so that it is not just forced on if installed as was the previous behaviour - Modified the initscripts package to not force psacct on anymore and made the new psacct-6.3.2-15 conflict with previous initscripts packages. - Fixed logrotate config to set perms/owner of new log files, and closed bug (#54165) Thu Mar 07 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-14 - Fixed 64bit bug in calls to ctime() in lastcomm and dump-utmp (#60712) Wed Mar 06 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-13 - Removed Build_7x flag, added FHS_compliant flag, reworked specfile to use new flag, and fixed bug (#60716) Thu Feb 28 2002 Bill Nottingham <notting@redhat.com> 6.3.2-12 - rebuild in new environment for FHS correctness Thu Jan 31 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-11 - Conditionalized acct-6.3.2-config.patch to only be applied for RHL 7.x builds, as it breaks FHS compliance by putting files in nonstandard locations. Also fixed up other places in specfile for FHS 2.2. - Added acct-6.3.2-I-HATE-GNU-AUTOCONK.patch because I hate GNU autoconk really really badly. - Bumped to -11 to avoid buildsystem stupidness
2004-09-09 10:47:19 +00:00
start() {
[ ! -r $ACCTFILE ] && touch $ACCTFILE && chmod 600 $ACCTFILE
2007-07-25 07:08:51 +00:00
if [ -r $ACCTFILE ]; then
action $"Starting process accounting: " /sbin/accton $ACCTFILE
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
touch $LOCKFILE
else
2009-09-16 07:20:45 +00:00
exit 7
2007-07-25 07:08:51 +00:00
fi
else
2009-09-16 07:20:45 +00:00
exit 4
2007-07-25 07:08:51 +00:00
fi
}
stop() {
2007-07-25 07:08:51 +00:00
action $"Shutting down process accounting: " /sbin/accton off
2007-07-25 07:08:51 +00:00
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
rm -f $LOCKFILE
2009-09-16 07:20:45 +00:00
else
exit 1
2007-07-25 07:08:51 +00:00
fi
}
2007-07-25 07:08:51 +00:00
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
auto-import changelog data from psacct-6.3.2-18.src.rpm Tue Mar 26 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-18 - Fixed duh in initscript pointing to wrong accounting file (#61939) Sun Mar 17 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-17 - Removed the files usracct and savacct, which are not used by psacct utilities at all, but by the sa program. Our sa uses files in a different location, and so these files are unused and unnecessary. Sat Mar 16 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-16 - Added chkconfig to post and preun scripts for bug (#61191) Tue Mar 12 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-15 - Added new feature - psacct initscript now controls process accounting so that it is not just forced on if installed as was the previous behaviour - Modified the initscripts package to not force psacct on anymore and made the new psacct-6.3.2-15 conflict with previous initscripts packages. - Fixed logrotate config to set perms/owner of new log files, and closed bug (#54165) Thu Mar 07 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-14 - Fixed 64bit bug in calls to ctime() in lastcomm and dump-utmp (#60712) Wed Mar 06 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-13 - Removed Build_7x flag, added FHS_compliant flag, reworked specfile to use new flag, and fixed bug (#60716) Thu Feb 28 2002 Bill Nottingham <notting@redhat.com> 6.3.2-12 - rebuild in new environment for FHS correctness Thu Jan 31 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-11 - Conditionalized acct-6.3.2-config.patch to only be applied for RHL 7.x builds, as it breaks FHS compliance by putting files in nonstandard locations. Also fixed up other places in specfile for FHS 2.2. - Added acct-6.3.2-I-HATE-GNU-AUTOCONK.patch because I hate GNU autoconk really really badly. - Bumped to -11 to avoid buildsystem stupidness
2004-09-09 10:47:19 +00:00
;;
status)
2007-07-25 07:08:51 +00:00
if [ -e $LOCKFILE ]; then
auto-import changelog data from psacct-6.3.2-18.src.rpm Tue Mar 26 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-18 - Fixed duh in initscript pointing to wrong accounting file (#61939) Sun Mar 17 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-17 - Removed the files usracct and savacct, which are not used by psacct utilities at all, but by the sa program. Our sa uses files in a different location, and so these files are unused and unnecessary. Sat Mar 16 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-16 - Added chkconfig to post and preun scripts for bug (#61191) Tue Mar 12 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-15 - Added new feature - psacct initscript now controls process accounting so that it is not just forced on if installed as was the previous behaviour - Modified the initscripts package to not force psacct on anymore and made the new psacct-6.3.2-15 conflict with previous initscripts packages. - Fixed logrotate config to set perms/owner of new log files, and closed bug (#54165) Thu Mar 07 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-14 - Fixed 64bit bug in calls to ctime() in lastcomm and dump-utmp (#60712) Wed Mar 06 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-13 - Removed Build_7x flag, added FHS_compliant flag, reworked specfile to use new flag, and fixed bug (#60716) Thu Feb 28 2002 Bill Nottingham <notting@redhat.com> 6.3.2-12 - rebuild in new environment for FHS correctness Thu Jan 31 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-11 - Conditionalized acct-6.3.2-config.patch to only be applied for RHL 7.x builds, as it breaks FHS compliance by putting files in nonstandard locations. Also fixed up other places in specfile for FHS 2.2. - Added acct-6.3.2-I-HATE-GNU-AUTOCONK.patch because I hate GNU autoconk really really badly. - Bumped to -11 to avoid buildsystem stupidness
2004-09-09 10:47:19 +00:00
echo $"Process accounting is enabled."
else
echo $"Process accounting is disabled."
2007-07-25 07:30:12 +00:00
exit 3
auto-import changelog data from psacct-6.3.2-18.src.rpm Tue Mar 26 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-18 - Fixed duh in initscript pointing to wrong accounting file (#61939) Sun Mar 17 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-17 - Removed the files usracct and savacct, which are not used by psacct utilities at all, but by the sa program. Our sa uses files in a different location, and so these files are unused and unnecessary. Sat Mar 16 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-16 - Added chkconfig to post and preun scripts for bug (#61191) Tue Mar 12 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-15 - Added new feature - psacct initscript now controls process accounting so that it is not just forced on if installed as was the previous behaviour - Modified the initscripts package to not force psacct on anymore and made the new psacct-6.3.2-15 conflict with previous initscripts packages. - Fixed logrotate config to set perms/owner of new log files, and closed bug (#54165) Thu Mar 07 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-14 - Fixed 64bit bug in calls to ctime() in lastcomm and dump-utmp (#60712) Wed Mar 06 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-13 - Removed Build_7x flag, added FHS_compliant flag, reworked specfile to use new flag, and fixed bug (#60716) Thu Feb 28 2002 Bill Nottingham <notting@redhat.com> 6.3.2-12 - rebuild in new environment for FHS correctness Thu Jan 31 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-11 - Conditionalized acct-6.3.2-config.patch to only be applied for RHL 7.x builds, as it breaks FHS compliance by putting files in nonstandard locations. Also fixed up other places in specfile for FHS 2.2. - Added acct-6.3.2-I-HATE-GNU-AUTOCONK.patch because I hate GNU autoconk really really badly. - Bumped to -11 to avoid buildsystem stupidness
2004-09-09 10:47:19 +00:00
fi
;;
restart|reload|force-reload)
auto-import changelog data from psacct-6.3.2-18.src.rpm Tue Mar 26 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-18 - Fixed duh in initscript pointing to wrong accounting file (#61939) Sun Mar 17 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-17 - Removed the files usracct and savacct, which are not used by psacct utilities at all, but by the sa program. Our sa uses files in a different location, and so these files are unused and unnecessary. Sat Mar 16 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-16 - Added chkconfig to post and preun scripts for bug (#61191) Tue Mar 12 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-15 - Added new feature - psacct initscript now controls process accounting so that it is not just forced on if installed as was the previous behaviour - Modified the initscripts package to not force psacct on anymore and made the new psacct-6.3.2-15 conflict with previous initscripts packages. - Fixed logrotate config to set perms/owner of new log files, and closed bug (#54165) Thu Mar 07 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-14 - Fixed 64bit bug in calls to ctime() in lastcomm and dump-utmp (#60712) Wed Mar 06 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-13 - Removed Build_7x flag, added FHS_compliant flag, reworked specfile to use new flag, and fixed bug (#60716) Thu Feb 28 2002 Bill Nottingham <notting@redhat.com> 6.3.2-12 - rebuild in new environment for FHS correctness Thu Jan 31 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-11 - Conditionalized acct-6.3.2-config.patch to only be applied for RHL 7.x builds, as it breaks FHS compliance by putting files in nonstandard locations. Also fixed up other places in specfile for FHS 2.2. - Added acct-6.3.2-I-HATE-GNU-AUTOCONK.patch because I hate GNU autoconk really really badly. - Bumped to -11 to avoid buildsystem stupidness
2004-09-09 10:47:19 +00:00
stop
start
;;
*)
# do not advertise unreasonable commands that there is no reason
# to use with this device
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload}"
2009-09-16 07:20:45 +00:00
exit 2
auto-import changelog data from psacct-6.3.2-18.src.rpm Tue Mar 26 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-18 - Fixed duh in initscript pointing to wrong accounting file (#61939) Sun Mar 17 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-17 - Removed the files usracct and savacct, which are not used by psacct utilities at all, but by the sa program. Our sa uses files in a different location, and so these files are unused and unnecessary. Sat Mar 16 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-16 - Added chkconfig to post and preun scripts for bug (#61191) Tue Mar 12 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-15 - Added new feature - psacct initscript now controls process accounting so that it is not just forced on if installed as was the previous behaviour - Modified the initscripts package to not force psacct on anymore and made the new psacct-6.3.2-15 conflict with previous initscripts packages. - Fixed logrotate config to set perms/owner of new log files, and closed bug (#54165) Thu Mar 07 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-14 - Fixed 64bit bug in calls to ctime() in lastcomm and dump-utmp (#60712) Wed Mar 06 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-13 - Removed Build_7x flag, added FHS_compliant flag, reworked specfile to use new flag, and fixed bug (#60716) Thu Feb 28 2002 Bill Nottingham <notting@redhat.com> 6.3.2-12 - rebuild in new environment for FHS correctness Thu Jan 31 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-11 - Conditionalized acct-6.3.2-config.patch to only be applied for RHL 7.x builds, as it breaks FHS compliance by putting files in nonstandard locations. Also fixed up other places in specfile for FHS 2.2. - Added acct-6.3.2-I-HATE-GNU-AUTOCONK.patch because I hate GNU autoconk really really badly. - Bumped to -11 to avoid buildsystem stupidness
2004-09-09 10:47:19 +00:00
esac
exit 0