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

Don't print pgrep advice if options not supported locally. #2499

Closed
hjoliver opened this issue Dec 4, 2017 · 4 comments · Fixed by #2501
Closed

Don't print pgrep advice if options not supported locally. #2499

hjoliver opened this issue Dec 4, 2017 · 4 comments · Fixed by #2501
Assignees
Labels
Milestone

Comments

@hjoliver
Copy link
Member

hjoliver commented Dec 4, 2017

At start-up:

[INFO] *** listening on host01:43046 ***
[INFO]
[INFO] To view suite daemon contact information:
[INFO]  $ cylc get-suite-contact junk
[INFO]
[INFO] Other ways to see if the suite is still running:
[INFO]  $ cylc scan -n '\bjunk\b' host01
[INFO]  $ cylc ping -v --host=host01 junk
[INFO]  $ ssh host01 "pgrep -a -P 1 -fu $USER 'cylc-r.* \bjunk\b'" <--------------

The marked line is meant to print the parent PID and command line of a cylc-run or cylc-restart process for the suite, not those of the sub-process pool.

But it's been brought to my attention that some sites have a less capable version of pgrep:

pgrep: invalid option -- a
Usage: pgrep [-flvx] [-d DELIM] [-n|-o] [-P PPIDLIST] [-g PGRPLIST] [-s SIDLIST]
[-u EUIDLIST] [-U UIDLIST] [-G GIDLIST] [-t TERMLIST] [PATTERN]
@hjoliver
Copy link
Member Author

hjoliver commented Dec 4, 2017

We could either not print this line if the right pgrep is not present, or figure out how to get the same information without it.

@hjoliver hjoliver added the small label Dec 4, 2017
@matthewrmshin matthewrmshin added this to the soon milestone Dec 4, 2017
@matthewrmshin
Copy link
Contributor

Yes, a user has reported this to us some time ago as well.

These days, we actually have the PID of the suite running process at the point this message is printed out, so we can just use a ps command. See logic under:
https://github.com/cylc/cylc/blob/038e334bf017df2fb72d43b3152e96354ba9a974/lib/cylc/suite_srv_files_mgr.py#L137
which uses ps -opid,args PID to determine if the suite is still alive or not.

@hjoliver
Copy link
Member Author

hjoliver commented Dec 4, 2017

Good point, that would undoubtedly be simplest!

Also, we should not print the ssh HOST prefix. It should be obvious that you have to look for a process on the host that it is running on.

@matthewrmshin matthewrmshin self-assigned this Dec 4, 2017
@matthewrmshin
Copy link
Contributor

I guess we can do something like this.

[INFO]  $ ps -opid,args 123456  # on host1

@matthewrmshin matthewrmshin modified the milestones: soon, next release Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants