use symlink to ensure cupsd.conf PATH always points to a valid store path

even if cups rewrites its config file due to config changes made through
its web-based management UI, we need to keep the PATH pointing to
currently-live nix store directories.  fixes #20806.
This commit is contained in:
Matt McHenry 2016-12-13 21:23:16 -05:00
parent 1c50bdd928
commit 05fb82732c

View File

@ -75,7 +75,7 @@ let
'') cfg.listenAddresses}
Listen /var/run/cups/cups.sock
SetEnv PATH ${bindir}/lib/cups/filter:${bindir}/bin
SetEnv PATH /var/lib/cups/path/lib/cups/filter:/var/lib/cups/path/bin
DefaultShared ${if cfg.defaultShared then "Yes" else "No"}
@ -310,6 +310,13 @@ in
for i in *; do
[ ! -e "/var/lib/cups/$i" ] && ln -s "${rootdir}/etc/cups/$i" "/var/lib/cups/$i"
done
#update path reference
[ -L /var/lib/cups/path ] && \
rm /var/lib/cups/path
[ ! -e /var/lib/cups/path ] && \
ln -s ${bindir} /var/lib/cups/path
${optionalString cfg.gutenprint ''
if [ -d /var/lib/cups/ppd ]; then
${gutenprint}/bin/cups-genppdupdate -p /var/lib/cups/ppd