Skip to content

Instantly share code, notes, and snippets.

@larsks
Created March 6, 2014 05:24
Show Gist options
  • Save larsks/9383107 to your computer and use it in GitHub Desktop.
Save larsks/9383107 to your computer and use it in GitHub Desktop.
# First, run the KILL scripts.
for i in /etc/rc$runlevel.d/K* ; do
# Check if the subsystem is already up.
subsys=${i#/etc/rc$runlevel.d/K??}
[ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] || continue
check_runlevel "$i" || continue
# Bring the subsystem down.
[ -n "$UPSTART" ] && initctl emit --quiet stopping JOB=$subsys
$i stop
[ -n "$UPSTART" ] && initctl emit --quiet stopped JOB=$subsys
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment