This file is indexed.

postinst is in nis 3.17.1-1build1.

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
#! /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.
install_defaults () {
	[ ! -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
}

set -e
umask 022

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