Rerun all generators, reload all unit files and recreate dependency tree:
systemctl daemon-reload
systemctl start servicename
# systemctl get-default
multi-user.target
systemd-analyze blame
systemd-analyze critical-chain
systemd-analyze critical-chain network.service
systemctl list-dependencies network.service
systemctl --failed
systemd-cgtop
If services are defined with DefaultDependencies=no, they will be started unconditionally even in emergency mode, wchich can be wrong.
local-fs.target is configured to go to OnFailure=emergency.target. File /etc/fstab is parsed by systemd-fstab-generator to generate .mount units, which are Required.
To let mounts fail without switching to emergency mode, special attribute are introduced to fstab. http://www.freedesktop.org/software/systemd/man/systemd.mount.html
Kernel commandline:
systemd.unit=emergency
systemd.log_level=debug systemd.log_target=console console=ttyS0,38400
Enable in u-boot:
setenv bootargs ${bootargs} systemd.unit=emergency.target
Enable debug console on tty9
systemctl enable debug-shell.service
Create directory “dev-mmcblk0.device.wants” and put symlink to service inside it. List of devices:
systemctl --all --full -t device
Value for unit DefaultDependencies is set to yes by default. it will add following dependencies:
ReamainAfterExit=Yes
)sd_notify()
ExecStart=
will run only if all ExecStartPre=
command exits with success. May not to start long processes.Type=oneshot
Condition doesn't skip service, but only service is not started but all requirements (after,before, wants, conflicts) works. So Service is not started but it is still disabling other services by Conflicts definition. If service is not started by Condtiion it is still conflicting
[Service] TTYVTDisallocate=no
In udev rules.d add TAG+=“systemd”:
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"
And now device is visible from systemd:
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
You can create refer to device, e.g. create .wants directory
/etc/systemd/system/ev-input-lcd_sandwich_touchscreen.device.wants
To start service if device is inserted:
..., TAG+="systemd", ENV{SYSTEMD_WANTS}="netctl-auto@mywifi.service"
After switching to systemd by command
apt-get install systemd-sysv
, 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:
/MyMountPoint /dev/vg_MyName/lv_MyName none luks,noauto,noearly
System startup can hang forever if there is no link on ethernet cable:
[ **] A start job is running for LSB: Raise network interf...38s / no limit)
To set timeout, add file:
[Service] TimeoutStartSec=15
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
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: 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