Comments (12)
@logopk need to figure out a way to detect that from code.
from homebrew-services.
When I ssh into a remote mac brew services restart does not work.
Apparently since end of September with the introduction of systemctl and the warning about user/* and gui/* domains(9f7d575)
brew services restart node_exporter --debug only shows a repeated
▶ brew services stop node_exporter --debug /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaAPILoader): loading node_exporter from API ==> /bin/launchctl list homebrew.mxcl.node_exporter { "StandardOutPath" = "/usr/local/var/log/node_exporter.log"; "LimitLoadToSessionType" = "Aqua"; "StandardErrorPath" = "/usr/local/var/log/node_exporter.err.log"; "Label" = "homebrew.mxcl.node_exporter"; "OnDemand" = true; "LastExitStatus" = 0; "PID" = 40425; "Program" = "/usr/local/opt/node_exporter/bin/node_exporter_brew_services"; "ProgramArguments" = ( "/usr/local/opt/node_exporter/bin/node_exporter_brew_services"; ); }; Stopping `node_exporter`... (might take a while) Warning: running over SSH, using user/* instead of gui/* domain! Hide this warning by setting HOMEBREW_SERVICES_NO_DOMAIN_WARNING. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). ==> /bin/launchctl list homebrew.mxcl.node_exporter { "StandardOutPath" = "/usr/local/var/log/node_exporter.log"; "LimitLoadToSessionType" = "Aqua"; "StandardErrorPath" = "/usr/local/var/log/node_exporter.err.log"; "Label" = "homebrew.mxcl.node_exporter"; "OnDemand" = true; "LastExitStatus" = 0; "PID" = 40425; "Program" = "/usr/local/opt/node_exporter/bin/node_exporter_brew_services"; "ProgramArguments" = ( "/usr/local/opt/node_exporter/bin/node_exporter_brew_services"; ); }; ==> /bin/launchctl list homebrew.mxcl.node_exporter { "StandardOutPath" = "/usr/local/var/log/node_exporter.log"; "LimitLoadToSessionType" = "Aqua"; "StandardErrorPath" = "/usr/local/var/log/node_exporter.err.log"; "Label" = "homebrew.mxcl.node_exporter"; "OnDemand" = true; "LastExitStatus" = 0; "PID" = 40425; "Program" = "/usr/local/opt/node_exporter/bin/node_exporter_brew_services"; "ProgramArguments" = ( "/usr/local/opt/node_exporter/bin/node_exporter_brew_services"; ); }; ....loooooop
Any idea why and how I can further troubleshoot this?
Native on the machine it works without a problem.
▶ brew config HOMEBREW_VERSION: 4.1.20-11-g6de29c2 ORIGIN: https://github.com/Homebrew/brew HEAD: 6de29c2f65c909bcc38432feafdaa71322d8bf78 Last commit: 12 hours ago Core tap origin: https://github.com/Homebrew/homebrew-core Core tap HEAD: ec3a0feb573154833c186388cbd3f8b11d213813 Core tap last commit: 8 hours ago Core tap branch: master Core tap JSON: 14 Nov 08:15 UTC HOMEBREW_PREFIX: /usr/local HOMEBREW_CASK_OPTS: [] HOMEBREW_GITHUB_API_TOKEN: set HOMEBREW_MAKE_JOBS: 8 HOMEBREW_SORBET_RUNTIME: set Homebrew Ruby: 2.6.10 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.10_1/bin/ruby CPU: octa-core 64-bit haswell Clang: 13.0.0 build 1300 Git: 2.42.1 => /usr/local/bin/git Curl: 8.1.2 => /usr/bin/curl macOS: 12.7.1-x86_64 CLT: 14.2.0.0.1.1668646533 Xcode: 13.2.1
▶ brew services restart node_exporter --debug /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaAPILoader): loading node_exporter from API ==> /bin/launchctl list homebrew.mxcl.node_exporter { "StandardOutPath" = "/usr/local/var/log/node_exporter.log"; "LimitLoadToSessionType" = "Aqua"; "StandardErrorPath" = "/usr/local/var/log/node_exporter.err.log"; "Label" = "homebrew.mxcl.node_exporter"; "OnDemand" = true; "LastExitStatus" = 0; "PID" = 10832; "Program" = "/usr/local/opt/node_exporter/bin/node_exporter_brew_services"; "ProgramArguments" = ( "/usr/local/opt/node_exporter/bin/node_exporter_brew_services"; ); }; ==> /bin/launchctl list homebrew.mxcl.node_exporter { "StandardOutPath" = "/usr/local/var/log/node_exporter.log"; "LimitLoadToSessionType" = "Aqua"; "StandardErrorPath" = "/usr/local/var/log/node_exporter.err.log"; "Label" = "homebrew.mxcl.node_exporter"; "OnDemand" = true; "LastExitStatus" = 0; "PID" = 10832; "Program" = "/usr/local/opt/node_exporter/bin/node_exporter_brew_services"; "ProgramArguments" = ( "/usr/local/opt/node_exporter/bin/node_exporter_brew_services"; ); }; ==> /bin/launchctl list homebrew.mxcl.node_exporter { "StandardOutPath" = "/usr/local/var/log/node_exporter.log"; "LimitLoadToSessionType" = "Aqua"; "StandardErrorPath" = "/usr/local/var/log/node_exporter.err.log"; "Label" = "homebrew.mxcl.node_exporter"; "OnDemand" = true; "LastExitStatus" = 0; "PID" = 10832; "Program" = "/usr/local/opt/node_exporter/bin/node_exporter_brew_services"; "ProgramArguments" = ( "/usr/local/opt/node_exporter/bin/node_exporter_brew_services"; ); }; Stopping `node_exporter`... (might take a while) ==> /bin/launchctl print gui/501/homebrew.mxcl.node_exporter ==> /bin/launchctl print gui/501/homebrew.mxcl.node_exporter ==> Successfully stopped `node_exporter` (label: homebrew.mxcl.node_exporter) ==> Successfully started `node_exporter` (label: homebrew.mxcl.node_exporter) ``
from homebrew-services.
Once I replace
"user/#{Process.uid}"
with
"gui/#{Process.uid}"
in homebrew-services/lib/service/system.rb everything works... :-)
from homebrew-services.
"gui/#{Process.uid}"
in homebrew-services/lib/service/system.rb everything works... :-)
This will only work if a user is already logged in. That said: I think it would be a good idea to make this behaviour either configurable or detect the cases like yours in which it could/should work.
Will review PRs!
from homebrew-services.
AFAIK User-Services will run only if a user has been logged in once. This works in my case for gitlab-runner and node-exporter (as LauchAgents).
rsyslogd runs as root without login (as LaunchDaemon)
from homebrew-services.
When I ssh into a remote mac brew services restart does not work.
We would need to add an option to allow you to force the usage of gui/*
in that case. You cannot start services that way reliably unless the same user is already logged into a GUI session.
Again: this could be perhaps be detected automatically and handled via code.
from homebrew-services.
We would need to add an option to allow you to force the usage of
gui/*
in that case. You cannot start services that way reliably unless the same user is already logged into a GUI session.Again: this could be perhaps be detected automatically and handled via code.
Hi @MikeMcQuaid and thanks for the amazing software.
I kinda have the same issue when I ssh into my other Mac where I have local taps with brew services configured.
Should it be possible to add maybe a ENV
var that handle this?
Maybe something like this: (using a ENV var HOMEBREW_FORCE_SSH_GUI
)
def domain_target
if root?
"system"
elsif ((ssh_tty = ENV.fetch("HOMEBREW_SSH_TTY", nil).present?) || ENV.fetch("HOMEBREW_SUDO_USER", nil).present?)
&& ENV.fetch("HOMEBREW_FORCE_SSH_GUI", nil).nil?
if @output_warning.blank? && ENV.fetch("HOMEBREW_SERVICES_NO_DOMAIN_WARNING", nil).blank?
if ssh_tty
opoo "running over SSH, using user/* instead of gui/* domain!"
else
opoo "running through sudo, using user/* instead of gui/* domain!"
end
unless Homebrew::EnvConfig.no_env_hints?
puts "Hide this warning by setting HOMEBREW_SERVICES_NO_DOMAIN_WARNING."
puts "Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`)."
end
@output_warning = true
end
"user/#{Process.uid}"
else
"gui/#{Process.uid}"
end
end
(Sorry but I don’t know Ruby that much)
from homebrew-services.
When I ssh into a remote mac brew services restart does not work.
We would need to add an option to allow you to force the usage of
gui/*
in that case. You cannot start services that way reliably unless the same user is already logged into a GUI session.Again: this could be perhaps be detected automatically and handled via code.
@MikeMcQuaid Thanks for your support. Just to clarify: I am logged in (with the same user) on the remote machine. When I ssh into the machine from remote (VPN or so) the problem starts.
from homebrew-services.
بمجرد استبدال
"user/#{Process.uid}"
مع.
"gui/#{Process.uid}"
في homebrew-services/lib/service/system.rb كل شيء يعمل...:-)
https://github.com/Homebrew/homebrew-core
from homebrew-services.
Related Issues (20)
- their error when brew services not work HOT 2
- `restart_delay` on MacOS doesn't appear to do anything HOT 5
- Auto completion errors HOT 6
- formula.plist_path is deprecated HOT 9
- Starting a service with sudo does allow it to run on user login HOT 3
- Mariadb cant start HOT 4
- brew services failed (Error: uninitialized constant Homebrew::Service)
- when I run `brew services`, it returned 'Error: Unknown command: services' HOT 6
- Error: /usr/local/var/homebrew/linked/telnet is not inside a keg HOT 2
- Services missing from `brew services list` output on macOS 13.5.1 HOT 4
- Services stop running after I logout system. HOT 1
- `sudo brew services` is broken in linux HOT 1
- Add information about logs to help: `brew services --help` HOT 4
- Homebrew Services logs don't exist on MacBook Pro M2 (arm64) after at least failed attempt to run `dnscrypt-proxy` HOT 4
- HOWTO: Setting up a parallel redis service as a custom service? HOT 1
- Error on execute a "brew services start mongodb-community" command HOT 4
- Error starting service HOT 1
- brew services cannot find plist file for installed packaged HOT 4
- brew service generating invalid systemd service HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebrew-services.