6 Star 13 Fork 3

Gitee 极速下载 / atop

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/Atoptool/atop
克隆/下载
atopacct.init 1.69 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/sh
#
# atopacctd Startup script for the atopacctd daemon
#
# chkconfig: 2345 91 9
# description: Process accounting control
#
### BEGIN INIT INFO
# Provides: atopacct
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: This daemon switches on process accounting and
# transfers the process accounting records 'realtime'
# to small shadow files to avoid huge disk space usage
# Description: Process accounting control
### END INIT INFO
# Check existance of binaries
[ -f /usr/sbin/atopacctd ] || exit 0
RETVAL=0
# See how we were called.
case "$1" in
start)
# Check if process accounting already in use via separate psacct package
#
for PACCTFILE in /var/account/pacct /var/log/pacct /var/log/account/pacct
do
if [ -f "$PACCTFILE" ] # file exists?
then
BEFORSIZE=$(ls -lL "$PACCTFILE" | awk '{print $5}')
AFTERSIZE=$(ls -lL "$PACCTFILE" | awk '{print $5}')
# verify if accounting file grows, so is in use
#
if [ $BEFORSIZE -lt $AFTERSIZE ]
then
echo Process accounting already used by psacct! >&2
exit $RETVAL # do not start atopacctd
fi
fi
done
# Check if atopacctd runs already
#
if ps -e | grep -q atopacctd$
then
:
else
# Start atopacctd
rm -rf /run/pacct_shadow.d 2> /dev/null
/usr/sbin/atopacctd
fi
touch /var/lock/subsys/atopacctd
;;
stop)
# Check if atopacctd runs
#
if ps -e | grep -q atopacctd$
then
kill $(ps -e | grep atopacctd$ | sed 's/^ *//' | cut -d' ' -f1)
fi
rm -f /var/lock/subsys/atopacctd
;;
status)
;;
reload)
;;
restart)
;;
*)
echo "Usage: $0 [start|stop]"
exit 1
esac
exit $RETVAL
C
1
https://gitee.com/mirrors/atop.git
git@gitee.com:mirrors/atop.git
mirrors
atop
atop
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891