Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better detection of started/stopped services #1

Open
1 of 4 tasks
NanoSector opened this issue Mar 13, 2021 · 2 comments
Open
1 of 4 tasks

Better detection of started/stopped services #1

NanoSector opened this issue Mar 13, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@NanoSector
Copy link
Owner

NanoSector commented Mar 13, 2021

Brewed tries to detect stopped services by watching for file deletion events on the plist file specified by Homebrew:
https://github.com/Yoshi2889/Brewed/blob/e0f244be15d33be41f7e49431bdc3afe3b6a5908/Brewed/Model/ManagedServices.swift#L39-L42

While this works in many cases, it only works for stopped services. Right now services which get started after Brewed won't get detected.

This may be solvable by letting Brewed guess plist locations; these seem to be set in the format homebrew.mxcl.{formula}.

Tasks:

  • Make brewed detect services stopped via brew services stop, when started through either run or start
  • Make Brewed detect services started via brew services start
  • Make Brewed detect services started via brew services run
  • Do not pointlessly watch plist files in /usr/local/opt
@NanoSector NanoSector added enhancement New feature or request help wanted Extra attention is needed labels Mar 13, 2021
@NanoSector
Copy link
Owner Author

We cannot monitor for creation of files by creating a file monitor at the expected locations since code in FileMonitor expects the files to actually exist. An alternative approach would be to somehow monitor the agent/daemon directories for file creation events and filter based on the expected name.

@NanoSector
Copy link
Owner Author

#4 fixed part of this, however there still remains an issue when a service is just 'run' and not actually started. Homebrew then points to the /usr/local/opt/ directory and these files will always exist. Brewed watches these, but pointlessly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant