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

[Feature request]: A flatpak command to wait for an application to exit #5503

Open
2 tasks done
g2p opened this issue Aug 24, 2023 · 0 comments
Open
2 tasks done

[Feature request]: A flatpak command to wait for an application to exit #5503

g2p opened this issue Aug 24, 2023 · 0 comments

Comments

@g2p
Copy link

g2p commented Aug 24, 2023

Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Suggestion

I would like to wait for an app to close from the CLI (example use case: run umount on an external disk after an app that uses it is done).

At the moment I found two awkward ways to do it:

  • figure out the pid by grepping flatpak ps output for a matching application name ([Feature request]: JSON command output format #5499 would help), use tail -f /dev/null --pid $pid to wait for it (tail does kill(pid, 0) every second)
  • figure out the pid, use it to build flatpak's systemd user unit scope name, and wait for that to finish using systemd: systemctl --user start --wait app-flatpak-$app-$pid.scope

The first option is technically racy, the second relies on those scope names being predictable.

RFE: provide flatpak wait INSTANCE to wait until an instance has exited. Non-zero exit if the instance doesn't exist. Possibly provide a --timeout flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant