OK, tried it both ways, but output is truncated by vzctl stop.
For example the following init script:
-----------------
#!/bin/sh
# file must be there - create it
echo >/var/log/init.log
export CONSOLE=/var/log/init.log
exec /sbin/init.org
-----------------
then I start the VE and try to view the log:
> vzctl start 777
> tail -100f /var/lib/vz/root/777/var/log/init.log
stty: standard input: Inappropriate ioctl for device
/etc/rcS.d/S03udev: line 265: echo: write error: Operation not permitted
Activating swap...done.
mount: permission denied
Cleaning up ifupdown....
....
That works quite good so far, but when I stop the VE the file gets
truncated:
tail: /var/lib/vz/root/777/var/log/init.log: file truncated
Any idea why? I already searched the sysvinit code sources, but found
nothing there.
- Dietmar
> or you can replace /sbin/init with some script adding this to
> env and running original init binary.
>
> Kirill
>
> Dietmar Maurer wrote:
> > But I cant do that with current vzctl, instead I need to modify the
> > source?
> >
> > env.c 301: char *envp[] = {"HOME=/", "TERM=linux",
> > "CONSOLE=/var/log/init.log", NULL};
> >