Ticket #106 (closed defect: fixed)

Opened 2 years ago

Last modified 17 months ago

rc-logging inside openvz container does not work

Reported by: Alexander <piavka@cs.bgu.ac.il> Owned by: roy
Priority: normal Milestone:
Component: rc Version:
Keywords: Cc:

Description (last modified by roy) (diff)

rc-logging inside openvz container does not work

Attachments

strace-rc.log Download (120.2 KB) - added by anonymous 22 months ago.
rc-logger-tty.patch Download (1.3 KB) - added by mwrobel 17 months ago.
rc-logger-tty.2.patch Download (1.0 KB) - added by mwrobel 17 months ago.

Change History

comment:475 Changed 2 years ago by Alexander <piavka@cs.bgu.ac.il>

I've OpenVZ container with openrc and rc_logger="YES" set in /etc/rc.conf but /var/log/rc.log is not created.

comment:476 Changed 2 years ago by roy

Does /lib/rc/init.d/rc.log exist?

comment:481 Changed 2 years ago by Alexander <piavka@cs.bgu.ac.il>

no /lib/rc/init.d/rc.log does not exist

comment:500 Changed 2 years ago by roy

I guess I'll have to find the time to install OpenVZ then .... which I don't have right now and I'm out of other ideas.

comment:501 Changed 23 months ago by roy

  • Description modified (diff)

comment:502 follow-up: ↓ 503 Changed 23 months ago by roy

  • Description modified (diff)

I am 100% convinced this is because /dev/ptmx is not available OR devpts is not correctly mounted on /dev/pts.

If you enable rc_parallel in rc.conf, is all the service output indented to the right or just some of it?

comment:503 in reply to: ↑ 502 Changed 22 months ago by anonymous

Replying to roy:

I am 100% convinced this is because /dev/ptmx is not available OR devpts is not correctly mounted on /dev/pts.

/dev/ptmx is available and /dev/pts mounted , and it is used , for example then i ssh to VE
a new /dev/pts/X device is created

# ls -la /dev/ptmx
crw-rw-rw- 1 root tty 5, 2 2008-10-17 01:11 /dev/ptmx
# mount | grep pts
devpts on /dev/pts type devpts (rw,nosuid,noexec)
# ls -la /dev/pts
total 0
drwxr-xr-x 2 root root 0 2008-09-17 23:23 .
drwxr-xr-x 6 root root 460 2008-09-17 23:23 ..
crw--w---- 1 root tty 136, 0 2008-10-17 01:14 0

If you enable rc_parallel in rc.conf, is all the service output indented to the right or just > some of it?

I don't quite understand what you mean, since in openvz I can not see the boot proccess of VE anyway, whats why i enabled the rc.log in the first place.

comment:504 Changed 22 months ago by anonymous

tried with sys-apps/openrc-0.3.0-r1 - and it also does not create rc.log file

comment:505 Changed 22 months ago by roy

Inside the VE with rc logging enabled, can you do this please?

strace -o strace-rc.log rc
And attach strace-rc.log to this ticket?
Thanks

Changed 22 months ago by anonymous

comment:506 Changed 22 months ago by anonymous

from a fast skim of strace-rc.log i see that /dev/pts/1 is created and
opened with fd 6, and then stdin and stdout are duplicated to /dev/pts/1 without problems.
But i do not see a trace of rc.log.

comment:507 Changed 21 months ago by anonymous

any progress?

Alex

comment:508 Changed 21 months ago by roy

Not yet. Every OpenVZ kernel I make panics on my laptop.
Plus I'm severly space limited here for new kernels right now.

I've not forgotten about this, but this is not that high on my agenda.

Changed 17 months ago by mwrobel

comment:509 Changed 17 months ago by mwrobel

The error is in rc-logger.c in rc_logger_open(). It calls isatty(STDOUT_FILENO) and returns if the standard output is not a tty. In the OpenVZ case the standard output is not a tty and rc-logger refuses to work. I've attached a patch that changes this behavior.

Changed 17 months ago by mwrobel

comment:510 Changed 17 months ago by mwrobel

I'm sorry for spamming, but the first patch has bad whitespace (tabs converted to spaces).

comment:511 follow-up: ↓ 512 Changed 17 months ago by roy

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r106, thanks.

So OpenVZ containers don't echo to any kind of console when booting then?

comment:512 in reply to: ↑ 511 Changed 17 months ago by mwrobel

No, they don't. stdout is redirected to /dev/null. So it's very useful to have rc-logger working.

Note: See TracTickets for help on using tickets.