File: nordugrid-arc-egiis.postinst

package info (click to toggle)
nordugrid-arc 5.3.0~rc1-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 31,596 kB
  • ctags: 19,499
  • sloc: cpp: 158,800; sh: 18,759; perl: 15,799; php: 15,352; python: 4,093; makefile: 3,931; ansic: 1,064; xml: 352; java: 238; sed: 30
file content (43 lines) | stat: -rw-r--r-- 1,262 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh

set -e

if [ "$1" = "configure" ] ; then
    APP_PROFILE=/etc/apparmor.d/usr.sbin.slapd
    LOCAL_APP_PROFILE=/etc/apparmor.d/local/usr.sbin.slapd

    if [ ! -r "$LOCAL_APP_PROFILE" ] ; then
	# Create the local profile if it does not yet exist
        tmp=`mktemp`
        cat <<EOM > "$tmp"
# Site-specific additions and overrides for usr.sbin.slapd.
# For more details, please see /etc/apparmor.d/local/README.
EOM
        mkdir -p `dirname $LOCAL_APP_PROFILE` 2>/dev/null || true
        mv -f "$tmp" "$LOCAL_APP_PROFILE"
        chmod 644 "$LOCAL_APP_PROFILE"
    fi

    grep -q "AppArmor profile for NorduGrid ARC EGIIS" "$LOCAL_APP_PROFILE" || \
    cat <<EOM >> "$LOCAL_APP_PROFILE"
# AppArmor profile for NorduGrid ARC EGIIS START
  #include <abstractions/p11-kit>
  /etc/bdii/* r,
  /usr/share/arc/ldap-schema/* r,
  /{,var/}run/arc/infosys/bdii-slapd.conf r,
  /{,var/}run/arc/infosys/giis-fifo wk,
  /usr/lib/arc/arc-infoindex-slapd-wrapper.so rm,
  /usr/sbin/arc-infoindex-relay ix,
  /tmp/* rwk,
# AppArmor profile for NorduGrid ARC EGIIS END
EOM

    if [ -r "$APP_PROFILE" ] ; then
	# Reload the profile
	if aa-status --enabled 2>/dev/null ; then
            apparmor_parser -r -T -W "$APP_PROFILE" || true
	fi
    fi
fi

#DEBHELPER#