Sophie

Sophie

distrib > PLD > ac > amd64 > by-pkgid > cfba13584a01b0fae69626dd9cebb011 > scriptlet

inn-2.4.1-2.amd64.rpm

PREUN

/bin/sh
if [ "$1" = "0" ]; then
	if [ -f /var/lock/subsys/news ]; then
		/etc/rc.d/init.d/inn stop
	fi
	/sbin/chkconfig --del inn
fi

POSTIN

/bin/sh
if [ "`getent passwd http | cut -d: -f6`" = "/var/spool/news" ]; then
	/usr/sbin/usermod -d /home/services/news news
fi
umask 022
if [ -f /var/lib/news/history ]; then
	cd /var/lib/news
	/usr/bin/makedbz -s `wc -l <history` -f history
	for i in dir hash index pag; do
		[ -f history.n.$i ] && mv history.n.$i history.$i
	done
	chown news:news history.*
	chmod 644 history.*
else
	cd /var/lib/news
	/usr/bin/makehistory
	/usr/bin/makedbz -s `wc -l <history` -f history
	for i in dir hash index pag; do
		[ -f history.n.$i ] && mv history.n.$i history.$i
	done
	chown news:news history history.*
	chmod 644 history history.*
fi
[ -f /var/lib/news/active.times ] || {
	touch /var/lib/news/active.times
	chown news:news /var/lib/news/active.times
}

[ -f /var/log/news/news.notice ] || {
	touch /var/log/news/news.notice
	chown news:news /var/log/news/news.notice
	chmod 664 /var/log/news/news.notice
}

[ -f /var/log/news/news.crit ] || {
	touch /var/log/news/news.crit
	chown news:news /var/log/news/news.crit
	chmod 660 /var/log/news/news.crit
}

[ -f /var/log/news/news.err ] || {
	touch /var/log/news/news.err
	chown news:news /var/log/news/news.err
	chmod 660 /var/log/news/news.err
}

[ -f /var/lib/news/.news.daily ] || {
	touch /var/lib/news/.news.daily
	chown news:news /var/lib/news/.news.daily
	chmod 664 /var/lib/news/.news.daily
}

umask 027
if [ -f /etc/syslog.conf ]; then
  if ! grep -q INN /etc/syslog.conf; then
    sed -i 's/mail.none;/mail.none;news.none;/' /etc/syslog.conf
    echo ''										>> /etc/syslog.conf
    echo '#'										>> /etc/syslog.conf
    echo '# INN'									>> /etc/syslog.conf
    echo '#' 										>> /etc/syslog.conf
    echo 'news.=crit                                        /var/log/news/news.crit'	>> /etc/syslog.conf
    echo 'news.=err                                         /var/log/news/news.err'	>> /etc/syslog.conf
    echo 'news.notice                                       /var/log/news/news.notice'	>> /etc/syslog.conf
    fi
  if [ -f /var/run/syslog.pid ]; then
    kill -HUP `cat /var/run/syslog.pid` 2> /dev/null ||:
  fi
else
    # syslog.conf does not exist
    echo "mail.none /var/log/messages" 							> /etc/syslog.conf.inn
    echo "" 										>> /etc/syslog.conf.inn
    echo "# INN" 									>> /etc/syslog.conf.inn
    echo "news.=crit                                      /var/log/news/news.crit"	>> /etc/syslog.conf.inn
    echo "news.=err                                       /var/log/news/news.err"	>> /etc/syslog.conf.inn
    echo "news.notice                                     /var/log/news/news.notice"	>> /etc/syslog.conf.inn
fi

/sbin/chkconfig --add inn
if [ -f /var/lock/subsys/inn ]; then
	/etc/rc.d/init.d/inn restart >&2
else
	echo "Run \"/etc/rc.d/init.d/inn start\" to start inn news server." >&2
fi

Triggers

inn < 2.4.0

/bin/sh
cp -af /etc/news/inn.conf{,.rpmorig}
sed -e 's/^\(listenonipv6\)/#\1/;s/^bindipv6address/bindaddress6/;s/^sourceipv6address/sourceaddress6/' \
	/etc/news/inn.conf.rpmorig > /etc/news/inn.conf