[lxc-users] LXC Service fails to start in Fedora
Michael H. Warfield
mhw at WittsEnd.com
Thu May 1 16:29:05 UTC 2014
On Thu, 2014-05-01 at 12:18 -0400, Dwight Engen wrote:
> On Thu, 01 May 2014 11:50:55 -0400
> "Michael H. Warfield" <mhw at WittsEnd.com> wrote:
>
> > On Thu, 2014-05-01 at 11:44 -0400, Dwight Engen wrote:
> > > On Thu, 01 May 2014 11:30:02 -0400
> > > "Michael H. Warfield" <mhw at WittsEnd.com> wrote:
> > >
> > > > On Thu, 2014-05-01 at 11:25 -0400, Stéphane Graber wrote:
> > > > > On Thu, May 01, 2014 at 11:19:28AM -0400, Michael H. Warfield
> > > > > wrote:
> > > > > > On Thu, 2014-05-01 at 10:13 -0400, CDR wrote:
> > > > > > > Actually, /usr/libexec/lxc/lxc-startup is a missing object,
> > > > > > > not a directory.
> > > > > > >
> > > > > > > It seems that the code does not include the two objects,
> > > > > > > which are the basis for the LXC service.
> > > > > > >
> > > > > > > Any idea how can this be fixed?
> > > > > > >
> > > > > > > lxc-stratup
> > > > > >
> > > > > > You mean lxc-startup. Yeah that seems to be missing. I
> > > > > > think we man have forgotten to glue a couple of pieces
> > > > > > together. Stéphane did the lxc-autostart stuff while I was
> > > > > > working on the systemd service stuff. lxc-startup was a
> > > > > > temporary shim until lxc-autostart became available. It
> > > > > > wasn't intended to reach release. Maybe we each thought the
> > > > > > other was going to complete that connection or maybe we just
> > > > > > weren't thinking about it at all.
> > > > > >
> > > > > > As a first suggestion, edit the systemd service file:
> > > > > >
> > > > > > /usr/lib/systemd/system/lxc.service
> > > > > >
> > > > > > Change these lines:
> > > > > >
> > > > > > ExecStart=/usr/libexec/lxc/lxc-startup start
> > > > > > ExecStop=/usr/libexec/lxc/lxc-startup stop
> > > > > >
> > > > > > To this:
> > > > > >
> > > > > > ExecStart=/usr/bin/lxc-autostart -a
> > > > > > ExecStop=/usr/bin/lxc-autostart -s
> > > >
> > > > > Care to send a patch for that? :)
> > > >
> > > > That must be a retorical question.
> > > >
> > > > As soon as I can quickly get it tested. I know you're on a
> > > > deadline for 1.0.4. I'm on it.
> >
> > > Hey guys, that will kinda work, but if the auto-started containers
> > > are relying on the bridge setup by libvirt, they can get started
> > > before libvirt has brought up the bridge even if we make this unit
> > > depend on libvirtd.service because that service returns to systemd
> > > before the bridge has been brought up.
> >
> > > What I've done is to call the sysvinit script from ExecStart= and
> > > ExecStop=, and that avoids the problem for me since the sysvinit
> > > script waits for the bridge.
> > > libvirt-guests.service/libvirt-guests.sh is a similar arrangement
> > > where the same script is used as a sysvinit script and is called by
> > > the .service file. If you want I can make lxc's .service file do
> > > similar.
> >
> > That would be an acceptable alternative but doesn't that run into the
> > admonishment not to have the sysvinit script present when there's a
> > systemd service present? I seem to recall something about that.
>
> Yes, that is correct. We don't want to install it as a sysvinit script
> per se, it will be put into @libexec@/lxc with a different name so it
> will only be run from the service file, not by any sysvinit
> compatibility stuff. The contents are the same, it will work when
> called from the service file on a systemd system or by sysvinit on a
> traditional system.
Ok... Sounds reasonable to me. Especially since I screwed up my first
attempt at the patch for the above.
> > I just sent in a patch for the change I proposed. If you feel this is
> > better and their isn't a conflict, I'm fine with canceling my patch
> > and going with your suggestion.
>
> Well I'm testing it now, when that is done I'll send a patch and you
> can see what you think.
>
> > That order dependency could be also handled in the systemd
> > dependencies. I hadn't looked at them before.
>
> I tried that, but as explained above it didn't work because libvirt
> returned to systemd before bringing up the bridge, and thus systemd
> then starts the lxc service thinking that the prerequisite is already
> done.
>
> > > > > > Then try starting.
> > > > > >
> > > > > > Let me know if that works.
> > > > > >
> > > > > > I guess I didn't spot that in my environment because I have
> > > > > > the shim present. :-P
> > > > > >
> > > > > > > lxc-devsetup
> > > > > >
> > > > > > From what I see below, lxc-devsetup was there.
> > > > > >
> > > > > >
> > > > > > > On Thu, May 1, 2014 at 10:05 AM, CDR <venefax at gmail.com>
> > > > > > > wrote: I went ahead and created the directory, but I think
> > > > > > > some code is missing. By the way, this is compiled source
> > > > > > > code. I did create the RPMs and upgraded the distribution's
> > > > > > > RPM's
> > > > > > > systemctl status lxc.service
> > > > > > > lxc.service - LXC Container Initialization and
> > > > > > > Autoboot Code Loaded: loaded
> > > > > > > (/usr/lib/systemd/system/lxc.service; enabled)
> > > > > > > Active: failed (Result: exit-code) since Thu
> > > > > > > 2014-05-01 02:02:37 UTC; 17s ago
> > > > > > > Process: 106
> > > > > > > ExecStart=/usr/libexec/lxc/lxc-startup start (code=exited,
> > > > > > > status=203/EXEC) Process: 78
> > > > > > > ExecStartPre=/usr/libexec/lxc/lxc-devsetup (code=exited,
> > > > > > > status=0/SUCCESS) Main PID: 106 (code=exited,
> > > > > > > status=203/EXEC)
> > > > > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > > > >
> > > > > > That said that lxc-devsetup ran and returned status=0/SUCCESS
> > > > > >
> > > > > > >
> > > > > > > CGroup: /user.slice/user-0.slice/session-1.scope/system.slice/lxc.service
> > > > > > >
> > > > > > > May 01 02:02:37 nat-1 systemd[1]: Failed to start
> > > > > > > LXC Container Initialization and Autoboot Code.
> > > > > > > May 01 02:02:37 nat-1 systemd[1]: Unit lxc.service
> > > > > > > entered failed state.
> > > > > > > May 01 02:02:37 nat-1 lxc-devsetup[78]: /dev is
> > > > > > > devtmpfs
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Thu, May 1, 2014 at 8:58 AM, István Király
> > > > > > > <LaKing at d250.hu> wrote:
> > > > > > > I have no experience with the pre-packed
> > > > > > > rpm, I usually build it from source ...
> > > > > > >
> > > > > > >
> > > > > > > So my questions would be:
> > > > > > >
> > > > > > >
> > > > > > > Can you create and start containers -
> > > > > > > without the service running.
> > > > > > > Does this directory exists, and what if not
> > > > > > > and you create it? /usr/libexec/lxc/lxc-startup
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Thu, May 1, 2014 at 5:57 AM, CDR
> > > > > > > <venefax at gmail.com> wrote:
> > > > > > >
> > > > > > > Dear Friends
> > > > > > > I am using the latest version of LXC
> > > > > > >
> > > > > > > rpm -qa | grep lxc
> > > > > > > lxc-devel-1.0.3-1.fc20.x86_64
> > > > > > > libvirt-daemon-driver-lxc-1.1.3.4-4.fc20.x86_64
> > > > > > > lxc-libs-1.0.3-1.fc20.x86_64
> > > > > > > lxc-1.0.3-1.fc20.x86_64
> > > > > > > lxc-debuginfo-1.0.3-1.fc20.x86_64
> > > > > > >
> > > > > > > systemctl start lxc.service
> > > > > > >
> > > > > > >
> > > > > > > - Unit lxc.service has begun
> > > > > > > starting up. Apr 30 15:51:49 nat-1 lxc-devsetup[8036]:
> > > > > > > Creating /dev/.lxc
> > > > > > > Apr 30 15:51:49 nat-1
> > > > > > > lxc-devsetup[8036]: /dev is devtmpfs
> > > > > > > Apr 30 15:51:49 nat-1
> > > > > > > lxc-devsetup[8036]: Creating /dev/.lxc/user
> > > > > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > > > > That line, right there, is an echo out of lxc-devsetup.
> > > > > > That's obviously there.
> > > > > >
> > > > > > > Apr 30 15:51:49 nat-1 systemd[8042]:
> > > > > > > Failed at step EXEC spawning
> > > > > > > /usr/libexec/lxc/lxc-startup: No
> > > > > > > such file or directory
> > > > > > > -- Subject:
> > > > > > > Process /usr/libexec/lxc/lxc-startup
> > > > > > > could not be executed
> > > > > > > -- Defined-By: systemd
> > > > > > > -- Support:
> > > > > > > http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> > > > > > > --
> > > > > > > -- The
> > > > > > > process /usr/libexec/lxc/lxc-startup could not be executed
> > > > > > > and failed. --
> > > > > > > -- The error number returned while
> > > > > > > executing this process is 2.
> > > > > > > Apr 30 15:51:49 nat-1 systemd[1]:
> > > > > > > lxc.service: main process exited,
> > > > > > > code=exited, status=203/EXEC
> > > > > > > Apr 30 15:51:49 nat-1 systemd[1]:
> > > > > > > Failed to start LXC Container
> > > > > > > Initialization and Autoboot Code.
> > > > > > > -- Subject: Unit lxc.service has
> > > > > > > failed -- Defined-By: systemd
> > > > > > > -- Support:
> > > > > > > http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> > > > > > > --
> > > > > > > -- Unit lxc.service has failed.
> > > > > > >
> > > > > >
> > > > > >
> > > > > > Regards,
> > > > > > Mike
> > > > > > --
> > > > > > Michael H. Warfield (AI4NB) | (770) 978-7061 |
> > > > > > mhw at WittsEnd.com /\/\|=mhw=|\/\/ | (678) 463-0932 |
> > > > > > http://www.wittsend.com/mhw/ NIC whois: MHW9 | An
> > > > > > optimist believes we live in the best of all PGP Key:
> > > > > > 0x674627FF | possible worlds. A pessimist is sure of
> > > > > > it!
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > > _______________________________________________
> > > > > > lxc-users mailing list
> > > > > > lxc-users at lists.linuxcontainers.org
> > > > > > http://lists.linuxcontainers.org/listinfo/lxc-users
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > lxc-users mailing list
> > > > > lxc-users at lists.linuxcontainers.org
> > > > > http://lists.linuxcontainers.org/listinfo/lxc-users
> > > >
> > >
> > >
> >
>
>
--
Michael H. Warfield (AI4NB) | (770) 978-7061 | mhw at WittsEnd.com
/\/\|=mhw=|\/\/ | (678) 463-0932 | http://www.wittsend.com/mhw/
NIC whois: MHW9 | An optimist believes we live in the best of all
PGP Key: 0x674627FF | possible worlds. A pessimist is sure of it!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140501/01af8f0d/attachment.sig>
More information about the lxc-users
mailing list