supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* Can't run mingetty with runsvdir?
@ 2005-02-20 18:21 Lars Kellogg-Stedman
  2005-02-20 20:56 ` Vincent Danen
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Kellogg-Stedman @ 2005-02-20 18:21 UTC (permalink / raw)


I'm trying to replace the mingetty calls in /etc/inittab with
runit-controlled services.  The inittab entries look like this:

  1:2345:respawn:/sbin/mingetty tty1

I've create a run script for runsv that looks like this:

  #!/bin/sh
  exec mingetty tty1

Unfortunately, this fails with the following error logged in syslog:

  auth.err: Feb 20 12:44:42 mingetty[5609]: tty1: no controlling tty:
  Operation not permitted

Using strace shows that the "Operating not permitted" error is due to a
failed ioctl() call.

  ioctl(3, TIOCSCTTY) = -1 EPERM (Operation not permitted)

According to what little documentation I can find out there, TIOCSCTTY
returns EPERM "If this tty is already the controlling tty  of  a  different
session  group."  But nothing else has tty1 open.

I'm running this service via runsvdir, which itself is started from
/etc/inittab via the following:

  ri:2345:respawn:/sbin/runsvdir /etc/runit/active-services

This is all happening in a Linux 2.6 environment.  Anyone have this
working?  I replaced mingetty with agetty for the time being, which appears
to work, but I'm curious what's making mingetty choke.

-- Lars

-- 
Lars Kellogg-Stedman <lars@oddbit.com>




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Can't run mingetty with runsvdir?
  2005-02-20 18:21 Can't run mingetty with runsvdir? Lars Kellogg-Stedman
@ 2005-02-20 20:56 ` Vincent Danen
  2005-02-21  1:13   ` Lars Kellogg-Stedman
  0 siblings, 1 reply; 5+ messages in thread
From: Vincent Danen @ 2005-02-20 20:56 UTC (permalink / raw)
  Cc: supervision

[-- Attachment #1: Type: text/plain, Size: 2538 bytes --]


On Feb 20, 2005, at 11:21, Lars Kellogg-Stedman wrote:

> I'm trying to replace the mingetty calls in /etc/inittab with
> runit-controlled services.  The inittab entries look like this:
>
>   1:2345:respawn:/sbin/mingetty tty1
>
> I've create a run script for runsv that looks like this:
>
>   #!/bin/sh
>   exec mingetty tty1
>
> Unfortunately, this fails with the following error logged in syslog:
>
>   auth.err: Feb 20 12:44:42 mingetty[5609]: tty1: no controlling tty:
>   Operation not permitted
>
> Using strace shows that the "Operating not permitted" error is due to a
> failed ioctl() call.
>
>   ioctl(3, TIOCSCTTY) = -1 EPERM (Operation not permitted)
>
> According to what little documentation I can find out there, TIOCSCTTY
> returns EPERM "If this tty is already the controlling tty  of  a  
> different
> session  group."  But nothing else has tty1 open.
>
> I'm running this service via runsvdir, which itself is started from
> /etc/inittab via the following:
>
>   ri:2345:respawn:/sbin/runsvdir /etc/runit/active-services
>
> This is all happening in a Linux 2.6 environment.  Anyone have this
> working?  I replaced mingetty with agetty for the time being, which 
> appears
> to work, but I'm curious what's making mingetty choke.

This is what I'm using here and it works great:

[vdanen@titan vdanen]$ cat /service/mingetty-tty1/run
#!/bin/sh
chpst -P /sbin/mingetty --noclear tty1


However, note that I don't use init at all (I suspect you'll need to 
completely remove those mingetty lines from inittab).  I use runit as 
init.  I have 6 tty's setup this way (only tty1 has the --noclear 
option just so we don't wipe out boot information).

Hope that helps a bit.

FWIW, the Annvix CVS repository has a lot of run scripts tucked away 
for services that, for the most part (with openldap being somewhat 
problematic) work great for a number of serivces we use.  Anyone is 
free to poke through the CVS for our runscripts.

http://annvix.org/cgi-bin/viewcvs.cgi/packages/

All daemons are run under supervise except for autofs (still need to 
get around to that or switch to amd).  Could be useful to some folks (I 
know someone was having issues with nfs on the list... if they go to 
the CVS and look in the nfs-utils package, they can see the two 
runscripts we use to handle nfs services which seem to work pretty good 
over here).

-- 
Annvix - Secure Linux Server: http://annvix.org/
"lynx -source http://linsec.ca/vdanen.asc | gpg --import"
{FEE30AD4 : 7F6C A60C 06C2 4811 FA1C  A2BC 2EBC 5E32 FEE3 0AD4}

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Can't run mingetty with runsvdir?
  2005-02-20 20:56 ` Vincent Danen
@ 2005-02-21  1:13   ` Lars Kellogg-Stedman
  2005-02-21 17:13     ` Charlie Brady
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Kellogg-Stedman @ 2005-02-21  1:13 UTC (permalink / raw)


> chpst -P /sbin/mingetty --noclear tty1

Alas, even with 'chpst -P' the behavior is for the same, even for ttys
which have not previously had any sort of getty running on them.

> FWIW, the Annvix CVS repository has a lot of run scripts tucked away for
> services that, for the most part ... work great for a number of serivces
> we use.  Anyone is free to poke through the CVS for our runscripts.

Thanks for the pointer; I'll take a look.

-- Lars

-- 
Lars Kellogg-Stedman <lars@oddbit.com>




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Can't run mingetty with runsvdir?
  2005-02-21  1:13   ` Lars Kellogg-Stedman
@ 2005-02-21 17:13     ` Charlie Brady
  2005-02-21 17:29       ` Lars Kellogg-Stedman
  0 siblings, 1 reply; 5+ messages in thread
From: Charlie Brady @ 2005-02-21 17:13 UTC (permalink / raw)
  Cc: supervision


On Mon, 21 Feb 2005, Lars Kellogg-Stedman wrote:

> > chpst -P /sbin/mingetty --noclear tty1
> 
> Alas, even with 'chpst -P' the behavior is for the same, even for ttys
> which have not previously had any sort of getty running on them.

If you are using linux, try this:

chpst -P /usr/bin/openvt -c 1 -w /sbin/mingetty --noclear tty1




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Can't run mingetty with runsvdir?
  2005-02-21 17:13     ` Charlie Brady
@ 2005-02-21 17:29       ` Lars Kellogg-Stedman
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Kellogg-Stedman @ 2005-02-21 17:29 UTC (permalink / raw)


> chpst -P /usr/bin/openvt -c 1 -w /sbin/mingetty --noclear tty1

I had to add '-f' to force it, but this finally worked:

  chpst -P /usr/bin/openvt -c 1 -w -f -- /sbin/mingetty --noclear tty1

Still not sure why...the call trace for mingetty by itself and
mingetty run via openvt is remarkably similar.  I'm using agetty now, which
requires fewer hoops to jump through, so I'll probably stick with it for
the time being.

-- Lars

-- 
Lars Kellogg-Stedman <lars@oddbit.com>




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-02-21 17:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-20 18:21 Can't run mingetty with runsvdir? Lars Kellogg-Stedman
2005-02-20 20:56 ` Vincent Danen
2005-02-21  1:13   ` Lars Kellogg-Stedman
2005-02-21 17:13     ` Charlie Brady
2005-02-21 17:29       ` Lars Kellogg-Stedman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).