Difference between revisions of "util-vserver:Logging"

From Linux-VServer

Jump to: navigation, search
(the intermediate result of my investigations)
 
Line 16: Line 16:
  
 
(what is different to (A)? to be investigated/documented)
 
(what is different to (A)? to be investigated/documented)
 +
 +
[[Category:Configuration]]

Latest revision as of 22:17, 21 October 2011

[edit] Accessing vserver startup output

Where is the startup output of vservers going?

[edit] (A) when using vserver init styles others than "plain":

(for example without any /etc/vservers/<name>/apps/init/style setting)

  • "vserver <name> <command>" by itself will not do any redirection, thus print and read to/from the current terminal/whatever.
  • /etc/init.d/vservers will typically run lib/util-vserver/vserver-wrapper which will redirect stdin/out/err from/to the value at /etc/vservers/guest/apps/init/tty, /etc/vservers/.defaults/apps/init/tty or if neither is set, /dev/null. NOTE: just linking to a normal file will log to that file, but currently also open stdin from that file, which may have bad consequences if some programs actually reads from stdin (it may even create an endless loop appending and reading from the file). (pflanze has started looking into changing this (opening stdin from /dev/null if the link is pointing to a file) but has run out of energy right now.)

You have to keep this in mind: if for some reason a vserver does not start upon host reboot, but starts without problems with "vserver <name> start", that could be because a program in your vserver's scripts/* directory depends on having access to a terminal. This is (like it is with every system service) one of the differences between starting vservers from host's init process or from a login shell (others being resource limits and environment variables).

[edit] (B) when using vserver init style "plain"

(what is different to (A)? to be investigated/documented)

Personal tools