Bug796588#: adjtimex: Has init script in runlevel S but no matching service file

Andreas Henriksson andreas at fatal.se
Sat Nov 28 15:47:58 GMT 2015


Hello Roger Shimizu.

On Sat, Nov 28, 2015 at 11:12:38PM +0900, Roger Shimizu wrote:
> Dear systemd maintainers,
[...]

I'm just a random bystander, but hope I can come up with a few
useful suggestion.

> Enclosed the "adjtimex.service" file I wrote and confirmed working
> well on my box.
> Since this is the first time I write service file, it would be helpful
> if you can help to review it.

Thanks for your interest in participating in resolving the rcS situation.

> 
> I also have one doubt whether to have "RemainAfterExit=yes", which is
> commented out now.
> After setting the kernel time variables, adjtimex simply exits and
> don't need to remain as daemon. I guess it should be okay to be "no".

I'd suggest you remove the line entirely.  (The default is
RemainAfterExit=no.)
You have no "stop" method, thus there's no point in using this
directive to mark the service as still running so that it can
later be "stopped".

For more information:
http://www.freedesktop.org/software/systemd/man/systemd.service.html#RemainAfterExit=


> 
> Looking forward to your reply. Thank you!

I also suggest you look into the possibility to not running
the init script from the service file.

Should be possible by making the following changes:

Remove:
ConditionFileIsExecutable=/etc/init.d/adjtimex

Add:
Environment="TICK=10000 FREQ=0"
EnvironmentFile=-/etc/default/adjtimex

See:
http://www.freedesktop.org/software/systemd/man/systemd.exec.html#Environment=
EnvironmentFile= should "win" over default settings in Environment=,
while the dash (-) prefix says it's ok if the file does not exist.

Replace:
ExecStart=/etc/init.d/adjtimex start

with:
ExecStart=/sbin/adjtimex -tick "$TICK" -frequency "$FREQ"


In case these changes sounds useful to you, then please confirm the
above to make sure my understanding of the situation is correct.

Regards,
Andreas Henriksson




More information about the Pkg-systemd-maintainers mailing list