Merge pull request #51728 from ck3d/fix-lirc-runtime-owner-ship

nixos lirc: fix owner-ship of runtime directory
This commit is contained in:
markuskowa 2018-12-08 18:08:14 +01:00 committed by GitHub
commit 9a7ce7d69a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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} \