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
Next revisionBoth sides next revision
linux:systemd [2016/04/06 09:38] niziaklinux:systemd [2017/05/22 14:22] niziak
Line 1: Line 1:
 ===== 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 24:
 </code> </code>
  
 +<code bash>
 +systemd-cgtop
 +</code>
  
 ==== emergency mode  ==== ==== emergency mode  ====
Line 45: Line 49:
 <code>setenv bootargs ${bootargs} systemd.unit=emergency.target</code> <code>setenv bootargs ${bootargs} systemd.unit=emergency.target</code>
  
-=== Start service when MMC card is inserted ===+Enable debug console on tty9 
 +<code bash>systemctl enable debug-shell.service</code> 
 + 
 +==== Start service when MMC card is inserted ====
 Create directory "dev-mmcblk0.device.wants" and put symlink to service inside it. Create directory "dev-mmcblk0.device.wants" and put symlink to service inside it.
 List of devices: <code bash>systemctl --all --full -t device</code> List of devices: <code bash>systemctl --all --full -t device</code>
Line 123: Line 130:
  
 === 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
 +</file>
 +
 +=== udev ===
 +In udev rules.d add TAG+="systemd":
 +<code>
 +SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", ATTRS{name}=="edt-ft53*", \
 +    SYMLINK+="input/lcd_sandwich_touchscreen input/touchscreen_edt", \
 +    TAG+="systemd", \
 +    OPTIONS+="link_priority=100"
 </code> </code>
 +And now device is visible from systemd:
 +<code bash>
 +systemctl -l -a
 +  dev-input-event0.device                                                                        loaded    active   plugged   /dev/input/event0
 +  dev-input-lcd_sandwich_touchscreen.device                                                      loaded    active   plugged   /dev/input/lcd_sandwich_touchscreen
 +</code>
 +You can create refer to device, e.g. create .wants directory
 +<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 ===
 +After switching to systemd by command <code bash>apt-get install systemd-sysv</code>, new problem occurs: 
 +system boot stops and waits for password for encrypted partition (with user data - no needed to system start).
 +
 +To prevent automount of crypted volumes, additional parameters 'noauto' and 'noearly' must be added to /etc/crypttab:
 +<file | /etc/crypttab>
 +/MyMountPoint /dev/vg_MyName/lv_MyName none luks,noauto,noearly
 +</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>