meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:systemd [2016/09/07 07:36] – [tricks] niziaklinux:systemd [2024/02/09 19:24] (current) niziak
Line 1: Line 1:
 +====== systemd ======
 +
 +  * [[https://www.freedesktop.org/software/systemd/man/latest/bootup.html|bootup — System bootup process]]
 +
 ===== HowTo ===== ===== HowTo =====
 ==== start / stop ==== ==== start / stop ====
 +Rerun all generators, reload all unit files and recreate dependency tree:
 <code bash> <code bash>
 systemctl daemon-reload systemctl daemon-reload
Line 23: Line 28:
 </code> </code>
  
 +<code bash>
 +systemd-cgtop
 +</code>
  
 ==== emergency mode  ==== ==== emergency mode  ====
Line 126: Line 134:
  
 === Remove startup console clearing === === Remove startup console clearing ===
-<code> +<file | /etc/systemd/system/getty@tty1.service.d/noclear.conf>
-/etc/systemd/system/getty@tty1.service.d/noclear.conf+
  
 [Service] [Service]
 TTYVTDisallocate=no TTYVTDisallocate=no
-</code>+</file>
  
 === udev === === udev ===
Line 142: Line 149:
 </code> </code>
 And now device is visible from systemd: And now device is visible from systemd:
-<code>+<code bash>
 systemctl -l -a systemctl -l -a
   dev-input-event0.device                                                                        loaded    active   plugged   /dev/input/event0   dev-input-event0.device                                                                        loaded    active   plugged   /dev/input/event0
Line 149: Line 156:
 You can create refer to device, e.g. create .wants directory You can create refer to device, e.g. create .wants directory
 <code>/etc/systemd/system/ev-input-lcd_sandwich_touchscreen.device.wants</code> <code>/etc/systemd/system/ev-input-lcd_sandwich_touchscreen.device.wants</code>
 +
 +=== udev: start service ===
 +To start service if device is inserted:
 +<file | mu.rule>
 +..., TAG+="systemd", ENV{SYSTEMD_WANTS}="netctl-auto@mywifi.service"
 +</file>
  
 === do not mount crypted volumes === === do not mount crypted volumes ===
Line 158: Line 171:
 /MyMountPoint /dev/vg_MyName/lv_MyName none luks,noauto,noearly /MyMountPoint /dev/vg_MyName/lv_MyName none luks,noauto,noearly
 </file> </file>
 +
 +=== Debian: Set network service timeout ===
 +System startup can hang forever if there is no link on ethernet cable:
 +<code>   **] A start job is running for LSB: Raise network interf...38s / no limit)</code>
 +To set timeout, add file:
 +<file | /etc/systemd/system/networking.service.d/reduce-timeout.conf>
 +[Service]
 +TimeoutStartSec=15
 +</file>
 +
 +====== Issues ======
 +
 +===== init.d services not started =====
 +
 +<code>
 +systemd-sysv-generator[320]: stat() failed on /etc/init.d/traccar, ignoring: No such file or directory
 +systemd-sysv-generator[320]: stat() failed on /etc/init.d/ts3server, ignoring: No such file or directory
 +systemd-sysv-generator[320]: stat() failed on /etc/init.d/miio_server, ignoring: No such file or directory
 +</code>
 +
 +Reason is that some init scripts are symlinked to files located in **/opt** directory, which is a different FS (in this case BTRFS subvolume), and it was not mounted when **systemd-sysv-generator** was started.
 +
 +**Solution:**
 +[[https://access.redhat.com/solutions/3094591|How to mount non-root filesystem before systemd-sysv-generator runs?]]
 +
 +> Under systemd-enabled systems, there's a new-with-systemd mount-option you can place in ''/etc/fstab'' — **x-initrd.mount**. 
 +> You also need to make sure that your filesystem's fs_passno is set to "0" ...and if your filesystem lives on an LVM2 volume, you need to update your GRUB2 config to ensure that the LVM gets onlined prior to systemd invoking the systemd-sysv-generator utility
 +
 +
 +
 +
 +