#!/bin/sh # postinst script for lliurex-statistics # # see: dh_installdeb(1) set -e . /usr/share/debconf/confmodule db_get lliurex-statistics/acknowledge ACK="$RET" db_stop # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) if [ -d /var/log/analytics ]; then mv /var/log/analytics /var/log/tmp_analytics_old || true fi if [ -f /etc/audit/auditd.conf ]; then dpkg-divert --package lliurex-statistics --divert /etc/audit/auditd.conf.auditd-orig --rename /etc/audit/auditd.conf [ \! -e /etc/audit/auditd.conf -o -L /etc/audit/auditd.conf ] && ln -f /etc/audit/auditd.analytics /etc/audit/auditd.conf fi if [ -f /lib/systemd/system/auditd.service ]; then sed -i.orig -e 's/#ExecStartPost=-\/sbin\/augenrules --load/ExecStartPost=-\/sbin\/augenrules --load/' /lib/systemd/system/auditd.service fi if [ -f /etc/default/auditd ]; then cp /etc/default/auditd /etc/audit/default.analytics sed -i -e 's/USE_AUGENRULES="no"/USE_AUGENRULES="yes"/g' /etc/audit/default.analytics dpkg-divert --package lliurex-statistics --divert /etc/default/auditd.auditd-orig --rename /etc/default/auditd [ \! -e /etc/default/auditd -o -L /etc/default/auditd ] && ln -f /etc/audit/default.analytics /etc/default/auditd fi update-rc.d auditd defaults 98 update-rc.d analytics defaults 99 /bin/echo -e "-a exit,always -S execve\n" >> /etc/audit/rules.d/analytics.rules touch /etc/lliurex-analytics/status #USELESS INTO SQUASHED FS, LOGIC INTO STARTUP SERVICE # 10003 (fixed group into ldap 4 teachers) #echo "setting acl's" #setfacl -m g:10003:rw /etc/lliurex-analytics/status #setfacl -m g:adm:rw /etc/lliurex-analytics/status #getfacl /etc/lliurex-analytics/status # AVOID TO RESTART !! Could block ltsp's chroot builder #service auditd restart #DEBCONF ACKNOWLEDGE="$(echo $ACK|egrep -E -i -o 'true|false')" if [ "$ACKNOWLEDGE" = "true" ]; then echo yes > /etc/lliurex-analytics/status fi if [ "$ACKNOWLEDGE" = "false" ]; then echo no > /etc/lliurex-analytics/status fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0