supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* s6-linux-init and ttys in lxc containers
@ 2022-03-08 15:17 Hoël Bézier
  2022-03-08 15:58 ` Laurent Bercot
  0 siblings, 1 reply; 2+ messages in thread
From: Hoël Bézier @ 2022-03-08 15:17 UTC (permalink / raw)
  To: supervision

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

Hi,

I’m using s6 and s6-linux-init inside lxc containers.

My /sbin/init (created with s6-linux-init-maker) contains the following:

```
#!/bin/execlineb -S0

s6-linux-init -c "/etc/s6-linux-init/current" -m 0022 -p "/usr/bin:/bin" -C -- "$@"
```

Right after starting my container with `lxc-start -F <container-name>`, I get 
the following warning message:

s6-linux-init: warning: unable to ttyname stdout: No such device

I suspect this is due to the mechanism described on 
https://github.com/lxc/lxd/issues/1724#issuecomment-194412831, although I’m not 
using LXD, only lxc (which does not have a daemon running as root). Note that 
s6-linux-init has been compiled against the musl libc, so the musl ttyname C 
function may have the same issue as the glibc one.

That’s not a really serious issue, but I figured I’d still mention it here.

Hoël

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: s6-linux-init and ttys in lxc containers
  2022-03-08 15:17 s6-linux-init and ttys in lxc containers Hoël Bézier
@ 2022-03-08 15:58 ` Laurent Bercot
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Bercot @ 2022-03-08 15:58 UTC (permalink / raw)
  To: supervision

>s6-linux-init: warning: unable to ttyname stdout: No such device
>
>I suspect this is due to the mechanism described on https://github.com/lxc/lxd/issues/1724#issuecomment-194412831, although I’m not using LXD, only lxc (which does not have a daemon running as root).

  You're right, it's the exact same issue. If /proc/1/fd/1 does not
point to a valid pts in the container, then ttyname() will be unable to
resolve it and you will get that warning message - and you also will be
unable to transmit your controlling terminal to stage 2 (which is not a
problem in your case).

  The only solution, I'm afraid, is to make sure your pseudo-filesystems
are correctly prepared before you launch your container, which you may
not be able to do without root privileges. Docker can do it; if you
were running lxd there would probably be a way to do it as well. But if
you have no use for a controlling terminal, you can forget about all 
this
and just ignore the warning.

--
  Laurent


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

end of thread, other threads:[~2022-03-08 15:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 15:17 s6-linux-init and ttys in lxc containers Hoël Bézier
2022-03-08 15:58 ` Laurent Bercot

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).