swayidle: always restart systemd unit on failure
Occasionally, swayidle crashes with a failure to connect to the
Wayland session. Ideally, swayidle should automatically restart
instead of leaving the system in a vulnerable state.
(cherry picked from commit 50e582b9f9
)
This commit is contained in:
parent
07682fff75
commit
04bac349d5
|
@ -121,6 +121,7 @@ in {
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
|
Restart = "always";
|
||||||
# swayidle executes commands using "sh -c", so the PATH needs to contain a shell.
|
# swayidle executes commands using "sh -c", so the PATH needs to contain a shell.
|
||||||
Environment = [ "PATH=${makeBinPath [ pkgs.bash ]}" ];
|
Environment = [ "PATH=${makeBinPath [ pkgs.bash ]}" ];
|
||||||
ExecStart =
|
ExecStart =
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
|
|
||||||
assertFileExists $serviceFile
|
assertFileExists $serviceFile
|
||||||
assertFileRegex $serviceFile 'ExecStart=.*/bin/swayidle ${expectedArgs}'
|
assertFileRegex $serviceFile 'ExecStart=.*/bin/swayidle ${expectedArgs}'
|
||||||
|
assertFileRegex $serviceFile 'Restart=always'
|
||||||
assertFileRegex $serviceFile 'Environment=.*PATH=${
|
assertFileRegex $serviceFile 'Environment=.*PATH=${
|
||||||
lib.makeBinPath [ pkgs.bash ]
|
lib.makeBinPath [ pkgs.bash ]
|
||||||
}'
|
}'
|
||||||
|
|
Loading…
Reference in a new issue