File: bootlogd.postinst

package info (click to toggle)
sysvinit 3.15-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,900 kB
  • sloc: ansic: 8,530; sh: 3,827; makefile: 351
file content (33 lines) | stat: -rw-r--r-- 759 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
#!/bin/sh
set -e

INITSCRIPTS="bootlogd stop-bootlogd-single stop-bootlogd"

for F in $INITSCRIPTS; do
	if [ -x /etc/init.d/$F ]; then
		update-rc.d $F defaults >/dev/null || exit $?
	fi
done

mkdir -p /etc/systemd/system
for F in $INITSCRIPTS; do
	SERVICE="$(basename $F .sh).service"
	if [ -x /etc/init.d/$F ] && [ ! -e /etc/systemd/system/$SERVICE ]; then
		ln -s /dev/null /etc/systemd/system/$SERVICE
	fi
done

#
# Create initial log files
#
for F in /var/log/boot
do
	if [ ! -f "$F" ] && touch "$F" >/dev/null 2>&1
	then
		echo "(Nothing has been logged yet. If you're still seeing this message your current init system might not write bootup messages to the system console at all.)" >| "$F"
		chown root:adm "$F"
		chmod 640 "$F"
	fi
done

#DEBHELPER#