Skip to content

Commit

Permalink
Ensure that files sync to disk on SystemD
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <mrtops03@gmail.com>
  • Loading branch information
ecdye committed Dec 5, 2024
1 parent 3325c13 commit cf55ae8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions service/SystemD/zram-config.service
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
[Unit]
Description=zram-config
Documentation=https://github.com/ecdye/zram-config/blob/main/README.md
DefaultDependencies=no
Before=basic.target rsyslog.service syslog-ng.service syslog.target systemd-journald.service sysinit.target shutdown.target
Conflicts=shutdown.target reboot.target halt.target
RequiresMountsFor=/var/log /opt/zram
IgnoreOnIsolate=yes
After=local-fs.target

[Service]
Type=exec
TimeoutSec=120
Type=oneshot
TimeoutStopSec=120
RemainAfterExit=yes
WorkingDirectory=/usr/local/lib/zram-config
ExecStart=/usr/local/sbin/zram-config "start"
ExecReload=/usr/local/sbin/zram-config "sync"
ExecStop=/usr/local/sbin/zram-config "stop"

[Install]
WantedBy=multi-user.target
WantedBy=sysinit.target

0 comments on commit cf55ae8

Please sign in to comment.