diff options
| author | Rutherther <rutherther@ditigal.xyz> | 2025-12-22 16:48:12 +0100 |
|---|---|---|
| committer | Rutherther <rutherther@ditigal.xyz> | 2025-12-22 22:48:48 +0100 |
| commit | 9a78e760762c1d93369e765bdce12388e1662ec6 (patch) | |
| tree | 50ed4e102c3c080279b77f47203ed73d540bf3c8 /etc/guix-daemon.service.in | |
| parent | a2df6c460f9777879a78a510fa5c3cc08ed0b4c1 (diff) | |
guix-daemon.service.in: Make service restartable.
Currently the service cannot be restarted, because the gnu store mount makes
it read-only. So fix this by removing the mount when starting the service.
"-" to accept failures, in case the command doesn't finish successfully,
chances are, the store can be mounted as RW, so continue.
"+" to run as root
Fixes: #4744
* etc/guix-daemon.service.in
(Service)<ExecStartPre>: Stop gnu-store.mount
(Service)<ExecStartPost>: Start gnu-store.mount
Change-Id: I296f5d8805497f8a7364b68d627eb6d4fc05dbff
Diffstat (limited to 'etc/guix-daemon.service.in')
| -rw-r--r-- | etc/guix-daemon.service.in | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/guix-daemon.service.in b/etc/guix-daemon.service.in index 88929fa904e..869bc4dc0b6 100644 --- a/etc/guix-daemon.service.in +++ b/etc/guix-daemon.service.in | |||
| @@ -14,6 +14,12 @@ ExecStart=@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daem | |||
| 14 | --substitute-urls='@GUIX_SUBSTITUTE_URLS@' | 14 | --substitute-urls='@GUIX_SUBSTITUTE_URLS@' |
| 15 | Environment='GUIX_STATE_DIRECTORY=@localstatedir@/guix' 'GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale' LC_ALL=en_US.utf8 | 15 | Environment='GUIX_STATE_DIRECTORY=@localstatedir@/guix' 'GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale' LC_ALL=en_US.utf8 |
| 16 | 16 | ||
| 17 | # Stop the gnu-store.mount so that the daemon can capture the store as | ||
| 18 | # read-write in its private mount namespace. | ||
| 19 | # See <https://codeberg.org/guix/guix/issues/4744>. | ||
| 20 | ExecStartPre=-+systemctl stop gnu-store.mount | ||
| 21 | ExecStartPost=-+systemctl start gnu-store.mount --no-block | ||
| 22 | |||
| 17 | # Run under a dedicated unprivileged user account. | 23 | # Run under a dedicated unprivileged user account. |
| 18 | User=guix-daemon | 24 | User=guix-daemon |
| 19 | 25 | ||
