aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/killall
blob: 823169e525476aeeebebb32a65c101694c57c1ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

# Bring down all unneeded services that are still running (there shouldn't 
# be any, so this is just a sanity check)

for i in /var/lock/subsys/*; do
	# Check if the script is there.
	[ ! -f $i ] && continue

	# Get the subsystem name.
	subsys=${i#/var/lock/subsys/}

	# Bring the subsystem down.
	if [ -f /etc/init.d/$subsys.init ]; then
	    /etc/init.d/$subsys.init stop
	elif [ -f /etc/init.d/$subsys ]; then
	    /etc/init.d/$subsys stop
	else
	    rm -f $i
	fi
done