| Summary: | Hangup to script while forced command ... | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Damien Touraine <webmyster> | ||||
| Component: | sshd | Assignee: | OpenSSH Bugzilla mailing list <openssh-bugs> | ||||
| Status: | CLOSED WORKSFORME | ||||||
| Severity: | normal | ||||||
| Priority: | P2 | ||||||
| Version: | 3.9p1 | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Attachments: |
|
||||||
|
Description
Damien Touraine
2005-02-17 22:58:42 AEDT
Try setting setting no-pty on the key too. E.g. no-pty,command="xscript" ssh-rsa .... Does that help? HUP is only sent to shells with a controlling terminal (In reply to comment #1) > Try setting setting no-pty on the key too. E.g. > > no-pty,command="xscript" ssh-rsa .... > > Does that help? HUP is only sent to shells with a controlling terminal Actually no, because this script is asking the user through the read bash command inside the script. The most important problem, I think, is the strange behaviour that whenever I specify one command (whatever command), it don't hang up my xinit. However, when I don't give any command, a hangup is send to the xinit causing X-window to shutdown. (In reply to comment #2) > > no-pty,command="xscript" ssh-rsa .... > > Actually no, because this script is asking the user through the read bash > command inside the script. Did you try it? "read" just reads from stdin and doesn't need a controlling terminal. > The most important problem, I think, is the strange behaviour that whenever I > specify one command (whatever command), it don't hang up my xinit. However, > when I don't give any command, a hangup is send By default, when you "ssh yourserver" you get a pty and when you "ssh yourserver somecommand" you don't. Try "ssh -T yourserver" to prevent allocation of a pty. You could also launch the command in your script with nohup. Created attachment 829 [details]
script running as forced-command
Here is the script I am running as forced-command. As you can see, there is
already nohup to launch commands.
The problem when I set no-pty in the authorized-files, is that the display
seems strange (loosing the width of the term). But the most important problem
is the fact that I can't type anything. I must kill this script from another
console.
However, the command "ssh -t user@computer" works fine !
This isn't an SSH bug, your SIGHUPs are a result of the process' controlling terminal going away. You can either:
1. Run without a pty as Darren suggested
2. Ensure that startx is called without a controlling terminal. Linux has a setsid(8) command for this, otherwise you might be able to use something like:
perl -e 'use POSIX ; setsid();'
3. Make your script stick around until the X session exits by not backgrounding itself or by explictly calling the "wait" shell builtin.
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4. |