summaryrefslogtreecommitdiff
path: root/helpers/lh_patchrunlevel
blob: 05fa9fb4cb9dd28f1837fd7585bd6c434a517486 (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
#!/bin/sh

# lh_patchrunlevel.sh <action>

# Disabling all init scripts with a blocking policy as in
# /usr/share/doc/sysv-rc/README.policy-rc.d.gz.

case "${1}" in
	apply)
		# Create init policy
		cat  > "${LIVE_CHROOT}"/usr/sbin/policy-rc.d << EOF
#!/bin/sh

echo
echo "Warning: invoke-rc.d policy in action. Skiping daemon starting"

exit 101
EOF

		chmod 0755 "${LIVE_CHROOT}"/usr/sbin/policy-rc.d
		;;

	deapply)
		# Removing init policy
		rm -f "${LIVE_CHROOT}"/usr/sbin/policy-rc.d
		;;
esac