[Pkg-kbd-devel] Bug#610373: kbd: openvt -e fails with ioctl TIOCSCTTY: Operation not permitted
Michael Schutte
michi at uiae.at
Sat Jan 22 22:59:27 UTC 2011
Daniel,
On Tue, Jan 18, 2011 at 10:28:38PM +0100, Michael Schutte wrote:
> On Mon, Jan 17, 2011 at 09:23:29PM -0500, Daniel Kahn Gillmor wrote:
> > And it prints the following message on the allocated vt:
> >
> > ioctl TIOCSCTTY: Operation not permitted
>
> And thank you for your report, I can confirm the problem. The issue in
> a nutshell is that without forking, openvt cannot create a session
> because it already is a process group leader; this prohibits it from
> using TIOCSCTTY. I’ll have a closer look at how to fix this as soon as
> I can.
As far as I can tell, this behavior is intentional: openvt spawns as a
session leader if it is started by init, and this appears to be the
intended use case according to the manpage. If you need “openvt -e” in
another context (say, because you need the PID of the program you want
to exec), you can use fork() and setsid() (or setsid(2)).
Is this an acceptable workaround for you? Fixing openvt to make the -e
option work all the time would be a little ugly (it would have to fork a
helper process to take over as the process group leader), so I’d prefer
to solve this bug by explaining the situation in the man page.
All the best,
--
Michael Schutte | michi@{uiae.at,debian.org}
Innsbruck, Austria | happily accepting encrypted mail
OpenPGP: 0x16fb 517b a866 c3f6 8f11 1485 f3e4 122f 1D8C 261A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-kbd-devel/attachments/20110122/649fbfd2/attachment.pgp>
More information about the Pkg-kbd-devel
mailing list