mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-29 06:45:54 +03:00
nixos lirc: fix owner-ship of runtime directory
This commit is contained in:
parent
ca3f089a83
commit
4bb55815be
@ -49,6 +49,7 @@ in {
|
||||
description = "LIRC daemon socket";
|
||||
wantedBy = [ "sockets.target" ];
|
||||
socketConfig = {
|
||||
# default search path
|
||||
ListenStream = "/run/lirc/lircd";
|
||||
SocketUser = "lirc";
|
||||
SocketMode = "0660";
|
||||
@ -66,9 +67,19 @@ in {
|
||||
serviceConfig = {
|
||||
RuntimeDirectory = "lirc";
|
||||
|
||||
# socket lives in runtime directory; we have to keep is available
|
||||
# Service runtime directory and socket share same folder.
|
||||
# Following hacks are necessary to get everything right:
|
||||
|
||||
# 1. prevent socket deletion during stop and restart
|
||||
RuntimeDirectoryPreserve = true;
|
||||
|
||||
# 2. fix runtime folder owner-ship, happens when socket activation
|
||||
# creates the folder
|
||||
PermissionsStartOnly = true;
|
||||
ExecStartPre = [
|
||||
"${pkgs.coreutils}/bin/chown lirc /run/lirc/"
|
||||
];
|
||||
|
||||
ExecStart = ''
|
||||
${pkgs.lirc}/bin/lircd --nodaemon \
|
||||
${escapeShellArgs cfg.extraArguments} \
|
||||
|
Loading…
Reference in New Issue
Block a user