Skip to content

Commit

Permalink
Make systemd service file more robust
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 1, 2024
1 parent d9cca92 commit 1e4b8d7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Experimental Alpine support has also been added, other distributions may work bu
``` shell
sudo apt-get install git
git clone --recurse-submodules https://github.com/ecdye/zram-config
cd zram-config
sudo ./zram-config/install.bash
```

Expand Down
16 changes: 0 additions & 16 deletions service/SystemD/zram-config-stop.service

This file was deleted.

14 changes: 12 additions & 2 deletions service/SystemD/zram-config.service
Original file line number Diff line number Diff line change
@@ -1,11 +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
Type=oneshot
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"
TimeoutStopSec=120
RemainAfterExit=yes

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

0 comments on commit 1e4b8d7

Please sign in to comment.