[systemd-devel] how to depend the service which is triggerred by uevent
lchina77
lchina77 at 163.com
Thu Sep 24 09:22:38 UTC 2020
Hi, All,
I have two services: service_A and service_B. The service_A which depends on the tap0 uevent will configure the virtual net,
while the service_B which depends on the virtual net should run After the service_A, but the "After=Service_A" seems to have no effect.
udev rule:
ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/virtual/net/tap0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="service_A.service"
service_A.service:
[Unit]
Description=setting up bridge
[Service]
Type=oneshot
ExecStart=-/usr/bin/net_config.sh
RemainAfterExit=yes
service_B.service:
[Unit]
DefaultDependencies=no
After=service_A.service
After=local-fs.target
[Service]
Type=simple
ExecStart=/usr/bin/prog_B
Restart=always
OOMScoreAdjust=-941
[Install]
WantedBy=sysinit.target
Could anyone give me some suggestion?
Thanks!
Best Regards,
Li Cheng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20200924/7a5f80d1/attachment.htm>
More information about the systemd-devel
mailing list