init: support job output being passed to start/initctl invocation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
Triaged
|
Wishlist
|
Unassigned | ||
vsftpd (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
When logged in via SSH, instead of the output being directed to the PTY of interest, when a jobfile contains console output it redirects the output to the local console (be it serial, terminal console, etc).
This probably could be solved by simply dup'ing and execve'ing for the file descriptor instances that invoked initctl, or something similar to that, or by looking at getenv("SSH_TTY"), etc to get the appropriate TTY file descriptor set for ssh. Not sure how to do this for telnet, etc though if you follow the latter method.
SSH invocation:
[comet-k5-12:~]$ start console_output
[comet-k5-12:~]$ env
HOSTNAME=
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
SSH_CLIENT=
SSH_TTY=/dev/pts/1
USER=root
MAIL=/var/mail/root
PATH=/usr/
INPUTRC=
PWD=/root
PS1=[\h:\w]$
SHLVL=1
HOME=/root
LOGNAME=root
SSH_CONNECTION=
_=/bin/env
[comet-k5-12:~]$
Local console:
[comet-k5-12:~]$ env
HOSTNAME=
TERM=linux
SHELL=/bin/bash
HISTSIZE=1000
USER=root
MAIL=/var/mail/root
PATH=/usr/
INPUTRC=
PWD=/root
PS1=[\h:\w]$
SHLVL=1
HOME=/root
LOGNAME=root
_=/bin/env
[comet-k5-12:~]$ And then there was Foo
Telnet data:
gcooper@
Trying 172.27.242.248...
Connected to comet-k5-12.
Escape character is '^]'.
Linux 2.6.24.4.59.43.k5 (comet-k5-12) (0)
comet-k5-12 login: root
Password:
Last login: Mon Feb 9 18:02:47 from 171.70.172.107
[comet-k5-12:~]$ env
REMOTEHOST=
HOSTNAME=
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
USER=root
MAIL=/var/mail/root
PATH=/usr/
:/usr/binos/
.200806023/bin
INPUTRC=
PWD=/root
PS1=[\h:\w]$
SHLVL=1
HOME=/root
LOGNAME=root
DISPLAY=
_=/bin/env
[comet-k5-12:~]$ start console_output
[comet-k5-12:~]$ lsof | grep telnetd
in.telnet 9568 root txt REG 0,13 116010 534187 /usr/sbin/in.telne
td (/dev/root)
[comet-k5-12:~]$ lsof | grep telnet
xinetd 1884 root 5u IPv4 2244 TCP *:telnet (LISTEN)
in.telnet 9568 root cwd DIR 0,13 1190 526749 / (/dev/root)
in.telnet 9568 root rtd DIR 0,13 1190 526749 / (/dev/root)
in.telnet 9568 root txt REG 0,13 116010 534187 /usr/sbin/
in.telnet 9568 root mem REG 0,13 246796 527265 /lib/libresolv-
in.telnet 9568 root mem REG 0,13 58014 527288 /lib/libnss_
in.telnet 9568 root mem REG 0,13 186144 527338 /lib/libnss_
in.telnet 9568 root mem REG 0,13 7891259 527255 /lib/libc-2.3.4.so (/dev/root)
in.telnet 9568 root mem REG 0,13 335307 539802 /usr/lib/
in.telnet 9568 root mem REG 0,13 30370 527336 /lib/libutil-
in.telnet 9568 root mem REG 0,13 532536 527340 /lib/ld-2.3.4.so (/dev/root)
in.telnet 9568 root 0u IPv4 7415 TCP 172.27.
in.telnet 9568 root 1u IPv4 7415 TCP 172.27.
in.telnet 9568 root 2u IPv4 7415 TCP 172.27.
in.telnet 9568 root 3u CHR 5,2 176 /dev/ptmx
[comet-k5-12:~]$
Changed in upstart: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
Oh yeah, almost forgot the version info:
[comet-k5-12:~]$ init --version
init (upstart 0.5.0)
Copyright (C) 2008 Canonical Ltd.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[comet-k5-12:~]$ uname -a
Linux comet-k5-12 2.6.24.4.59.43.k5 #2 Tue Feb 3 16:19:49 PST 2009 ppc ppc ppc GNU/Linux