HEX
Server: nginx/1.18.0
System: Linux hqnl0246134.online-vm.com 5.4.0-135-generic #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022 x86_64
User: www-data (33)
PHP: 7.4.33
Disabled: phpinfo,disk_free_space,disk_total_space,diskfreespace,dl,exec,opcache_get_configuration,opcache_get_status,passthru,pclose,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_waitpid,pcntl_wait,pcntl_wexitstatus,pcntl_wifcontinued,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,popen,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,posix_uname,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,show_source,system,exec,passthru,shell_exec,system,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
Upload Files
File: /var/lib/dpkg/info/atop.postinst
#!/bin/bash

set -e

case "$1" in
    configure)
        LOGDIR="/var/log/atop"
        touch $LOGDIR/dummy_after $LOGDIR/dummy_before
        # check whether atop will read its own latest file
        # point atop to the latest file and check for output on stdout
        # the pipe will prevent atop from going interactive, and if it
        # won't read the file, stdout will be empty.
        LATESTFILE="$(ls -t $LOGDIR/atop_* | head -n 1)"
        if [ -n "$LATESTFILE" ]; then
            if ! atop -r $LATESTFILE 2>/dev/null | head -n 5 | grep -q '.'; then
                # updating from an older version which won't read
                # the old log file format
                # take a backup of the old file and convert it
                mv ${LATESTFILE} ${LATESTFILE}_oldformat
                if [ -e "${LATESTFILE}_oldformat" ]; then
                    atopconvert ${LATESTFILE}_oldformat ${LATESTFILE} >/dev/null
                    if ! atop -r $LATESTFILE 2>/dev/null | head -n 5 | grep -q '.'; then
                        # we still have an error
                        echo >&2 "atop postinst: error converting ${LATESTFILE} to new atop raw file format"
                        exit 1
                    fi
                else
                    # unable to take backup of file
                    echo >&2 "atop postinst: error backing up ${LATESTFILE} for conversion to new atop raw file format"
                    exit 1
                fi
            fi
        fi
    ;;
esac

# Automatically added by dh_systemd_enable/12ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	# This will only remove masks created by d-s-h on package removal.
	deb-systemd-helper unmask 'atop.service' >/dev/null || true

	# was-enabled defaults to true, so new installations run enable.
	if deb-systemd-helper --quiet was-enabled 'atop.service'; then
		# Enables the unit on first installation, creates new
		# symlinks on upgrades if the unit file has changed.
		deb-systemd-helper enable 'atop.service' >/dev/null || true
	else
		# Update the statefile to add new symlinks (if any), which need to be
		# cleaned up on purge. Also remove old symlinks.
		deb-systemd-helper update-state 'atop.service' >/dev/null || true
	fi
fi
# End automatically added section
# Automatically added by dh_systemd_enable/12ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	# This will only remove masks created by d-s-h on package removal.
	deb-systemd-helper unmask 'atopacct.service' >/dev/null || true

	# was-enabled defaults to true, so new installations run enable.
	if deb-systemd-helper --quiet was-enabled 'atopacct.service'; then
		# Enables the unit on first installation, creates new
		# symlinks on upgrades if the unit file has changed.
		deb-systemd-helper enable 'atopacct.service' >/dev/null || true
	else
		# Update the statefile to add new symlinks (if any), which need to be
		# cleaned up on purge. Also remove old symlinks.
		deb-systemd-helper update-state 'atopacct.service' >/dev/null || true
	fi
fi
# End automatically added section
# Automatically added by dh_installdeb/12ubuntu1
dpkg-maintscript-helper rm_conffile /etc/logrotate.d/atop 1.26-2\~ -- "$@"
# End automatically added section
# Automatically added by dh_installinit/12ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	if [ -x "/etc/init.d/atop" ]; then
		update-rc.d atop defaults >/dev/null
		if [ -n "$2" ]; then
			_dh_action=restart
		else
			_dh_action=start
		fi
		invoke-rc.d atop $_dh_action || exit 1
	fi
fi
# End automatically added section
# Automatically added by dh_installinit/12ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	if [ -x "/etc/init.d/atopacct" ]; then
		update-rc.d atopacct defaults >/dev/null
		if [ -n "$2" ]; then
			_dh_action=restart
		else
			_dh_action=start
		fi
		invoke-rc.d atopacct $_dh_action || exit 1
	fi
fi
# End automatically added section


# vim: tabstop=4 expandtab