Difference between revisions of "util-vserver:Logging"

From Linux-VServer

Jump to: navigation, search
 
m (some reformatting and more detail)
Line 3: Line 3:
 
Where is the startup output of vservers going?
 
Where is the startup output of vservers going?
  
* when using init styles others than "plain" (for example without any style setting):
+
(A) when using init styles others than "plain" (for example without any style setting):
  
** "vserver <name> start" will not do any redirection, thus print to the current output.
+
* "vserver <name> <command>" by itself will not do any redirection, thus print and read to/from the current terminal/whatever.
  
** "/etc/init.d/vservers start" will typically run <tt>lib/util-vserver/vserver-wrapper</tt> 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).
+
* <tt>/etc/init.d/vservers</tt> will typically run <tt>lib/util-vserver/vserver-wrapper</tt> which will redirect stdin/out/err from/to the value at <tt>/etc/vservers/guest/apps/init/tty</tt>, <tt>/etc/vservers/.defaults/apps/init/tty</tt> 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).
 +
 
 +
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).

Revision as of 18:06, 10 February 2007

Accessing vserver startup output

Where is the startup output of vservers going?

(A) when using init styles others than "plain" (for example without any 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).

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

Personal tools