[Devel] capturing init output

Dietmar Maurer dietmar at maurer-it.com
Wed Dec 12 03:19:12 PST 2007


Hi all,

here is an init wrapper to capture the output from init. It uses a named
pipe, and an additional logging process to read that named pipe and
writes it into a file.

(sysvinit uses open without O_APPEND, so setting CONSOLE=filename will
never
work)


compile with:
> gcc -O2 -Wall -lc vzinit.c -o vzinit

Copy it into the VE:
> mv VPSDIR/sbin/init VPSDIR/sbin/init.org
> cp vzinit VPSDIR/sbin/init 

the start the VE:

> vzctl start 777
> tail -100f VPSDIR/var/log/init.log

What do you think? Should I write a patch to vzctl, or is there a better
way to do it?

- Dietmar

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vzinit.c
Type: application/octet-stream
Size: 3090 bytes
Desc: vzinit.c
URL: <http://lists.openvz.org/pipermail/devel/attachments/20071212/640c85c6/attachment-0001.obj>


More information about the Devel mailing list