summaryrefslogtreecommitdiffstats
path: root/main/alpine-baselayout/alpine-baselayout.post-upgrade
blob: 8edfb73d71d63214fffab547a9854b77aa7e8101 (plain)
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
#!/bin/sh

create_vserver_startstop() {
	cat <<__EOF__
#!/bin/sh

# This file is for compatibility
case \${0##*/} in
rcL)
	RUNLEVEL=1 /sbin/rc sysinit || exit 1
	/sbin/rc boot || exit 1
	/sbin/rc \${1:-default}
	exit 0
	;;
rcK)
	/sbin/rc shutdown
	;;
esac

__EOF__
}

# create compat start/stop scripts for vserver guests
if [ "$(/sbin/rc --sys)" = "VSERVER" ]; then
	# create rcL and rcK
	if ! [ -e /etc/init.d/rcL ]; then
		create_vserver_startstop > /etc/init.d/rcL
		chmod +x /etc/init.d/rcL
	fi
	if ! [ -e /etc/init.d/rcK ]; then
		ln -s rcL /etc/init.d/rcK
	fi
fi

exit 0