Skip to content

acavalin/systemd-units

Repository files navigation

My collection of systemd unit files

vc-mounter.service / vc-mounter.rb

Mounts VeraCrypt volumes as a specified user (with sudo), runs fsck on them, and executes an optional per volume custom ruby script.

tmpfs-folders.service

A simple step towards read only root file system to save preciuos disk read/writes. Mounts /var/log and user homes directories on tmpfs. SETUP: create directory skeletons (see instructions in tmpfs-folders.sh)

spindown-disks.service

Spind down disks before shutdown


References

LINKS

SETUP:

  • ln -f /opt/systemd-units/name.service /lib/systemd/system/ - hard link it
  • systemctl enable name.service
  • systemctl daemon-reload - after some changes

REFERENCES:

Note that DefaultDependencies = true implies:

  • Requires = sysinit.target
  • After = sysinit.target basic.target
  • Conflicts = shutdown.target
  • Before = shutdown.target
[Unit]
DefaultDependencies = no
Requires  = sysinit.target local-fs.target
After     = sysinit.target local-fs.target
Before    = basic.target
[Install]
WantedBy  = basic.target

ONESHOTs: this combination stops the execution of both Start and Stop

Type = oneshot
RemainAfterExit = yes

DEBUG E LOGS:

  • journalctl
  • cat /var/log/boot.log
  • graphs:
    • systemd-analyze plot > boot-chart.svg
    • systemd-analyze dot | dot -Tsvg > boot-full.svg
    • systemd-analyze --order dot | dot -Tsvg > boot-order.svg
    • systemd-analyze --require dot | dot -Tsvg > boot-require.svg