From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6843D138CD3 for ; Thu, 28 May 2015 18:37:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A2375E0954; Thu, 28 May 2015 18:36:59 +0000 (UTC) Received: from mail-ie0-f171.google.com (mail-ie0-f171.google.com [209.85.223.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9E9A1E0898 for ; Thu, 28 May 2015 18:36:58 +0000 (UTC) Received: by iebgx4 with SMTP id gx4so45324471ieb.0 for ; Thu, 28 May 2015 11:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=T9Ygy13iRQr9oyhpIpeOf0zhdYw9kgPR41MoDUz0n4k=; b=a0Q/Ncu7VVpFNaTzIQUJAq/61iTeloau6NjCST/vlHfHU/foWg05VhT4bIps/pOWjq 8cZ8WAtAkQZ6SZX7dgmrm+EYJFU0g1sjH+F7I4n++cOwDBCzn2ABEHHjEEutNL27lqNP Xu4entNuUxHq6T90/6fatmY/F9EQgav02dulBBzAhZUYj/kKsIIwel5yaz1R/KDWB9AD vTc220toUScIxi3UizAiqLRgQEmBmr5Eol+/EdRKF96BswAyYWgjDbU2zJmKenQ8EP+j MoeIEKxzSQ+RrSsEW1Szrd/5p6X+s0Jr/c7TZ9A26sM3Un/DKs920afhB8IWuI1UZRz2 4+7Q== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 X-Received: by 10.50.44.99 with SMTP id d3mr13032564igm.10.1432838217996; Thu, 28 May 2015 11:36:57 -0700 (PDT) Sender: freemanrich@gmail.com Received: by 10.107.6.34 with HTTP; Thu, 28 May 2015 11:36:57 -0700 (PDT) In-Reply-To: References: <28995.1432789799@ccs.covici.com> <30995.1432793754@ccs.covici.com> <5566BFF9.7040004@xunil.at> <1823.1432798791@ccs.covici.com> <5566CA9F.5040608@xunil.at> <5450.1432801814@ccs.covici.com> Date: Thu, 28 May 2015 14:36:57 -0400 X-Google-Sender-Auth: 9Nr5MZ_NPwuZkMkxKjsec8ZNA5U Message-ID: Subject: Re: [gentoo-user] problems debugging a systemd problem From: Rich Freeman To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: a37ca072-0abb-44e4-a794-8b3ddb342db7 X-Archives-Hash: 3a5b8b42deca153e6cc3cc7b77218555 On Thu, May 28, 2015 at 2:11 PM, Canek Pel=C3=A1ez Vald=C3=A9s wrote: > > Actually, it does work (see attached screenshot). I set my root=3D kernel > command line parameter wrong on purpose, and systemd (inside dracut) drop= ped > me inside a rescue shell. Interesting. Perhaps it just enables shell access. There is a separate option that configures whether dracut drops to a shell at all, or if it just hangs on failure. The latter might be desirable for security purposes in some cases. Are you sure that you don't get a shell if you don't pass emergency on the command line, but still have an invalid root=3D? > >> Usually when somebody >> wants a rescue shell, they want it in their root filesystem, and not >> in their initramfs before it has pivoted. That is why dracut has >> options like rd.break. > > But that doesn't help you at all when the problem is exactly that you can= not > mount your root filesystem. With the rescue shell of systemd (inside > dracut), you can analyze the problem, or perhaps even mount your root > filesystem and continue the boot process; the initramfs should have all t= he > necessary tools to do that. rd.break DOES give you a shell before root is mounted, if you tell it to. rd.shell tells dracut to give you a shell if something fails rd.break forces a shell at the specified point, whether something fails or = not. The official docs do not list emergency as a valid dracut option. Obviously systemd uses it, but again the fact that you had to mangle your root=3D option sugests that systemd within dracut ignores it if it can mount your root. > >> If the problem were with systemd/services/etc in the actual root >> filesystem (once the actual distro has started booting), then putting >> emergency on the command line should get you a rescue shell. > > Again, what if the problem is before *that*? Then you tell dracut to drop to a shell. I wasn't aware that the emergency option actually made a difference, though I'm still not 100% sure that was what did it. > >> The same generally applies to openrc - if the initramfs isn't mounting >> your root filesystem, then passing instructions to openrc won't do >> anything since in that case openrc isn't even running. > > But in this case, systemd *is* inside the initramfs: > > # ls usr/lib/systemd/ > network systemd-cgroups-agent systemd-journald systemd-shutdo= wn > systemd-vconsole-setup > system systemd-fsck systemd-modules-load systemd-sysctl > system-generators > systemd systemd-hibernate-resume systemd-reply-password systemd-udevd > > That's my initramfs. With dracut, systemd *is* the initramfs init system. Sure, and that is how mine works as well. But, obviously systemd in dracut is configured to ignore that parameter when root=3D is valid, otherwise you'd get a shell every time. I'd have to check the docs, but I suspect that the behavior is configurable, and systemd within the initramfs is configured differently. If nothing else they could just make the rescue target launch the default target/etc. -- Rich