I'm interested in running some long-ish scripts that loop through the dump replicas on Toolforge. Eventually, this sort of thing might move to crontab, but for now it would be nice to run a screen session as we test / debug the scripts. The problem is that if I run the scripts from my tool account (i.e. after "become <tool-name>"), I get the following error: Cannot open your terminal '/dev/pts/28' - please check.
The internet indicates that this is because there is a user mismatch because of the "become" command [1]. The suggested solutions weren't clearly applicable: * I can't just skip the "become" step and run the screen session as my personal username as that's explicitly against the rules [2] (though it is possible to start a screen session from my personal username without getting the above error). * It's not clear to me that running the screen session as /dev/null is possible / smart / secure etc. Essentially, I don't have a great read on whether that actually is the correct solution or just another bad hack.
So is it possible to run screen sessions from my tool account? If so, does anyone know how I might get around this issue?
[1] https://stackoverflow.com/questions/21328140/screen-cannot-open-your-termina... [2] https://wikitech.wikimedia.org/wiki/Help:Toolforge/Rules
Best, Isaac
When you ssh into the bastion host, make sure you use the "-t" option to ssh. That forces a pseudo-terminal to get allocated.
I have no clue why that's not the default.
On Jun 23, 2020, at 10:47 AM, Isaac Johnson isaac@wikimedia.org wrote:
I'm interested in running some long-ish scripts that loop through the dump replicas on Toolforge. Eventually, this sort of thing might move to crontab, but for now it would be nice to run a screen session as we test / debug the scripts. The problem is that if I run the scripts from my tool account (i.e. after "become <tool-name>"), I get the following error: Cannot open your terminal '/dev/pts/28' - please check.
The internet indicates that this is because there is a user mismatch because of the "become" command [1]. The suggested solutions weren't clearly applicable:
- I can't just skip the "become" step and run the screen session as my personal username as that's explicitly against the rules [2] (though it is possible to start a screen session from my personal username without getting the above error).
- It's not clear to me that running the screen session as /dev/null is possible / smart / secure etc. Essentially, I don't have a great read on whether that actually is the correct solution or just another bad hack.
So is it possible to run screen sessions from my tool account? If so, does anyone know how I might get around this issue?
[1] https://stackoverflow.com/questions/21328140/screen-cannot-open-your-termina... https://stackoverflow.com/questions/21328140/screen-cannot-open-your-terminal-dev-pts-0-please-check [2] https://wikitech.wikimedia.org/wiki/Help:Toolforge/Rules https://wikitech.wikimedia.org/wiki/Help:Toolforge/Rules
Best, Isaac
-- Isaac Johnson (he/him/his) -- Research Scientist -- Wikimedia Foundation _______________________________________________ Wikimedia Cloud Services mailing list Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/cloud
On 2020-06-23 16:47, Isaac Johnson wrote:
I'm interested in running some long-ish scripts that loop through the dump replicas on Toolforge. Eventually, this sort of thing might move to crontab, but for now it would be nice to run a screen session as we test / debug the scripts. The problem is that if I run the scripts from my tool account (i.e. after "become <tool-name>"), I get the following error: Cannot open your terminal '/dev/pts/28' - please check.
You shouldn't run such script on the bastions.
The grid is the way to go in this case:
https://wikitech.wikimedia.org/wiki/Help:Toolforge/Grid
Run your script with jsub and it will be scheduled in a grid worker node to run until it finishes.
regards.
Thanks Arturo -- that's what I needed to know. I'll use jsub instead.
When you ssh into the bastion host, make sure you use the "-t" option to
ssh. And thanks Roy for the idea, though for the record, that did not fix the issue.
Best, Isaac
On Tue, Jun 23, 2020 at 10:30 AM Arturo Borrero Gonzalez < aborrero@wikimedia.org> wrote:
On 2020-06-23 16:47, Isaac Johnson wrote:
I'm interested in running some long-ish scripts that loop through the
dump
replicas on Toolforge. Eventually, this sort of thing might move to
crontab, but
for now it would be nice to run a screen session as we test / debug the
scripts.
The problem is that if I run the scripts from my tool account (i.e. after "become <tool-name>"), I get the following error: Cannot open your
terminal
'/dev/pts/28' - please check.
You shouldn't run such script on the bastions.
The grid is the way to go in this case:
https://wikitech.wikimedia.org/wiki/Help:Toolforge/Grid
Run your script with jsub and it will be scheduled in a grid worker node to run until it finishes.
regards.
-- Arturo Borrero Gonzalez SRE / Wikimedia Cloud Services Wikimedia Foundation
Hi,
On 2020-06-23 07:47, Isaac Johnson wrote:
I'm interested in running some long-ish scripts that loop through the dump replicas on Toolforge. Eventually, this sort of thing might move to crontab, but for now it would be nice to run a screen session as we test / debug the scripts. The problem is that if I run the scripts from my tool account (i.e. after "become <tool-name>"), I get the following error: Cannot open your terminal '/dev/pts/28' - please check.
Using `script /dev/null` is the advice on https://wikitech.wikimedia.org/wiki/Screen#Troubleshooting, but I don't know what the security consequences/implications are either.
-- Legoktm
Using `script /dev/null` is the advice on <
https://wikitech.wikimedia.org/wiki/Screen#Troubleshooting%3E, but I don't know what the security consequences/implications are either. Ahh...thanks for pointing that out. I searched just the Toolforge documentation on Wikitech and so completely missed that page. I'll add the information Arturo added about jsub.
On Tue, Jun 23, 2020 at 6:44 PM Kunal Mehta legoktm@member.fsf.org wrote:
Hi,
On 2020-06-23 07:47, Isaac Johnson wrote:
I'm interested in running some long-ish scripts that loop through the dump replicas on Toolforge. Eventually, this sort of thing might move to crontab, but for now it would be nice to run a screen session as we test / debug the scripts. The problem is that if I run the scripts from my tool account (i.e. after "become <tool-name>"), I get the following error: Cannot open your terminal '/dev/pts/28' - please check.
Using `script /dev/null` is the advice on https://wikitech.wikimedia.org/wiki/Screen#Troubleshooting, but I don't know what the security consequences/implications are either.
-- Legoktm