committing changes in /etc after apt run

Package changes:
+acct 6.6.4-4 amd64
This commit is contained in:
Gitea
2022-07-08 11:32:23 +02:00
parent 9845702ca2
commit 54ee0d3f1c
13 changed files with 219 additions and 0 deletions
+4
View File
@@ -430,6 +430,7 @@ maybe chmod 0644 'cron.d/php'
maybe chmod 0755 'cron.daily' maybe chmod 0755 'cron.daily'
maybe chmod 0644 'cron.daily/.placeholder' maybe chmod 0644 'cron.daily/.placeholder'
maybe chmod 0755 'cron.daily/00logwatch' maybe chmod 0755 'cron.daily/00logwatch'
maybe chmod 0755 'cron.daily/acct'
maybe chmod 0755 'cron.daily/apt-compat' maybe chmod 0755 'cron.daily/apt-compat'
maybe chmod 0755 'cron.daily/apt-show-versions' maybe chmod 0755 'cron.daily/apt-show-versions'
maybe chmod 0755 'cron.daily/chkrootkit' maybe chmod 0755 'cron.daily/chkrootkit'
@@ -446,6 +447,7 @@ maybe chmod 0755 'cron.hourly'
maybe chmod 0644 'cron.hourly/.placeholder' maybe chmod 0644 'cron.hourly/.placeholder'
maybe chmod 0755 'cron.monthly' maybe chmod 0755 'cron.monthly'
maybe chmod 0644 'cron.monthly/.placeholder' maybe chmod 0644 'cron.monthly/.placeholder'
maybe chmod 0755 'cron.monthly/acct'
maybe chmod 0755 'cron.monthly/debsums' maybe chmod 0755 'cron.monthly/debsums'
maybe chmod 0755 'cron.weekly' maybe chmod 0755 'cron.weekly'
maybe chmod 0644 'cron.weekly/.placeholder' maybe chmod 0644 'cron.weekly/.placeholder'
@@ -462,6 +464,7 @@ maybe chmod 0755 'dbus-1/system.d'
maybe chmod 0644 'debconf.conf' maybe chmod 0644 'debconf.conf'
maybe chmod 0644 'debian_version' maybe chmod 0644 'debian_version'
maybe chmod 0755 'default' maybe chmod 0755 'default'
maybe chmod 0644 'default/acct'
maybe chmod 0644 'default/amavisd-snmp-subagent' maybe chmod 0644 'default/amavisd-snmp-subagent'
maybe chmod 0644 'default/console-setup' maybe chmod 0644 'default/console-setup'
maybe chmod 0644 'default/cron' maybe chmod 0644 'default/cron'
@@ -883,6 +886,7 @@ maybe chmod 0644 'hosts'
maybe chmod 0644 'hosts.allow' maybe chmod 0644 'hosts.allow'
maybe chmod 0644 'hosts.deny' maybe chmod 0644 'hosts.deny'
maybe chmod 0755 'init.d' maybe chmod 0755 'init.d'
maybe chmod 0755 'init.d/acct'
maybe chmod 0755 'init.d/amavis' maybe chmod 0755 'init.d/amavis'
maybe chmod 0755 'init.d/amavis-mc' maybe chmod 0755 'init.d/amavis-mc'
maybe chmod 0755 'init.d/amavisd-snmp-subagent' maybe chmod 0755 'init.d/amavisd-snmp-subagent'
+28
View File
@@ -0,0 +1,28 @@
#!/bin/sh
test -x /usr/sbin/accton || exit 0
# Source defaults
if [ -f /etc/default/acct ]
then
. /etc/default/acct
else
ACCT_LOGGING="30"
fi
# Save log file
if [ ! -d /var/log/account ]; then
mkdir -p /var/log/account
touch /var/log/account/pacct
chmod 0640 /var/log/account/pacct*
chown root:adm /var/log/account/pacct*
fi
cd /var/log/account
savelog -g adm -m 0640 -u root -c "${ACCT_LOGGING}" /var/log/account/pacct > /dev/null
# Restart acct
invoke-rc.d acct restart > /dev/null
# This is needed because accton.c returns errno
exit 0
+61
View File
@@ -0,0 +1,61 @@
#!/bin/sh
#
# cron script to perform monthly login accounting.
#
# Written by Ian A. Murdock <imurdock@gnu.ai.mit.edu>
# Modified by Dirk Eddelbuettel <edd@debian.org>
# Modified by Tero Tilus <terotil@www.haapavesi.fi>
# Patch adopted by Christian Perrier <bubulle@debian.org> for #187538
# Modified by Marcos Fouces <marcos@debian.org>
# Since logrotate mantainer defined the rotation of wtmp file when it
# reach the size of 1 MB instead of doing it monthly, we also need to
# check rotated wtmp files in order to have all the records.
test -x /usr/sbin/accton || exit 0
echo "####################################################################" > /var/log/wtmp.report
echo "################# LOGIN ACCOUNTING MONTHLY REPORT ##################" >> /var/log/wtmp.report
echo "####################################################################" >> /var/log/wtmp.report
echo >> /var/log/wtmp.report
echo "Login accounting for the month ended `date`:" >> /var/log/wtmp.report
echo >> /var/log/wtmp.report
# Check the existence of wtmp.1 or wtmp.1.gz before trying to process them.
# In a recently installed system none of them should exist and thereby
# cron job gives an error. Check (#864242)
# The script process the content of wtmp.1 or wtmp.1.gz (if one of them exists)
# and also the data from current wtmp.
if test -f /var/log/wtmp.1 || test -f /var/log/wtmp.1.gz; then
if [ -f /var/log/wtmp.1 ]
then
WTMP="/var/log/wtmp.1"
elif [ -f /var/log/wtmp.1.gz ]
then
WTMP_WAS_GZIPPED="1"
WTMP="`tempfile`"
gunzip -c /var/log/wtmp.1.gz > "${WTMP}"
fi
echo "Data contained in rotated wtmp file." >> /var/log/wtmp.report
echo >> /var/log/wtmp.report
ac -f "${WTMP}" -p | sort -nr -k2 >> /var/log/wtmp.report
echo >> /var/log/wtmp.report
last -f "${WTMP}" >> /var/log/wtmp.report
if [ -n "${WTMP_WAS_GZIPPED}" ]
then
# remove temporary file
rm -f "${WTMP}"
fi
fi
echo "Data contained in current wtmp file:" >> /var/log/wtmp.report
ac -p | sort -nr -k2 >> /var/log/wtmp.report
echo >> /var/log/wtmp.report
last >> /var/log/wtmp.report
chown root:adm /var/log/wtmp.report
chmod 640 /var/log/wtmp.report
+9
View File
@@ -0,0 +1,9 @@
# Defaults for acct
# If you want to keep acct installed, but not started automatically, set this
# variable to 0. Because /etc/cron.daily/acct calls the initscript daily, it is
# not sufficient to stop acct once after booting if your machine remains up.
ACCT_ENABLE="1"
# Amount of days that the logs are kept.
ACCT_LOGGING="30"
Executable
+109
View File
@@ -0,0 +1,109 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: acct
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: process and login accounting
# Description: GNU Accounting Utilities is a set of utilities which
# reports and summarizes data about user connect times and
# process execution statistics.
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/accton
NAME=acct
DESC="process accounting"
LOCKFILE=/var/lock/subsys/acct
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
# Include acct defaults if available
if [ -f /etc/default/acct ]
then
. /etc/default/acct
else
ACCT_ENABLE="1"
ACCT_LOGGING="30"
fi
set -e
case "$1" in
start)
if [ "${ACCT_ENABLE}" = "1" ]
then
# Have to turn this on to be able to test the return code
set +e
/usr/sbin/accton /var/log/account/pacct 2>/dev/null
rv=$?
if [ $rv -eq 0 ]
then
touch $LOCKFILE
log_success_msg "Done."
elif [ $rv -eq 38 ]
then
log_failure_msg "Failed."
log_warning_msg "Process accounting not available on this system."
elif [ $rv -eq 16 ]
then
log_failure_msg "Failed."
log_warning_msg "Process accounting already running on this system."
else
logger -p daemon.err "Unexpected error code $rv received in /etc/init.d/acct"
fi
fi
set -e
;;
stop)
# Have to turn this on to be able to test the return code
set +e
/usr/sbin/accton off 2>/dev/null
if [ $? -eq 0 ]
then
log_success_msg "Done."
rm -f $LOCKFILE
else
log_failure_msg "Failed."
log_warning_msg "Process accounting not available on this system."
fi
set -e
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
status)
if [ -f $LOCKFILE ]
then
echo "Accounting is enabled."
else
echo "Accounting is not enabled."
fi
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
+1
View File
@@ -0,0 +1 @@
../init.d/acct
+1
View File
@@ -0,0 +1 @@
../init.d/acct
+1
View File
@@ -0,0 +1 @@
../init.d/acct
+1
View File
@@ -0,0 +1 @@
../init.d/acct
+1
View File
@@ -0,0 +1 @@
../init.d/acct
+1
View File
@@ -0,0 +1 @@
../init.d/acct
+1
View File
@@ -0,0 +1 @@
../init.d/acct
+1
View File
@@ -0,0 +1 @@
/lib/systemd/system/acct.service