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

Last change on this file since 2962 was 2962, checked in by mabarracus, 3 years ago

Add debug verbosity
Fixes confirmator logic
Fixes acl's

File size: 2.7 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
9
10# summary of how this script can be called:
11#        * <postinst> `configure' <most-recently-configured-version>
12#        * <old-postinst> `abort-upgrade' <new version>
13#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
14#          <new-version>
15#        * <postinst> `abort-remove'
16#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
17#          <failed-install-package> <version> `removing'
18#          <conflicting-package> <version>
19# for details, see http://www.debian.org/doc/debian-policy/ or
20# the debian-policy package
21
22
23case "$1" in
24    configure)
25            if [ -f /etc/audit/auditd.conf ]; then
26                dpkg-divert --package lliurex-statistics --divert /etc/audit/auditd.conf.auditd-orig --rename /etc/audit/auditd.conf
27                [ \! -e /etc/audit/auditd.conf -o -L /etc/audit/auditd.conf ] && ln -f /etc/audit/auditd.analytics /etc/audit/auditd.conf
28            fi
29           
30            if [ -f /lib/systemd/system/auditd.service ]; then
31                sed -i.orig -e 's/#ExecStartPost=-\/sbin\/augenrules --load/ExecStartPost=-\/sbin\/augenrules --load/' /lib/systemd/system/auditd.service
32            fi
33           
34            if [ -f  /etc/default/auditd ]; then
35                cp /etc/default/auditd /etc/audit/default.analytics
36                sed -i -e 's/USE_AUGENRULES="no"/USE_AUGENRULES="yes"/g' /etc/audit/default.analytics
37           
38                dpkg-divert --package lliurex-statistics --divert /etc/default/auditd.auditd-orig --rename /etc/default/auditd
39                [ \! -e /etc/default/auditd -o -L /etc/default/auditd ] && ln -f /etc/audit/default.analytics /etc/default/auditd
40            fi
41           
42            update-rc.d auditd defaults 98
43            update-rc.d analytics defaults 99
44           
45            if [ "$(arch)" = "x86_64" ];then
46                echo -e "-a exit,always -F arch=b64 -F euid>999 -S execve\n" >> /etc/audit/rules.d/analytics.rules
47            fi
48            echo -e "-a exit,always -F arch=b32 -F euid>999 -S execve\n" >> /etc/audit/rules.d/analytics.rules
49            touch /etc/lliurex-analytics/status
50
51            #USELESS INTO SQUASHED FS, LOGIC INTO STARTUP SERVICE
52            # 10003 (fixed group into ldap 4 teachers)
53            #echo "setting acl's"
54            #setfacl -m g:10003:rw /etc/lliurex-analytics/status
55            #setfacl -m g:adm:rw /etc/lliurex-analytics/status
56            #getfacl /etc/lliurex-analytics/status
57           
58            service auditd restart
59    ;;
60   
61    abort-upgrade|abort-remove|abort-deconfigure)
62    ;;
63
64    *)
65        echo "postinst called with unknown argument \`$1'" >&2
66        exit 1
67    ;;
68esac
69
70# dh_installdeb will replace this with shell code automatically
71# generated by other debhelper scripts.
72
73#DEBHELPER#
74
75exit 0
Note: See TracBrowser for help on using the repository browser.