#23 Add boot check before reload
Closed 2 years ago by jorton. Opened 2 years ago by nishibe.
https://github.com/nishibem/httpd_git main  into  rawhide

Fix unintended attempt of reloading inactive httpd.service
Mamoru Nishibe • 2 years ago  
httpd.logrotate
file modified
+3 -1
@@ -6,6 +6,8 @@

      sharedscripts

      delaycompress

      postrotate

-         /bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true

+     if [ -e /var/run/httpd/httpd.pid ]; then 

+         /bin/systemctl reload httpd.service > /dev/null 2>/dev/null  || true

+     fi

      endscript

  }

no initial comment

Prevent an error from being logged when trying to reload even if httpd is not running

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

The way we recommend to configure instantiated units (httpd@foobar.service) is with:

       [Unit]
       ReloadPropagatedFrom=httpd.service

so that they are reloaded by logrotate as well. Your change would stop that working.

Is there another way to prevent systemd logging the failed reloads?

rebased onto 6480e1fec4e0d430683ca0cf20dd519b9351beae

2 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

1 new commit added

  • Add boot check before reload :
2 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

I updated the commit.
Could you take a look?

Not sure how you addressed my concern because the "is-active" check is still there.

2 new commits added

  • Fix unintended attempt of reloading inactive httpd.service
  • Add boot check before reload
2 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

rebased onto d68d762

2 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

  • if [ -e /var/run/httpd/httpd.pid ]; then

this is also going to stop the reload propagating to templated services. Please test the scenario I outlined above with a templated httpd@foobar.service and test the case which is going to break with your change. Feel free to reopen if you come up with a tested solution.

Pull-Request has been closed by jorton

2 years ago
Metadata