Skip to content

Fixed the format problem of the generated .timer file.#22107

Merged
MikeMcQuaid merged 1 commit intoHomebrew:mainfrom
choems:fix-timer-file-format
Apr 29, 2026
Merged

Fixed the format problem of the generated .timer file.#22107
MikeMcQuaid merged 1 commit intoHomebrew:mainfrom
choems:fix-timer-file-format

Conversation

@choems
Copy link
Copy Markdown
Contributor

@choems choems commented Apr 28, 2026

I noticed two problems.
First, the format of OnCalendar. According to the manual page of systemd.time(7), it should be like this.
585036896-88add5ce-5e8d-45bf-8f5d-b32d118ca5cb
And this is the current format: "OnCalendar=#{@Cron[:Weekday]}-*-#{@Cron[:Month]}-#{@Cron[:Day]} #{hours}:#{minutes}:00"

The second problem is the "Unit=" field under [Timer]. It should contain the service suffix, that is, .service, otherwise you will get message like this: /home/choems/.config/systemd/user/homebrew.logrotate.timer:8: Unit type not valid, ignoring: homebrew.logrotate

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

@choems choems changed the title Fixed the format problem of the .timer file. The test content related… Fixed the format problem of the generated .timer file. Apr 28, 2026
Comment thread Library/Homebrew/service.rb
Comment thread Library/Homebrew/service.rb Outdated
@MikeMcQuaid
Copy link
Copy Markdown
Member

@choems I'll fix CI, hold for now 😁

… to .timer has been modified.

The format of the Unit field in [Timer] has been modified so that systemd no longer issues warnings.

Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
@MikeMcQuaid MikeMcQuaid force-pushed the fix-timer-file-format branch from f536aca to 518b6b2 Compare April 29, 2026 12:43
Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @choems, great work!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Apr 29, 2026
Merged via the queue into Homebrew:main with commit 071cbe3 Apr 29, 2026
36 checks passed
@choems choems deleted the fix-timer-file-format branch April 29, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants