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

detach chromium from shell script PID when using brew provided wrapper #104850

Merged
merged 2 commits into from May 4, 2021

Conversation

fabio42
Copy link
Contributor

@fabio42 fabio42 commented May 1, 2021

This simple shell wrapper is provided to execute chromium from command line.
The way it is defined, chromium will have the PID /bin/sh as PPID:

  501 77821  1088   0  6:24pm ttys028    0:01.53 -zsh
  501 78177 77821   0  6:24pm ttys028    0:00.01 /bin/sh /usr/local/bin/chromium
  501 78181 78177   0  6:24pm ttys028    0:01.83 /Applications/Chromium.app/Contents/MacOS/Chromium

I'm using chromedp to interact with chromium/Chrome, and this
behaviour triggers some issues. When the execution context is done in
the library, it triggers the termination of the shell process instead of the chromium process and
chromium is left as an orphan process on the system.

There is an open issue documenting this behaviour here

Using exec will detach chomium process from the shell, and will provide
expected behaviour when called with such libraries; user
experience when calling chromium from the shell will not change.

  501 77821  1088   0  6:24pm ttys028    0:01.61 -zsh
  501 93092 77821   0  6:26pm ttys028    0:01.40 /Applications/Chromium.app/Contents/MacOS/Chromium

Thank you.

Important: Do not tick a checkbox if you haven’t performed its action. Honesty is indispensable for a smooth review process.

After making all changes to a cask, verify:

Additionally, if adding a new cask:

  • Named the cask according to the token reference.
  • Checked the cask was not already refused.
  • Checked the cask is submitted to the correct repo.
  • brew audit --new-cask {{cask_file}} worked successfully.
  • brew install --cask {{cask_file}} worked successfully.
  • brew uninstall --cask {{cask_file}} worked successfully.

This simple shell wrapper is provided to execute chromium from command line.
The way it is defined, chromium will have the PID `/bin/sh` as PPID:

```
  501 77821  1088   0  6:24pm ttys028    0:01.53 -zsh
  501 78177 77821   0  6:24pm ttys028    0:00.01 /bin/sh /usr/local/bin/chromium
  501 78181 78177   0  6:24pm ttys028    0:01.83 /Applications/Chromium.app/Contents/MacOS/Chromium
```

I'm using chromedp to interact with `chromium/Chrome`, and this
behaviour triggers some issues. When the execution context is done in
the library, it triggers the termination of the shell process instead of the chromium process and
chromium is left as an orphan process on the system.

There is an open issue documenting this behaviour [here](chromedp/chromedp#752)

Using `exec` will detach `chomium` process from the shell, and will provide
expected behaviour when called with such libraries; user
experience when calling `chromium` from the shell will not change.

```
  501 77821  1088   0  6:24pm ttys028    0:01.61 -zsh
  501 93092 77821   0  6:26pm ttys028    0:01.40 /Applications/Chromium.app/Contents/MacOS/Chromium
```

Thank you.
@miccal miccal merged commit 4f7f421 into Homebrew:master May 4, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants