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

Plists generated via service blocks are broken #274

Closed
vintagesucks opened this issue Apr 28, 2021 · 7 comments
Closed

Plists generated via service blocks are broken #274

vintagesucks opened this issue Apr 28, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@vintagesucks
Copy link
Sponsor

Describe the bug
The service plists are broken since they get generated via service blocks.

PHP versions
All of them, but I'll focus on 8.0 in this bug report.

To Reproduce

brew install shivammathur/php/php@8.0
brew services start shivammathur/php/php

Expected behavior
~/Library/LaunchAgents/homebrew.mxcl.php.plist looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>homebrew.mxcl.php</string>
    <key>ProgramArguments</key>
    <array>
      <string>/opt/homebrew/opt/php/sbin/php-fpm</string>
      <string>--nodaemonize</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>WorkingDirectory</key>
    <string>/opt/homebrew/var</string>
    <key>StandardErrorPath</key>
    <string>/opt/homebrew/var/log/php-fpm.log</string>
  </dict>
</plist>

Notice how ProgramArguments is an array and includes --nodaemonize.

Screenshots/Logs
Since the recent change to generate plists via service blocks the generated plist looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>KeepAlive</key>
	<true/>
	<key>Label</key>
	<string>homebrew.mxcl.php</string>
	<key>ProgramArguments</key>
	<string>/opt/homebrew/opt/php/sbin/php-fpm</string>
	<key>RunAtLoad</key>
	<true/>
	<key>StandardErrorPath</key>
	<string>/opt/homebrew/var/log/php-fpm.log</string>
	<key>WorkingDirectory</key>
	<string>/opt/homebrew/var</string>
</dict>
</plist>

No ProgramArguments array, no --nodaemonize. Starting the service fails:

brew services start shivammathur/php/php 
Bootstrap failed: 5: Input/output error
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/nikolas/Library/LaunchAgents/homebrew.mxcl.php.plist` exited with 5.

Additional context

brew config:

HOMEBREW_VERSION: 3.1.4-24-g8d35744
ORIGIN: https://github.com/Homebrew/brew
HEAD: 8d3574458178bf1594475444986b44171a7c527e
Last commit: 2 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 99a41050d89b6983a9f5aa310cf79a0f7218b568
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 12.0 build 1205
Git: 2.31.1 => /opt/homebrew/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.2.3-arm64
CLT: 12.5.0.0.1.1617976050
Xcode: N/A
Rosetta 2: false

Are you willing to submit a PR?
Sure.

@vintagesucks vintagesucks added the bug Something isn't working label Apr 28, 2021
@shivammathur
Copy link
Owner

@vintagesucks
I have reverted 919b5af till there is a fix upstream.

@asentner

This comment has been minimized.

@shivammathur

This comment has been minimized.

@shivammathur
Copy link
Owner

Fixed upstream. Reverted the revert 😅

@vintagesucks
Copy link
Sponsor Author

@shivammathur Thanks!

@thinkbulecount2
Copy link

Hi,

I came across the same problem when running brew services start php@7.2

Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/502 ~/Library/LaunchAgents/homebrew.mxcl.php@7.2.plist` exited with 5.

@thinkbulecount2
Copy link

thinkbulecount2 commented Dec 5, 2022

plist looks like this:

	<key>ProgramArguments</key>
	<array>
		<string>/opt/homebrew/opt/php@7.2/sbin/php-fpm</string>
		<string>--nodaemonize</string>
	</array>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants