forwarding to the list because I forgot to use reply-to-all - sorry.
--- Begin Message ---
>> If we want to have a back-channel, we'd need a socket, which makes just
>> doing echo RUNNING > /dev/lxc-notify impossible, you'd need a special
>> program for that. Having the template scripts dump an additional script
>> or upstart job or systemd unit file or whatever in the container when
>> creating it seems a lot easier than having to use a special program.
>
> Well, talking to a socket is really easy from the command line too:
> echo status STARTING | nc -U /dev/lxc_socket
>
> It's depending on netcat but netcat is part of all distros and even
> exists in busybox (in a stripped down version).
Unfortunately, I know of at least 4 different netcat implementations (my
count includes Busybox's implementation) and only one of those 4
different implementations supports -U and/or UNIX domain sockets, that
is the one from OpenBSD, which is NOT the standard one that is installed
with many distros, including Debian and Gentoo. I don't think one should
rely on that.
But I thought about it and came up with the following Perl "one-liner"
that should do the trick:
echo status RUNNING | perl -e \
'use IO::Socket;
$client = IO::Socket::UNIX->new(
Peer => "FILENAME",
Type => SOCK_STREAM,
Timeout => 10);
while (<>) { print $client $_; }'
So yeah, a socket would probably be the better choice, the question now
is what kind of protocol should be specified...
Christian
--- End Message ---
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel