This file is indexed.

postinst is in nis 3.17-34ubuntu3.

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
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#! /bin/sh
#
# postinst	NIS suite postinst script.
#		configures the nis stuff.
#
# Version:	nis.postinst  3.9  28-Jun-2001  miquels
#

# Install the defaults file if needed, and update the NISSERVER
# setting if the preinst left a settings file behind.
config_transition1 () {
	# Transition from /etc/init.d/nis config to /etc/default/nis
	[ ! -s /etc/default/nis ] || return 0
	NISSERVER=false
	if [ -f /etc/default/nis.settings ]
	then
		. /etc/default/nis.settings
	fi
	sed -e 's/^\(NISSERVER\)=.*$/\1='"$NISSERVER/" \
		< /usr/share/nis/nis.default > /etc/default/nis
	rm -f /etc/default/nis.settings
}

config_transition2 () {
	# Transition to /etc/default/nis being a conffile
	# Without this the file would be reset to its defaults on upgrade
	# Later transitions can drop this section as it will be a proper
	# conffile from now on.
	if [ -s /etc/default/nis.conffile ]
	then
		mv /etc/default/nis.conffile /etc/default/nis
	fi
}

install_defaults () {
	config_transition1
	config_transition2
}

set -e
umask 022

for conffile in ypbind.conf start-ypbind.conf ypserv.conf yppasswdd.conf \
                ypxfrd.conf
do
	dpkg-maintscript-helper rm_conffile /etc/init/"${conffile}" 3.17-34ubuntu3~ \
	                        nis -- "$@"
done

case "$1" in
	configure)
		;;
	abort-upgrade|abort-remove|abort-deconfigure)
		#
		#	Oops - restart NIS anyway.
		#
		if [ -x /etc/init.d/nis ] ; then
			if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
				invoke-rc.d nis start
			else
				/etc/init.d/nis start
			fi
		fi
		exit 0
		;;
	*)
		exit 0
		;;
esac

# Source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0 || { echo "nis.config: need DebConf 2.0 or later"; exit 1; }

cd /etc/init.d
if [ -f nis ]; then
	chmod 755 nis
fi
install_defaults

. /etc/default/nis

# Retrieve the domain from Debconf and set it.
db_get nis/domain || true
if [ "$RET" != "" ]
then
	echo $RET > /etc/defaultdomain
fi

# Update the links for nis.
if [ -L /etc/rc2.d/S30nis ]
then
	rm -f /etc/rc?.d/[SK]30nis
fi
# The user may have decided to remove the init script...
if [ -x /etc/init.d/nis ]; then
	update-rc.d nis start 18 2 3 4 5 . stop 18 1 . >/dev/null 2>&1
fi

# Convert the old ypserv.conf to the new format.
if [ -f /etc/ypserv.conf ]
then
	/usr/lib/yp/convert-ypserv-conf /etc/ypserv.conf
fi

# And start the service.
if [ "$2" != "" -a "$2" != "<>" ] && dpkg --compare-versions "$2" le 3.9-1
then
	killall ypbind >/dev/null 2>&1 || true
fi

# Halt debconf so we don't leave the control fd open to the daemon
db_stop

# The user may have decided to remove the init script...
if [ -x /etc/init.d/nis ]; then
	invoke-rc.d nis restart

	# Remove shutdown and reboot links; this init script does not need them.
	if dpkg --compare-versions "$2" lt "3.17-18"; then
		rm -f /etc/rc0.d/K18nis /etc/rc6.d/K18nis
	fi
fi

# /sbin/unix_chkpwd is installed setgid shadow by default; for NIS we need
# setuid root. (See #155583)
if ! dpkg-statoverride --list /sbin/unix_chkpwd >/dev/null; then
    dpkg-statoverride --update --add root root 4755 /sbin/unix_chkpwd
fi

exit 0