1 Star 0 Fork 0

lurenchina/atop

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
atopacct.rc.openrc 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
#!/sbin/openrc-run
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
description="Resource-specific view of processes"
command="/usr/sbin/atopacctd"
lockfile="/var/lock/subsys/atopacctd"
start_pre() {
# Check if process accounting already in use via psacct
for PACCTFILE in /var/account/pacct /var/log/pacct ; do
if [ -f "${PACCTFILE}" ] ; then
BEFORSIZE=$(stat -c %s "${PACCTFILE}")
AFTERSIZE=$(stat -c %s "${PACCTFILE}")
# verify if accounting file grows, so is in use
if [ ${BEFORSIZE} -lt ${AFTERSIZE} ] ; then
ewarn "Process accounting already used by psacct!"
return 1
fi
fi
done
checkpath -d -q ${lockfile%/*} || return 1
}
start() {
ebegin "Starting atopacctd"
start-stop-daemon --start --exec ${command}
touch ${lockfile}
eend $?
}
stop() {
ebegin "Stopping atopacctd"
start-stop-daemon --stop --exec ${command}
rm ${lockfile}
eend $?
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lurenchina/atop.git
git@gitee.com:lurenchina/atop.git
lurenchina
atop
atop
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385