This file is indexed.

postinst is in gridengine-common 6.2u5-7.4.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/sh
# postinst script for gridengine-common
#
# see: dh_installdeb(1)

set -e

# Source debconf library
. /usr/share/debconf/confmodule

user=sgeadmin

case "$1" in
  configure)

    # Only create the user if it doesn't exist
    # We can't rely on adduser to do it as a lot of sites stick the
    # sgeadmin user in LDAP or something like that...
    if ! id ${user} >/dev/null 2>&1; then
      adduser --system --no-create-home --quiet \
              --disabled-password --disabled-login \
              --shell /bin/false --group --home /var/lib/gridengine ${user}
    fi

    # Set up the sgeadmin user and basic config on new install
    if [ -z "$2" ]; then
      mkdir -p /var/lib/gridengine

      # Get our debconf answers
      SGE_CELL=default
      db_get shared/gridengineconfig || true
      if [ "${RET}" = "true" ]; then
          # Get Cell name
          db_get shared/gridenginecell || true
          SGE_CELL="${RET}"
          if [ -z "${SGE_CELL}" ]; then
              SGE_CELL=default
          fi
      fi

      for d in /var/lib/gridengine \
               /var/lib/gridengine/${SGE_CELL} \
               /var/lib/gridengine/${SGE_CELL}/common
      do
        mkdir -p ${d}
        chmod 755 ${d}
        chown ${user}:${user} ${d}
      done

      # Copy the default bootstrap file
      install -m0644 -o sgeadmin -g sgeadmin /usr/share/gridengine/default-bootstrap /var/lib/gridengine/${SGE_CELL}/common/bootstrap

      # Copy in the default file having set SGE_CELL and use ucf to install it
      TMPFILE=$(mktemp)
      chown root:root ${TMPFILE}
      chmod 644 ${TMPFILE}
      sed "s@^SGE_CELL=.*@SGE_CELL=${SGE_CELL}@" /usr/share/gridengine/gridengine.default >> ${TMPFILE}
      ucf --debconf-ok ${TMPFILE} /etc/default/gridengine
      rm -f ${TMPFILE}
    else
      # On upgrades, only certain things need to happen

      # From before 6.2-2, we need to fix the stupid chown/chmod bug on /etc/default/gridengine
      if dpkg --compare-versions "$2" lt 6.2-2; then
        chown root:root /etc/default/gridengine
        chmod 644 /etc/default/gridengine
      fi
    fi
  ;;

  *)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 1
  ;;
esac

db_stop || true

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.



exit 0