I want to run a custom bash script before httpd service is started with systemd. I'm using Centos 7.
Any idea?
Kind regards.
I want to run a custom bash script before httpd service is started with systemd. I'm using Centos 7.
Any idea?
Kind regards.
Assuming your httpd service is named httpd.service
, create a directory /etc/systemd/system/httpd.service.d
; and create a file named run-my-script-first.conf
(or whatever you like) within it with the following contents:
[Service]
ExecStartPre=/path/to/your/script