File: gridengine-master.postinst

package info (click to toggle)
gridengine 8.1.9%2Bdfsg-13.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 57,140 kB
  • sloc: ansic: 432,689; java: 87,068; cpp: 31,958; sh: 29,445; jsp: 7,757; perl: 6,336; xml: 5,828; makefile: 4,704; csh: 3,934; ruby: 2,221; tcl: 1,676; lisp: 669; yacc: 519; python: 503; lex: 361; javascript: 200
file content (57 lines) | stat: -rwxr-xr-x 1,254 bytes parent folder | download | duplicates (6)
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
#!/bin/sh
# postinst script for gridengine-master
#
# see: dh_installdeb(1)

set -e

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

sgeroot=/var/lib/gridengine
sgespool=/var/spool/gridengine
user=sgeadmin

case "$1" in
  configure)

    # Setup directories on a new install
    if [ -z "$2" ]; then
      for d in ${sgespool}/qmaster \
               ${sgespool}/qmaster/job_scripts \
               ${sgespool}/spooldb
      do
          mkdir -p ${d}
          chown ${user}:${user} ${d}
          chmod 755 ${d}
      done

      # Check that we're meant to install a cluster
      db_get shared/gridengineconfig || true

      if [ "${RET}" = "true" ]; then
          db_get shared/gridenginecell || true
          SGE_CELL="${RET}"
          if [ -z "${SGE_CELL}" ]; then
              SGE_CELL=default
          fi

          # Initialize a default cluster
          su -s /bin/sh -c "/usr/share/gridengine/scripts/init_cluster ${sgeroot} ${SGE_CELL} ${sgespool}/spooldb ${user}" ${user}
      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.

#DEBHELPER#

exit 0