Skip to content

Commit

Permalink
Merge pull request #539 from dwhjames/fix/rpm-preun-stopservice
Browse files Browse the repository at this point in the history
make use of stopService loader function in rpm preun template
  • Loading branch information
muuki88 committed Mar 29, 2015
2 parents f60e1a4 + e557803 commit c85254c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
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

}

0 comments on commit c85254c

Please sign in to comment.