diff options
Diffstat (limited to 'main/acct/initd')
-rw-r--r-- | main/acct/initd | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/main/acct/initd b/main/acct/initd new file mode 100644 index 00000000000..52cf08dff13 --- /dev/null +++ b/main/acct/initd @@ -0,0 +1,32 @@ +#!/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 $? +} |