当我们在执行poweroff或者reboot时会出现某个服务需要等待才能关闭系统,这个时候就可以在服务中添加如下:
After=shutdown.target
Conflicts=reboot.target halt.target poweroff.target
Before=shutdown.target reboot.target halt.target poweroff.target
具体实例:
[Unit]
Description=Your Service Descr
当我们在执行poweroff或者reboot时会出现某个服务需要等待才能关闭系统,这个时候就可以在服务中添加如下:
After=shutdown.target
Conflicts=reboot.target halt.target poweroff.target
Before=shutdown.target reboot.target halt.target poweroff.target
具体实例:
[Unit]
Description=Your Service Descr