Browse Source

Include a triggered service in service description examples

Davin McCall 1 year ago
parent
commit
fe66fe3aee
3 changed files with 20 additions and 2 deletions
  1. 7 2
      doc/linux/DINIT-AS-INIT.md
  2. 2 0
      doc/linux/services/dhcpcd
  3. 11 0
      doc/linux/services/netdev-enp3s0

+ 7 - 2
doc/linux/DINIT-AS-INIT.md

@@ -84,8 +84,9 @@ The basic procedure for boot (to be implemented by services) is as follows:
 - mount early virtual filesystems
 - start device node manager
 - trigger device node manager (udevadm trigger --action=add) to add
-  boot-time device nodes (possibly not necessary if using kernel-mounted
-  devtmpfs)
+  boot-time device nodes (or run additional actions for nodes already created
+  if using kernel-mounted devtmpfs)
+- set the system time from the hardware realtime clock
 - run root filesystem check
 - remount root filesystem read-write
 - start syslog deamon
@@ -234,6 +235,10 @@ services can then start:
 - `dbusd` - starts the DBus daemon (system instance), which is used by other services to
   provide an interface to user processes
 - `dhcpcd` - starts a DHCP client daemon on a network interface (the example uses `enp3s0`).
+- 'netdev-enp3s0' - a triggered service representing the availablility of the `enp3s0` network
+  interface. See the service description file for details. Note that the 'udev-settle` service
+  somewhat makes this redundant, as would use of a suitable network manager; it is provided for
+  example purpsoses.
 - `sshd` - starts the SSH daemon.
 
 We want most of the preceding services to be started before we allow a user to login. To that

+ 2 - 0
doc/linux/services/dhcpcd

@@ -4,4 +4,6 @@ type = process
 command = /usr/sbin/dhcpcd -B -M --logfile /var/log/dhcpcd-service.log enp3s0
 logfile = /var/log/dhcpcd.log
 restart = false
+
 depends-on = rcboot
+depends-on = netdev-enps3s0

+ 11 - 0
doc/linux/services/netdev-enp3s0

@@ -0,0 +1,11 @@
+# This service represents availability of the "enp3s0" network interface.
+# It must be triggered externally via the device manager (for example).
+#
+# This can then be used as a dependency for network services, such as dhcpcd.
+#
+# If using udev (or eudev) for example, a suitable rule could be put into a
+# file called /etc/udev/rules.d/81-netdev.rules, as follows:
+#
+#     ACTION=="add" SUBSYSTEM=="net" NAME=="enp4s0" RUN{program}="/sbin/dinitctl trigger netdev-enp4s0"
+
+type = triggered