{"thread":{"id":"60589","subject":"t7900 fails with recent debian systemd?","startedAt":"2023-12-06T22:31:46Z","lastAt":"2023-12-07T06:27:54Z","messageCount":4,"participants":["Jeff King","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"485401","messageId":"20231206223145.GA638844@coredump.intra.peff.net","threadId":"60589","inReplyTo":null,"subject":"t7900 fails with recent debian systemd?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-12-06T22:31:45Z","receivedAt":"2023-12-06T22:31:46Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"I noticed t7900 failing today. The failure looks like this:\n\n  $ ./t7900-maintenance.sh -v -i -x\n  [...]\n  + systemd-analyze verify systemd/user/git-maintenance@hourly.service\n  Unit git-maintenance@hourly.service not found.\n  error: last command exited with $?=1\n  not ok 36 - start and stop Linux/systemd maintenance\n\nThe problem started after upgrading my Debian unstable system to the\nsystemd 255~rc4-2 deb. Downgrading back to 254.5-1 makes the test pass\nagain.\n\nI'm sure it's something silly with finding paths in XDG_CONFIG_HOME or\nsomething like that. I haven't dug further, but I thought I'd post this\nto save somebody else going through the same initial debugging. (And of\ncourse any wisdom or further debugging is greatly appreciated).\n\n-Peff\n"},{"id":"485402","messageId":"20231206223612.GA650770@coredump.intra.peff.net","threadId":"60589","inReplyTo":"20231206223145.GA638844@coredump.intra.peff.net","subject":"Re: t7900 fails with recent debian systemd?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-12-06T22:36:12Z","receivedAt":"2023-12-06T22:36:13Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Dec 06, 2023 at 05:31:45PM -0500, Jeff King wrote:\n\n> I noticed t7900 failing today. The failure looks like this:\n> \n>   $ ./t7900-maintenance.sh -v -i -x\n>   [...]\n>   + systemd-analyze verify systemd/user/git-maintenance@hourly.service\n>   Unit git-maintenance@hourly.service not found.\n>   error: last command exited with $?=1\n>   not ok 36 - start and stop Linux/systemd maintenance\n> \n> The problem started after upgrading my Debian unstable system to the\n> systemd 255~rc4-2 deb. Downgrading back to 254.5-1 makes the test pass\n> again.\n> \n> I'm sure it's something silly with finding paths in XDG_CONFIG_HOME or\n> something like that. I haven't dug further, but I thought I'd post this\n> to save somebody else going through the same initial debugging. (And of\n> course any wisdom or further debugging is greatly appreciated).\n\nAfter stracing, it is indeed looking for:\n\n  trash directory.t7900-maintenance/systemd/user/git-maintenance@hourly.service\n\nbut that file doesn't exist. We installed git-maintenance@hourly.timer,\nand git-maintenance@.service. Is the latter supposed to be a wildcard of\nsome kind? Maybe the rules changed. I don't really know anything about\nsystemd.\n\n-Peff\n"},{"id":"485403","messageId":"CAPig+cT-vCraf2tfA3t3Rh6mLNTr0rB5mApmz0vu2MCRvssaVw@mail.gmail.com","threadId":"60589","inReplyTo":"20231206223612.GA650770@coredump.intra.peff.net","subject":"Re: t7900 fails with recent debian systemd?","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2023-12-06T22:40:59Z","receivedAt":"2023-12-06T22:41:11Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Dec 6, 2023 at 5:36 PM Jeff King <peff@peff.net> wrote:\n> After stracing, it is indeed looking for:\n>\n>   trash directory.t7900-maintenance/systemd/user/git-maintenance@hourly.service\n>\n> but that file doesn't exist. We installed git-maintenance@hourly.timer,\n> and git-maintenance@.service. Is the latter supposed to be a wildcard of\n> some kind? Maybe the rules changed. I don't really know anything about\n> systemd.\n\nApparently, that's intentional. From builtin/gc.c:\n\n    /*\n     * No matter the schedule, we use the same service and can make\n     * use of the templating system. When installing\n     * git-maintenance@<schedule>.timer, systemd will notice that\n     * git-maintenance@.service exists as a template and will use this\n     * file and insert the <schedule> into the template at the\n     * position of \"%i\".\n     */\n    static int systemd_timer_write_service_template(const char *exec_path)\n    {\n        char *local_service_name = xstrfmt(SYSTEMD_UNIT_FORMAT, \"\", \"service\");\n\nI'm not sure why the comment is talking about \"%i\", though.\n"},{"id":"485411","messageId":"20231207062752.GA777253@coredump.intra.peff.net","threadId":"60589","inReplyTo":"CAPig+cT-vCraf2tfA3t3Rh6mLNTr0rB5mApmz0vu2MCRvssaVw@mail.gmail.com","subject":"Re: t7900 fails with recent debian systemd?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-12-07T06:27:52Z","receivedAt":"2023-12-07T06:27:54Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Dec 06, 2023 at 05:40:59PM -0500, Eric Sunshine wrote:\n\n> On Wed, Dec 6, 2023 at 5:36 PM Jeff King <peff@peff.net> wrote:\n> > After stracing, it is indeed looking for:\n> >\n> >   trash directory.t7900-maintenance/systemd/user/git-maintenance@hourly.service\n> >\n> > but that file doesn't exist. We installed git-maintenance@hourly.timer,\n> > and git-maintenance@.service. Is the latter supposed to be a wildcard of\n> > some kind? Maybe the rules changed. I don't really know anything about\n> > systemd.\n> \n> Apparently, that's intentional. From builtin/gc.c:\n> \n>     /*\n>      * No matter the schedule, we use the same service and can make\n>      * use of the templating system. When installing\n>      * git-maintenance@<schedule>.timer, systemd will notice that\n>      * git-maintenance@.service exists as a template and will use this\n>      * file and insert the <schedule> into the template at the\n>      * position of \"%i\".\n>      */\n>     static int systemd_timer_write_service_template(const char *exec_path)\n>     {\n>         char *local_service_name = xstrfmt(SYSTEMD_UNIT_FORMAT, \"\", \"service\");\n\nOK, that makes sense, and this is indeed the way to do template files in\nsystemd.\n\n> I'm not sure why the comment is talking about \"%i\", though.\n\nThe \"%i\" replacement is done on the contents of the template file\nitself. So inside git-maintenance@.service, the ExecStart line specifies\nthat we should run \"git maintenance run --schedule=%i\".\n\nThis looks like a regression in systemd itself. I was able to bisect and\nI left a comment there:\n\n  https://github.com/systemd/systemd/pull/30172#issuecomment-1844699620\n\nI don't really see a way to work around it within our test suite, short\nof just skipping the \"systemd-analyze verify\" calls entirely. Hopefully\nmy analysis is right and they will fix it soon, and we can consider it\n\"not our problem\" on this end. :)\n\n-Peff\n"}]}