change in conditional-restart.sh

2014-12-08 Thread Miroslav Suchý

Hi,
today I run groups/copr-backend.yml playbook and fedmsg/base notified "restart 
httpd". Which failed because
httpd is there installed, but not enabled (it is there just as requirement of 
webalizer).
So I'm thinking about change (after freeze):
diff --git a/roles/base/files/common-scripts/conditional-restart.sh 
b/roles/base/files/common-scripts/conditional-restart.sh
index f95ef74..f4ac932 100644
--- a/roles/base/files/common-scripts/conditional-restart.sh
+++ b/roles/base/files/common-scripts/conditional-restart.sh
@@ -10,9 +10,13 @@ rpm -q $PACKAGE
 INSTALLED=$?

 if [ $INSTALLED -eq 0 ]; then
-echo "Package $PACKAGE installed.  Attempting restart of $SERVICE."
-/sbin/service $SERVICE restart
-exit $?  # Exit with the /sbin/service status code
+if chkconfig $PACKAGE; then
+echo "Package $PACKAGE installed.  Attempting restart of $SERVICE."
+/sbin/service $SERVICE restart
+exit $?  # Exit with the /sbin/service status code
+else
+echo "Package $PACKAGE not enabled.  Skipping restart of $SERVICE."
+fi
 fi

 # If the package wasn't installed, then pretend everything is fine.

This works for httpd from el6 to Fedora21. But I tested it only for httpd.
But this is used for all services.
Please raise your voice if you are aware of some service which we want to 
restart, but we do not enable it.
--
Miroslav Suchy, RHCE, RHCDS
Red Hat, Senior Software Engineer, #brno, #devexp, #fedora-buildsys
___
infrastructure mailing list
infrastructure@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/infrastructure

Re: change in conditional-restart.sh

2014-12-10 Thread Ralph Bean
On Mon, Dec 08, 2014 at 02:28:26PM +0100, Miroslav Suchý wrote:
> Hi,
> today I run groups/copr-backend.yml playbook and fedmsg/base notified 
> "restart httpd". Which failed because
> httpd is there installed, but not enabled (it is there just as requirement of 
> webalizer).
> So I'm thinking about change (after freeze):

We're out of freeze now, but +1 to this anyways.


pgpLk41RnuoZE.pgp
Description: PGP signature
___
infrastructure mailing list
infrastructure@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/infrastructure