Created
April 25, 2017 21:35
-
-
Save cjohnson496/9dd2b3fa8be80ce1050491ed3552e667 to your computer and use it in GitHub Desktop.
Function to stop services, useful when chrooting to tmpfs for / filesystem resize, etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stop_services() { | |
echo "Stopping services, it's probably safe to ignore any errors..." | |
for service in `chkconfig -list | awk '{print$1}' | grep -v ':\|ssh\syslog\|network\|mdadm\|dbus\|cron\|ccproc\|dnsmasq\|kbd'`; do | |
chkconfig $service off | |
/etc/init.d/$service stop | |
echo -n "Disabling and Stoping $service" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment