https://github.com/acavalin/systemd-units
Systemd unit files
https://github.com/acavalin/systemd-units
automation automounter disk-encryption disk-management logging readonly-filesystem systemd systemd-unit tmpfs-volume veracrypt
Last synced: 4 months ago
JSON representation
Systemd unit files
- Host: GitHub
- URL: https://github.com/acavalin/systemd-units
- Owner: acavalin
- License: gpl-2.0
- Created: 2016-01-11T21:33:52.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-10-03T14:50:24.000Z (9 months ago)
- Last Synced: 2025-02-17T19:47:49.613Z (4 months ago)
- Topics: automation, automounter, disk-encryption, disk-management, logging, readonly-filesystem, systemd, systemd-unit, tmpfs-volume, veracrypt
- Language: Ruby
- Homepage:
- Size: 55.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
* https://www.digitalocean.com/community/tutorials/systemd-essentials-working-with-services-units-and-the-journal
* https://www.google.it/?gws_rd=ssl#q=systemd%20how%20to%20create%20a%20service
* https://coreos.com/docs/launching-containers/launching/getting-started-with-systemd/## 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:
* http://www.freedesktop.org/software/systemd/man/systemd.service.html
* http://www.freedesktop.org/software/systemd/man/systemd.unit.html
* http://www.freedesktop.org/software/systemd/man/systemd.special.html
* http://www.freedesktop.org/software/systemd/man/bootup.htmlNote that `DefaultDependencies = true` implies:
* `Requires = sysinit.target `
* `After = sysinit.target basic.target`
* `Conflicts = shutdown.target `
* `Before = shutdown.target `## [EARLY START](http://lists.freedesktop.org/archives/systemd-devel/2010-September/000225.html)
```ini
[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
```ini
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`