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

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



On 29 November 2015 at 11:04, Roger Shimizu <rogershimizu@gmail.com> wrote:
> Dear Felipe and Andreas,
>
> Your detailed feedback is really helpful.
> I really appreciate your kindness help!
>
> Enclosed my updated adjtimex.service file.
> Here's the explanation why I changed a bit.
>
>>> [Unit]
>>> Description=adjtimex service in early boot
>> I think the description of the init script is better: "set the kernel
>> time variables".
>
> I changed to "Description=the kernel time variables setting"
> Because it's more proper in the log with context:
>
> Nov 29 22:36:01 sid systemd[1]: Starting the kernel time variables setting...
> Nov 29 22:36:01 sid systemd[1]: Started the kernel time variables setting.

Note that this is not the only place that this description appears. It
also shows in the output of "systemctl status adjtimex.service", or
"systemctl list-units". This should really be a full descriptive
sentence. Maybe, "Adjust kernel time variables".


>
>>> #RemainAfterExit=yes
>> I have seen that Type=oneshot services that do not have
>> RemainAfterExit=yes can be executed multiple times during boot. This
>> may or may not be a problem here.
>> The RemainAfterExit directive controls wether systemd considers the
>> unit "active" after all the running processes in the unit exited. This
>> can trigger multiple runs during boot, if at some point this unit is
>> wanted, but it already ran and exited. My sense is that
>> RemainAfterExit should be =yes for most Type=oneshot service.
>> Unfortunately, that means that to manually re-run the unit, one needs
>> to do a "restart" instead of a "start" to make systemd run the program
>> again.
>
> Considering adjtimex is simply set time ticking related kernel
> variables on boot, it won't look after those kernel variables, which
> may be changed by other processes, such as NTP client, I think it's
> better to indicate the user that adjtimex service is NOT "active"
> after exiting. So I removed the line completely.
>
> If you're comfortable with this version of adjtimex.service, together
> with another minor fix, I'll build a package to upload to mentors, and
> ask for sponsor in mentors list.

> Environment="TICK=10000 FREQ=0"

I don't think this works. There should be no quotes there, or systemd
might treat TICK variable as containing "10000 FREQ=0".

> EnvironmentFile=-/etc/default/adjtimex
> ExecStart=/sbin/adjtimex -tick "$TICK" -frequency "$FREQ"

I think the quotes are superfluous. If you want to preserve quoting,
systemd does it by using ${TICK} and ${FREQ} syntax.

There is more information on using variables here:
http://www.freedesktop.org/software/systemd/man/systemd.service.html#Command%20lines

-- 

Saludos,
Felipe Sateler


Reply to: