[opensuse-packaging] Problems with packaging systemd.timer
Hello, me have reached an Bugentry, that i shoud insert/change cron into systemd.timer in my package. First i must say i'm not a friend of this. Imho systemd catch to many services and i don't like journalctl. And the systemd.timer are many more work than cron with no benfit. Anyway, i have now add systemd.timer to my package to learn about systemd.timer. But now rpmlint rise some warnings, where i think it is not okay. 1.) I must create two files. A service- and a timer-file But rpmlint says now i must also create %service_add_pre <package>.service and so on. But why? This service file is not a 'normal' service file. It is only used for timer. 2.) Rpmlint rise up warning: suse-missing-rclink <package> But why? See above. It is only a file for systemd.timer. 3.) <package>.noarch: W: non-etc-or-var-file-marked-as-conffile /usr/lib/systemd/system/<package>.service <package>.noarch: W: non-etc-or-var-file-marked-as-conffile /usr/lib/systemd/system<package>.timer A file not in /etc or /var is marked as being a configuration file. Please put your conf files in /etc or /var. But i must tag in spec with config(noreplace), because a user perhaps want to change the time or logfile or something else. What should i do to prevent time or command changes at update? 4.) With systemd.timer no mail will be send if service failed. What think opensuse to do to implement this feature? Arch have something do: https://wiki.archlinux.org/index.php/Systemd/Timers 5.) When i want run a timer every day and i insert a * for day field, systemd rise up an error. So i must the 'day field' empty. Is this an bug from systemd? Or is this volitional? On time field i must insert *. Where is there the logic? -- Regards Eric -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
El 27-11-2018 a las 5:31, Eric Schirra escribió:
Hello,
1.) I must create two files. A service- and a timer-file But rpmlint says now i must also create %service_add_pre <package>.service and so on. But why? This service file is not a 'normal' service file. It is only used for timer.
2.) Rpmlint rise up warning: suse-missing-rclink <package> But why? See above. It is only a file for systemd.timer.
RPMLINT does not have the knowledge of this special cases, you shall not restart/start/stop the service in this case, maybe not even the timer.
3.) <package>.noarch: W: non-etc-or-var-file-marked-as-conffile /usr/lib/systemd/system/<package>.service <package>.noarch: W: non-etc-or-var-file-marked-as-conffile /usr/lib/systemd/system<package>.timer A file not in /etc or /var is marked as being a configuration file. Please put your conf files in /etc or /var.
service files stored in /usr/lib/systemd/system are not configuration files. remove the %config from them
But i must tag in spec with config(noreplace), because a user perhaps want to change the time or logfile or something else. What should i do to prevent time or command changes at update?
No, if the user wants to change a service definition shall store the changed unit file in /etc/systemd/system/ and reload. this is the documented mode of usage.
5.) When i want run a timer every day and i insert a * for day field, systemd rise up an error. So i must the 'day field' empty. Is this an bug from systemd? Or is this volitional? On time field i must insert *. Where is there the logic?
Everyday is "daily" or "*-*-* 00:00:00", but you do not want this.. you want any or a combination of OnActiveSec=, OnBootSec=, OnStartupSec=, OnUnitActiveSec=, OnUnitInactiveSec=. You most likely want to trigger when 24 hours passed for the computer since the last time it was executed.. and not for the wall clock, which is subject to time adjustments by NTP, DST, leap seconds..etc.. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Am Dienstag, 27. November 2018, 15:27:44 CET schrieb Cristian Rodríguez:
El 27-11-2018 a las 5:31, Eric Schirra escribió:
Hello,
1.) I must create two files. A service- and a timer-file
But rpmlint says now i must also create %service_add_pre
<package>.service and so on.
But why? This service file is not a 'normal' service file. It is
only used for timer.
2.) Rpmlint rise up warning: suse-missing-rclink <package>
But why? See above. It is only a file for systemd.timer.
RPMLINT does not have the knowledge of this special cases, you shall not restart/start/stop the service in this case, maybe not even the timer.
Imho the rpmlint checks must fix and adapted to systemd.timer When will this implement?
3.) <package>.noarch: W: non-etc-or-var-file-marked-as-conffile /usr/lib/systemd/system/<package>.service
<package>.noarch: W: non-etc-or-var-file-marked-as-conffile
/usr/lib/systemd/system<package>.timer
A file not in /etc or /var is marked as being a configuration file.
Please put
your conf files in /etc or /var.
service files stored in /usr/lib/systemd/system are not configuration files. remove the %config from them
But i must tag in spec with config(noreplace), because a user
perhaps want to change
the time or logfile or something else. What should i do to prevent time or command changes at update?
No, if the user wants to change a service definition shall store the changed unit file in /etc/systemd/system/ and reload. this is the documented mode of usage.
What? I must search the right file under /usr/lib/systemd and copy the timer file to /etc/systemd/system and change it in this location. Right? Must i also copy the dependent service?
5.) When i want run a timer every day and i insert a * for day field, systemd rise up an error.
So i must the 'day field' empty. Is this an bug from systemd? Or is
this volitional?
On time field i must insert *. Where is there the logic?
Everyday is "daily" or "*-*-* 00:00:00", but you do not want this.. you want any or a combination of OnActiveSec=, OnBootSec=, OnStartupSec=, OnUnitActiveSec=, OnUnitInactiveSec=. You most likely want to trigger when 24 hours passed for the computer since the last time it was executed.. and not for the wall clock, which is subject to time adjustments by NTP, DST, leap seconds..etc..
No. I want start the timer every day on the same absolute time. OnCalendar=*-*-* *:05:00 What is with my point 4? I need or want e mail if service failed. Like with cron. What is the benefit from sytemd.timer? Imho nothing. I must generate a timer file, a service file and perhaps a timer file in /etc/ systemd/system. I have minimum two locations for configuration. All is more work and more complex. Crazy and unreproducible. :-( Regards Eric -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On 28/11/2018 04:23, Eric Schirra wrote:
Am Dienstag, 27. November 2018, 15:27:44 CET schrieb Cristian Rodríguez:
El 27-11-2018 a las 5:31, Eric Schirra escribió:
Hello,
1.) I must create two files. A service- and a timer-file
But rpmlint says now i must also create %service_add_pre
<package>.service and so on.
But why? This service file is not a 'normal' service file. It is
only used for timer.
2.) Rpmlint rise up warning: suse-missing-rclink <package>
But why? See above. It is only a file for systemd.timer.
RPMLINT does not have the knowledge of this special cases, you shall not restart/start/stop the service in this case, maybe not even the timer.
Imho the rpmlint checks must fix and adapted to systemd.timer When will this implement?
Someone is currently working on a significant cleanup of rpmlint so hopefully soon. -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Am 27.11.18 um 15:27 schrieb Cristian Rodríguez:
Everyday is "daily" or "*-*-* 00:00:00", but you do not want this.. you want any or a combination of OnActiveSec=, OnBootSec=, OnStartupSec=, OnUnitActiveSec=, OnUnitInactiveSec=. You most likely want to trigger when 24 hours passed for the computer since the last time it was executed.. and not for the wall clock, which is subject to time adjustments by NTP, DST, leap seconds..etc..
Does systemd.timer run on Local time? REALLY? NTP, Leap seconds etc. will not make "00:00:00" not happen. SNTP might, this is why one should not use it. Leap second will create either 23:59:60 additional second, or remove 23:59:59 second, so "*-*-* 29:59:59" might be a bad idea with systemd.timer (but it will work just fine with cron if I read the code correctly, which will execute it just one second "too late"). So if using a fixed time with sytemd.timer does not work, then the use of systemd.timer should be strongly discouraged. -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Am 2018-11-28 09:26, schrieb Stefan Seyfried:
Am 27.11.18 um 15:27 schrieb Cristian Rodríguez:
Everyday is "daily" or "*-*-* 00:00:00", but you do not want this.. you want any or a combination of OnActiveSec=, OnBootSec=, OnStartupSec=, OnUnitActiveSec=, OnUnitInactiveSec=. You most likely want to trigger when 24 hours passed for the computer since the last time it was executed.. and not for the wall clock, which is subject to time adjustments by NTP, DST, leap seconds..etc..
Does systemd.timer run on Local time? REALLY?
NTP, Leap seconds etc. will not make "00:00:00" not happen. SNTP might, this is why one should not use it. Leap second will create either 23:59:60 additional second, or remove 23:59:59 second, so "*-*-* 29:59:59" might be a bad idea with systemd.timer (but it will work just fine with cron if I read the code correctly, which will execute it just one second "too late").
So if using a fixed time with sytemd.timer does not work, then the use of systemd.timer should be strongly discouraged.
I will a fixed time. I want every day, every hour past five minutes after hour. And it is working with OnCalendar=*-*-* *:05:00 But my question was: Why must i leave the "*" for days from above and why i can not insert a * for daily too. Like OnCalendar=* *-*-* *:05:00. And i ask if this is a bug of systemd. -- Regards Eric -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Am 2018-11-27 09:31, schrieb Eric Schirra: Again. What is with my question point 4?
4.) With systemd.timer no mail will be send if service failed. What think opensuse to do to implement this feature? Arch have something do: https://wiki.archlinux.org/index.php/Systemd/Timers
What is with a mail in systemd when service has a failure ? Does nobody need this? -- Regards Eric -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (4)
-
Cristian Rodríguez
-
Eric Schirra
-
Simon Lees
-
Stefan Seyfried