Skip to content

Commit

Permalink
Merge pull request #70 from OSC/fix-rpm-restart
Browse files Browse the repository at this point in the history
Only restart Apache if changes take place
  • Loading branch information
ericfranz authored Sep 27, 2019
2 parents a817091 + c057519 commit 2a7a04b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ood-portal-generator/sbin/update_ood_portal
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ usage () {
echo "Usage: update_ood_portal [-r|--rpm] [-f|--force] [--detailed-exitcodes]"
echo "-r|--rpm Execution performed during RPM install"
echo "-f|--force Force replacement of configs even if checksums differ"
echo "--detailed-exitcodes Exit with 2 when changes are made and 4 when changes skipped"
echo "--detailed-exitcodes Exit with 3 when changes are made and 4 when changes skipped"
}

OPTS=`getopt -o rfh --long rpm,force,detailed-exitcodes,help -n 'update_ood_portal' -- "$@"`
Expand Down
3 changes: 2 additions & 1 deletion packaging/ondemand.spec
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ touch %{_localstatedir}/www/ood/apps/sys/activejobs/tmp/restart.txt
touch %{_localstatedir}/www/ood/apps/sys/myjobs/tmp/restart.txt

# Rebuild Apache config and restart Apache httpd if config changed
if /opt/ood/ood-portal-generator/sbin/update_ood_portal --rpm ; then
/opt/ood/ood-portal-generator/sbin/update_ood_portal --rpm --detailed-exitcodes
if [[ $? -eq 3 ]] ; then
%if %{with systemd}
/bin/systemctl try-restart httpd24-httpd.service httpd24-htcacheclean.service &>/dev/null || :
%else
Expand Down

0 comments on commit 2a7a04b

Please sign in to comment.