Skip to content

Commit ac94772

Browse files
eMPee584nabijaczleweli
authored andcommitted
Document workaround for making zram mounts user-writable (c.f. #146)
1 parent 1ec4021 commit ac94772

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ mount-point = /var/tmp
5656

5757
This will set up a /dev/zram1 with ext2 and generate a mount unit for /var/tmp.
5858

59+
In case you want this path to be user-writable, you can use following
60+
"high-quality hack" until `systemd-makefs` provides a proper mechanism to
61+
set ownership of a generated filesystem. For the above example, create an
62+
override for `[email protected]`, for example with `systemctl edit`,
63+
containing the following (note the sticky bit as required for [/var]/tmp):
64+
65+
```ini
66+
[Service]
67+
ExecStartPost=/bin/sh -c 'd=$(mktemp -d); mount "$1" "$d"; chmod 1777 "$d"; umount "$d"; rmdir "$d"' _ /dev/%i
68+
```
69+
5970
### Rust
6071

6172
The second purpose of this program is to serve as an example of a systemd

0 commit comments

Comments
 (0)