[systemd-devel] [PATCH] timer: name the stamp file consistently

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Fri Jun 27 07:19:49 PDT 2014


On Fri, Jun 27, 2014 at 03:31:05PM +0200, Lennart Poettering wrote:
> On Thu, 26.06.14 13:23, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
> 
> > On Thu, Jun 26, 2014 at 10:16:27AM +0200, Michał Bartoszkiewicz wrote:
> > > The stamp file for systemd --user timers was named stamp-foo.timer if
> > > XDG_DATA_HOME was unset, but foo.timer otherwise.
> > > ---
> > >  src/core/timer.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/src/core/timer.c b/src/core/timer.c
> > > index 6f2deda..e69dfbd 100644
> > > --- a/src/core/timer.c
> > > +++ b/src/core/timer.c
> > > @@ -131,7 +131,7 @@ static int timer_setup_persistent(Timer *t) {
> > >  
> > >                  e = getenv("XDG_DATA_HOME");
> > >                  if (e)
> > > -                        t->stamp_path = strjoin(e, "/systemd/timers/", UNIT(t)->id, NULL);
> > > +                        t->stamp_path = strjoin(e, "/systemd/timers/stamp-", UNIT(t)->id, NULL);
> > >                  else {
> > >  
> > >                          _cleanup_free_ char *h = NULL;
> > 
> > Yeah, consistency is good, and this fixes a problem where one defines
> > an XDG_DATA_HOME which points at the same place as the default and
> > then the timers fire prematurely.
> > 
> > Nevertheless, after this patch some timers stored in XDG_DATA_HOME
> > will fire prematurely too. I applied the patch because I think that
> 
> "Will fire prematurely, too"? What do you mean?
If we lose the timestamp, than systemd will think it has not fired
yet, so will fire it immediately after the reboot, i.e. sooner than it
otherwise would have.

Zbyszek


More information about the systemd-devel mailing list