aports/main/acct/initd
Dermot Bradley a8d72a50d7 main/acct: remove last binary, add init.d script
Remove the last binary from the package - it is provided instead by
util-linux-login package. This fixes issue .
Create openrc subpackage with init script to enable accounting at boot.
Add logrotate configuration file.
Correct the path of the wtmp file.
2022-03-14 17:23:49 +00:00

32 lines
528 B
Text

#!/sbin/openrc-run
description="Enables process accounting."
depend() {
keyword -prefix -lxc -docker
}
: ${acct_dir:=${ACCTDIR:-/var/log/account}}
: ${acct_file:=${ACCTFILE:-pacct}}
start() {
if [ ! -d "$acct_dir" ]; then
mkdir -p $acct_dir
chmod 770 $acct_dir
fi
if [ ! -f "$acct_dir/$acct_file" ]; then
touch $acct_dir/$acct_file
chmod 770 $acct_dir/$acct_file
fi
ebegin "Enabling process accounting"
accton on >/dev/null
eend $?
}
stop() {
ebegin "Disabling process accounting"
accton off
eend $?
}