User/Group overrides in a templated service triggered via timer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, all:

I have the following templated service definition:

--- grok-fsck@.service ---
[Unit]
Description=Grok-fsck service for %I
Documentation=https://github.com/mricon/grokmirror

[Service]
Type=oneshot
Environment="EXTRA_FSCK_OPTS="
EnvironmentFile=-/etc/sysconfig/grokmirror.default
EnvironmentFile=-/etc/sysconfig/grokmirror.%i
ExecStart=/usr/bin/grok-fsck -c /etc/grokmirror/%i.conf ${EXTRA_FSCK_OPTS}
IOSchedulingClass=idle
CPUSchedulingPolicy=idle
User=mirror
Group=mirror
--- end ---

It has a corresponding timer:

--- grok-fsck@.timer ---
[Unit]
Description=Grok-fsck timer for %I
Documentation=https://github.com/mricon/grokmirror

[Timer]
OnCalendar=Sat 04:00

[Install]
WantedBy=timers.target
--- end ---

I need to be able to modify User/Group for the process, to allow running 
grok-fsck as a different user. For a regular service, I would create a 
/etc/systemd/system/grok-fsck@[foo].d/10-runas.conf:

--- 10-runas.conf ---
[Service]
User=someotheruser
Group=someothergroup
--- end ---

However, it doesn't appear to be working for a service triggered via a 
timer -- the process still runs as mirror/mirror.

What's the best way to make this work properly?

TIA,
-K

_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux