This file is indexed.

postinst is in opennebula 3.2.1-2.

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
#!/bin/sh

set -e

ONEHOME=/var/lib/one
ONEAUTH=$ONEHOME/.one/one_auth
ONE_GROUP=cloud
ONE_USER=oneadmin

if [ "$1" = "configure" ]; then

    # Use dpkg-statoverride instead of direct chmod/chown
    if ! dpkg-statoverride --list /var/log/one >/dev/null 2>&1; then
            dpkg-statoverride --update --add $ONE_USER root 755 /var/log/one
    fi
    if ! dpkg-statoverride --list /var/lib/one/images >/dev/null 2>&1; then
        # sticky bit + setgid
        # http://www.opennebula.org/documentation:rel3.2:oned_conf#image_repository
        dpkg-statoverride --update --add $ONE_USER root 3770 /var/lib/one/images
    fi
    if ! dpkg-statoverride --list /var/lib/one/.one >/dev/null 2>&1; then
            dpkg-statoverride --update --add $ONE_USER $ONE_GROUP 700 /var/lib/one/.one
    fi

    if [ ! -f $ONEAUTH ]; then
        ONE_PASSWORD=`apg -m 12 -M cNl -n 1`
        if [ -n "${ONE_PASSWORD}" ]; then
            echo "${ONE_USER}:${ONE_PASSWORD}" > $ONEAUTH
            chown $ONE_USER:$ONE_GROUP $ONEAUTH
            chmod 600 $ONEAUTH
        fi
    fi
fi

# Automatically added by dh_installinit
if [ -x "/etc/init.d/opennebula" ]; then
	if [ ! -e "/etc/init/opennebula.conf" ]; then
		update-rc.d opennebula defaults >/dev/null
	fi
	invoke-rc.d opennebula start || exit $?
fi
# End automatically added section