source: lliurex-statistics/trunk/fuentes/debian/lliurex-statistics.postinst

Last change on this file was 8232, checked in by mabarracus, 15 months ago

Remove filter for root executable files

File size: 3.0 KB
Line 
1#!/bin/sh
2# postinst script for lliurex-statistics
3#
4# see: dh_installdeb(1)
5
6set -e
7
8. /usr/share/debconf/confmodule
9db_get lliurex-statistics/acknowledge
10ACK="$RET"
11db_stop
12
13# summary of how this script can be called:
14#        * <postinst> `configure' <most-recently-configured-version>
15#        * <old-postinst> `abort-upgrade' <new version>
16#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
17#          <new-version>
18#        * <postinst> `abort-remove'
19#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
20#          <failed-install-package> <version> `removing'
21#          <conflicting-package> <version>
22# for details, see http://www.debian.org/doc/debian-policy/ or
23# the debian-policy package
24
25
26case "$1" in
27    configure)
28            if [ -d /var/log/analytics ]; then
29                mv /var/log/analytics /var/log/tmp_analytics_old || true
30            fi
31            if [ -f /etc/audit/auditd.conf ]; then 
32                dpkg-divert --package lliurex-statistics --divert /etc/audit/auditd.conf.auditd-orig --rename /etc/audit/auditd.conf
33                [ \! -e /etc/audit/auditd.conf -o -L /etc/audit/auditd.conf ] && ln -f /etc/audit/auditd.analytics /etc/audit/auditd.conf
34            fi
35           
36            if [ -f /lib/systemd/system/auditd.service ]; then
37                sed -i.orig -e 's/#ExecStartPost=-\/sbin\/augenrules --load/ExecStartPost=-\/sbin\/augenrules --load/' /lib/systemd/system/auditd.service
38            fi
39           
40            if [ -f  /etc/default/auditd ]; then
41                cp /etc/default/auditd /etc/audit/default.analytics
42                sed -i -e 's/USE_AUGENRULES="no"/USE_AUGENRULES="yes"/g' /etc/audit/default.analytics
43           
44                dpkg-divert --package lliurex-statistics --divert /etc/default/auditd.auditd-orig --rename /etc/default/auditd
45                [ \! -e /etc/default/auditd -o -L /etc/default/auditd ] && ln -f /etc/audit/default.analytics /etc/default/auditd
46            fi
47           
48            update-rc.d auditd defaults 98
49            update-rc.d analytics defaults 99
50           
51            /bin/echo -e "-a exit,always -S execve\n" >> /etc/audit/rules.d/analytics.rules
52            touch /etc/lliurex-analytics/status
53
54            #USELESS INTO SQUASHED FS, LOGIC INTO STARTUP SERVICE
55            # 10003 (fixed group into ldap 4 teachers)
56            #echo "setting acl's"
57            #setfacl -m g:10003:rw /etc/lliurex-analytics/status
58            #setfacl -m g:adm:rw /etc/lliurex-analytics/status
59            #getfacl /etc/lliurex-analytics/status
60           
61            # AVOID TO RESTART !! Could block ltsp's chroot builder
62            #service auditd restart
63           
64            #DEBCONF
65            ACKNOWLEDGE="$(echo $ACK|egrep -E -i -o 'true|false')"
66            if [ "$ACKNOWLEDGE" = "true" ]; then
67                echo yes > /etc/lliurex-analytics/status
68            fi
69            if [ "$ACKNOWLEDGE" = "false" ]; then
70                echo no > /etc/lliurex-analytics/status
71            fi
72    ;;
73   
74    abort-upgrade|abort-remove|abort-deconfigure)
75    ;;
76
77    *)
78        echo "postinst called with unknown argument \`$1'" >&2
79        exit 1
80    ;;
81esac
82
83# dh_installdeb will replace this with shell code automatically
84# generated by other debhelper scripts.
85
86#DEBHELPER#
87
88exit 0
Note: See TracBrowser for help on using the repository browser.