Skip to content

Commit

Permalink
Check if Presto is running before erasing RPM
Browse files Browse the repository at this point in the history
According to:
http://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/iniscrptact.html
when service is correctly stopped it returns 3.
  • Loading branch information
kokosing committed Jan 29, 2019
1 parent 5368334 commit d13fbf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions presto-server-rpm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<architecture>x86_64</architecture>
<preInstallScriptFile>src/main/rpm/preinstall</preInstallScriptFile>
<postInstallScriptFile>src/main/rpm/postinstall</postInstallScriptFile>
<preUninstallScriptFile>src/main/rpm/preremove</preUninstallScriptFile>
<postUninstallScriptFile>src/main/rpm/postremove</postUninstallScriptFile>

<dependencies>
Expand Down
5 changes: 5 additions & 0 deletions presto-server-rpm/src/main/rpm/preremove
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/etc/init.d/presto status > /dev/null 2>&1
if [[ $? != 3 ]]; then
echo "Please stop the Presto service before erasing RPM"
exit 1
fi

0 comments on commit d13fbf9

Please sign in to comment.