How to run nginx.service after /vagrant is mounted

前端 未结 5 615
青春惊慌失措
青春惊慌失措 2021-02-06 07:25

What I want to do?

I\'m trying to make nginx load configurations from /vagrant mounted by vagrant automatically.

So I edited nginx.service to make

5条回答
  •  说谎
    说谎 (楼主)
    2021-02-06 07:42

    edit /lib/systemd/system/nginx.service and change WantedBy directive under Install section...

    WantedBy=vagrant.mount
    

    You can check if the vagrant.mount event exists via: systemctl list-units vagrant.mount. You should see this:

    UNIT          LOAD   ACTIVE SUB     DESCRIPTION
    vagrant.mount loaded active mounted /vagrant
    
    LOAD   = Reflects whether the unit definition was properly loaded.
    ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
    SUB    = The low-level unit activation state, values depend on unit type.
    
    1 loaded units listed. Pass --all to see loaded but inactive units, too.
    To show all installed unit files use 'systemctl list-unit-files'.
    

提交回复
热议问题