Summary: | app-emulation/lxc-0.7.2-r1 init script | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Vadim Kuznetsov (RETIRED) <vadimk> |
Component: | New packages | Assignee: | Diego Elio Pettenò (RETIRED) <flameeyes> |
Status: | RESOLVED OBSOLETE | ||
Severity: | normal | CC: | karsten.elfenbein, virtualization |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Vadim Kuznetsov (RETIRED)
![]() Hmm you're right regarding the INT... guess I'll have to see if TERM works as well. Actually, I just tested around, and -INT with ca:12345:ctrlaltdel:/sbin/shutdown -r now does not cause a restart within the container: * Stopping D-BUS system messagebus ... [ ok ] * Terminating remaining processes ... * /etc/init.d/killprocs: send: Bad file descriptor [ ok ] * Killing remaining processes ... [ ok ] * Saving dependency cache ... [ ok ] INIT: no more processes left in this runlevel are you sure it does so for you? (In reply to comment #2) > are you sure it does so for you? Yes, I am sure. Just retested. You gotta start your test from STOPPED state, i.e. edit inittab before you start container. If you watch -n 1 lxc-ps ax --lxc, you may actually see /sbin/rc reboot instead of /sbin/rc shutdown Yes, sure, okay.. but it won't arrive to the reboot() syscall, init will stop after all process are gone, unable to do anything else... AFAICT no init script beside kexec (which is pointless within lxc anyway) changes behaviour depending on shutdown or reboot.. (In reply to comment #4) > Yes, sure, okay.. but it won't arrive to the reboot() syscall, init will stop > after all process are gone, unable to do anything else... Before kill: CONTAINER PID TTY STAT TIME COMMAND gentoo 20350 ? Ss 0:00 init [3] gentoo 20759 ? Ss 0:00 dhcpcd -m 2 eth0 gentoo 20810 ? Ss 0:00 /usr/sbin/sshd gentoo 20831 pts/4 Ss+ 0:00 /sbin/agetty 38400 console gentoo 20832 pts/3 Ss+ 0:00 /sbin/agetty 38400 tty1 linux After kill (lxc-kill -n gentoo 2), container like new: CONTAINER PID TTY STAT TIME COMMAND gentoo 22721 ? Ss 0:00 init [3] gentoo 23123 ? Ss 0:00 dhcpcd -m 2 eth0 gentoo 23174 ? Ss 0:00 /usr/sbin/sshd gentoo 23195 pts/4 Ss+ 0:00 /sbin/agetty 38400 console gentoo 23196 pts/3 Ss+ 0:00 /sbin/agetty 38400 tty1 linux Container went though states: 'gentoo' changed state to [STARTING] 'gentoo' changed state to [RUNNING] 'gentoo' changed state to [STOPPING] 'gentoo' changed state to [STOPPED] 'gentoo' changed state to [STARTING] 'gentoo' changed state to [RUNNING] > AFAICT no init script beside kexec (which is pointless within lxc anyway) > changes behaviour depending on shutdown or reboot.. > sorry, what? Hrmmmm will double-check tomorrow, for now... sleep =_= could you also add a check if the ${container}.log exists before removing the file i guess everybody knows already so this comment is only to continue discussion: lxc-start restarting container after "shutdown -r" since commit 91480a0f0a62732f3115d556b689d62d574294ae. http://lxc.git.sourceforge.net/git/gitweb.cgi?p=lxc/lxc;a=commitdiff;h=91480a0f0a62732f3115d556b689d62d574294ae I think after this patch INT+sleep for n seconds is not so good idea. Probably if we will pull the init till it dies it could make a gap between stop&start short enough, but i'd prefer to have an opportunity to customize shutdown procedure (i.g. for containers without an init). Well, as an alternative we could just send -PWR to container's init which along with appropriate powerfail[now] entry will works too, but not all of distros provide such entry in inittab (really i haven't seen any) so it will not work "out of the box" anyway. If it will be useful, my own version is here: https://github.com/gluk/gentoo-init/blob/master/lxc This version has been removed. Re-open if the bug is still relevant |