【问题标题】:Run a few additional commands after systemctl restart httpd on CentOS在 CentOS 上 systemctl restart httpd 后运行一些额外的命令
【发布时间】:2018-03-19 18:15:14
【问题描述】:

每次httpd服务重启时,我都需要将一堆文件复制到某个文件夹中

例如:

是的 | cp ./dynamic/*.file /folder/inside/my/webapp

有没有办法在 httpd 重启时运行一些额外的命令?

【问题讨论】:

    标签: command-line centos httpd.conf


    【解决方案1】:

    据此:https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

    您可以编辑 httpd 服务文件:

    sudo systemctl edit --full httpd.service
    

    您应该能够向服务单元添加更多指令,例如运行您的附加命令。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-14
      • 1970-01-01
      • 2021-08-15
      • 2018-03-21
      • 2016-04-02
      • 2021-12-11
      • 1970-01-01
      • 2019-10-16
      相关资源
      最近更新 更多