Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make use of stopService loader function in rpm preun template #539

Merged
merged 1 commit into from
Mar 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
${{loader-functions}}

# Halting ${{app_name}}
echo "Shutdown ${{app_name}}"
service ${{app_name}} stop || echo "Could not stop ${{app_name}}"
stopService ${{app_name}} || echo "Could not stop ${{app_name}}"
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ startService() {
echo "Adding $app_name to autostart using update-rc.d"
update-rc.d $app_name defaults
service $app_name start
elif hash chkconfig 2>/dev/null; then
elif hash chkconfig >/dev/null 2>&1; then
echo "Adding $app_name to autostart using chkconfig"
chkconfig --add ${{app_name}}
chkconfig $app_name on
service $app_name start
else
echo "WARNING: Could not put $app_name in autostart: update-rc and chkconfig or found!"
echo "WARNING: Could not add $app_name to autostart: neither update-rc nor chkconfig found!"
fi
}

Expand All @@ -28,13 +28,13 @@ stopService() {
echo "Removing $app_name from autostart using update-rc.d"
update-rc.d -f $app_name remove
service $app_name stop
elif chkconfig 2>/dev/null; then
elif hash chkconfig >/dev/null 2>&1; then
echo "Removing $app_name from autostart using chkconfig"
chkconfig $app_name off
chkconfig --del $app_name
service $app_name stop
else
echo "WARNING: Could not put $app_name in autostart: update-rc or chkconfig not found!"
echo "WARNING: Could not remove $app_name from autostart: neither update-rc nor chkconfig found!"
fi

}