[lxc-users] autostart
Stéphane Graber
stgraber at ubuntu.com
Sat Feb 22 16:32:46 UTC 2014
On Sat, Feb 22, 2014 at 05:02:53PM +0100, Tamas Papp wrote:
> hi All,
>
>
> What lxc-autostart should do?
>
> If I run 'lxc-autostart -a' I see containers from host like this:
>
> 38942 ? Ss 0:00 lxc-autostart -a
> 38999 ? Ss 0:00 \_ /sbin/init
> 39221 ? S 0:00 \_ upstart-udev-bridge --daemon
> 39291 ? Ss 0:00 \_ /sbin/udevd --daemon
> 40327 ? S 0:00 | \_ /sbin/udevd --daemon
> 39292 ? Ss 0:00 \_ /usr/sbin/sshd -D
> 39316 ? Sl 0:00 \_ rsyslogd -c5
> 39349 ? S 0:00 \_ upstart-socket-bridge --daemon
> 39356 pts/133 Ss+ 0:00 \_ /sbin/getty -8 38400 tty4
> 39364 pts/124 Ss+ 0:00 \_ /sbin/getty -8 38400 tty2
> 39370 pts/125 Ss+ 0:00 \_ /sbin/getty -8 38400 tty3
> 39382 ? Ss 0:00 \_ cron
> 39407 ? Ss 0:00 \_ /usr/sbin/nrpe -c
> /etc/nagios/nrpe.cfg -d
> 39414 ? Ssl 0:00 \_ /usr/sbin/nscd
> 39435 ? Ss 0:00 \_ /usr/sbin/munin-node
> 39952 ? Ss 0:00 \_ /usr/lib/postfix/master
> 39994 ? S 0:00 | \_ pickup -l -t fifo -u -c
> 39995 ? S 0:00 | \_ qmgr -l -t fifo -u
> 40023 ? S 0:00 \_ /usr/sbin/snmpd -Lf /dev/null -u
> snmp -g snmp -I -smux -p /var/run/snmpd.pid
> 40089 pts/134 Ss+ 0:00 \_ /sbin/getty -8 38400 console
> 40095 pts/123 Ss+ 0:00 \_ /sbin/getty -8 38400 tty1
>
> The same with -g:
>
> # lxc-autostart -g
> lxc-autostart: option requires an argument -- 'g'
>
> If a group name is specified as an argument, it started. So it looks, it
> doesn't list, but starts the containers.
> However, not this process list format is quite ugly:
>
> 38942 ? Ss 0:00 lxc-autostart -a
> 38999 ? Ss 0:00 \_ /sbin/init
>
>
> $ lxc-autostart -L
> or
> $ lxc-autostart -L -g <GROUP> returns nothing
>
> Also it seems that containers don't start automatically, if lxc.group is
> set.
lxc-autostart => starts all stopped containers that have lxc.start.auto = 1 and no lxc.group
lxc-autostart -g blah => starts all stopped containers that have lxc.start.auto = 1 and lxc.group = blah
lxc-autostart -a => starts all stopped containers that have lxc.start.auto = 1, regardless of groups
It's indeed correct that if you add a lxc.group to your container, then
lxc-autostart won't start it, unless you pass -g <group name>.
As for the process name, there's no magic there, lxc-autostart is the
one calling the start() API function, so it's the one being forked into
the background. Short of doing some rather weird tricks with prctl to
rename the process (and lie about what exactly spawned the container),
there isn't much we can do.
>
>
> Thanks,
> tamas
>
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140222/aaf56d59/attachment.pgp>
More information about the lxc-users
mailing list