Browse Source

systemd: various service file improvements

(1) network.target is generally used as a synchronization point during
boot up and not as a "boot target" (target where services are actually
enabled). Also as per 'man 7 systemd.special', service implementing
networking should pull network.target into transaction and order itself
before it. Hence, it doesn't make sense for zebra and friends to be
enabled in network.target, because they should actively pull in
network.target into boot transaction. Let's enable them as normal
services in multi-user.target and order against network{,-pre}.target
appropriately.

(2) All quagga daemons needs zebra to be running at all times and want
to restarted/stopped whenever zebra is. This is expressed by BindsTo=
dependency in a unit file (note "s" in Binds).
Michal Sekletar 5 years ago
parent
commit
64c5608566
7 changed files with 34 additions and 20 deletions
  1. 5 3
      redhat/bgpd.service
  2. 5 3
      redhat/isisd.service
  3. 5 3
      redhat/ospf6d.service
  4. 5 3
      redhat/ospfd.service
  5. 5 3
      redhat/ripd.service
  6. 5 3
      redhat/ripngd.service
  7. 4 2
      redhat/zebra.service

+ 5 - 3
redhat/bgpd.service

@@ -1,7 +1,9 @@
 [Unit]
 Description=BGP routing daemon
-BindTo=zebra.service
-After=syslog.target network.target zebra.service
+BindsTo=zebra.service
+Wants=network.target
+After=zebra.service network-pre.target
+Before=network.target
 ConditionPathExists=/etc/quagga/bgpd.conf
 
 [Service]
@@ -11,4 +13,4 @@ ExecStart=/usr/sbin/bgpd -d $BGPD_OPTS -f /etc/quagga/bgpd.conf
 Restart=on-abort
 
 [Install]
-WantedBy=network.target
+WantedBy=multi-user.target

+ 5 - 3
redhat/isisd.service

@@ -1,7 +1,9 @@
 [Unit]
 Description=IS-IS routing daemon
-BindTo=zebra.service
-After=syslog.target network.target zebra.service
+BindsTo=zebra.service
+Wants=network.target
+After=zebra.service network-pre.target
+Before=network.target
 ConditionPathExists=/etc/quagga/isisd.conf
 
 [Service]
@@ -11,4 +13,4 @@ ExecStart=/usr/sbin/isisd -d $ISISD_OPTS -f /etc/quagga/isisd.conf
 Restart=on-abort
 
 [Install]
-WantedBy=network.target
+WantedBy=multi-user.target

+ 5 - 3
redhat/ospf6d.service

@@ -1,7 +1,9 @@
 [Unit]
 Description=OSPF routing daemon for IPv6
-BindTo=zebra.service
-After=syslog.target network.target zebra.service
+BindsTo=zebra.service
+Wants=network.target
+After=zebra.service network-pre.target
+Before=network.target
 ConditionPathExists=/etc/quagga/ospf6d.conf
 
 [Service]
@@ -11,4 +13,4 @@ ExecStart=/usr/sbin/ospf6d -d $OSPF6D_OPTS -f /etc/quagga/ospf6d.conf
 Restart=on-abort
 
 [Install]
-WantedBy=network.target
+WantedBy=multi-user.target

+ 5 - 3
redhat/ospfd.service

@@ -1,7 +1,9 @@
 [Unit]
 Description=OSPF routing daemon
-BindTo=zebra.service
-After=syslog.target network.target zebra.service
+BindsTo=zebra.service
+Wants=network.target
+After=zebra.service network-pre.target
+Before=network.target
 ConditionPathExists=/etc/quagga/ospfd.conf
 
 [Service]
@@ -11,4 +13,4 @@ ExecStart=/usr/sbin/ospfd -d $OSPFD_OPTS -f /etc/quagga/ospfd.conf
 Restart=on-abort
 
 [Install]
-WantedBy=network.target
+WantedBy=multi-user.target

+ 5 - 3
redhat/ripd.service

@@ -1,7 +1,9 @@
 [Unit]
 Description=RIP routing daemon
-BindTo=zebra.service
-After=syslog.target network.target zebra.service
+BindsTo=zebra.service
+Wants=network.target
+After=zebra.service network-pre.target
+Before=network.target
 ConditionPathExists=/etc/quagga/ripd.conf
 
 [Service]
@@ -11,4 +13,4 @@ ExecStart=/usr/sbin/ripd -d $RIPD_OPTS -f /etc/quagga/ripd.conf
 Restart=on-abort
 
 [Install]
-WantedBy=network.target
+WantedBy=multi-user.target

+ 5 - 3
redhat/ripngd.service

@@ -1,7 +1,9 @@
 [Unit]
 Description=RIP routing daemon for IPv6
-BindTo=zebra.service
-After=syslog.target network.target zebra.service
+BindsTo=zebra.service
+Wants=network.target
+After=zebra.service network-pre.target
+Before=network.target
 ConditionPathExists=/etc/quagga/ripngd.conf
 
 [Service]
@@ -11,4 +13,4 @@ ExecStart=/usr/sbin/ripngd -d $RIPNGD_OPTS -f /etc/quagga/ripngd.conf
 Restart=on-abort
 
 [Install]
-WantedBy=network.target
+WantedBy=multi-user.target

+ 4 - 2
redhat/zebra.service

@@ -1,6 +1,8 @@
 [Unit]
 Description=GNU Zebra routing manager
-After=syslog.target network.target
+Wants=network.target
+Before=network.target
+After=network-pre.target
 ConditionPathExists=/etc/quagga/zebra.conf
 
 [Service]
@@ -11,4 +13,4 @@ ExecStart=/usr/sbin/zebra -d $ZEBRA_OPTS -f /etc/quagga/zebra.conf
 Restart=on-abort
 
 [Install]
-WantedBy=network.target
+WantedBy=multi-user.target