From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harald Hoyer Subject: Re: [Patch v2 2/2] let user specify action after systemd start dracut-emergency Date: Fri, 31 May 2013 09:25:03 +0200 Message-ID: <51A8504F.8020601@redhat.com> References: <078c160e62c2c750efe71fc8a05dd7c5de71bde3.1369816679.git.bhe@redhat.com> <51A712D0.80002@redhat.com> <51A718C8.9070406@redhat.com> <51A726D0.9070509@redhat.com> <51A72AF4.6070700@redhat.com> <51A84E34.5060906@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51A84E34.5060906-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Sender: initramfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Baoquan Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 05/31/2013 09:16 AM, Baoquan wrote: > On 05/30/2013 06:33 PM, Harald Hoyer wrote: > >> worksforme... with >> http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=b78e6ac2c328c76057b17059a761ab44707f9aa0 >> and >> "rd.shell rd.break action_on_fail=continue" >> >> dracut-pre-pivot[227]: /lib/dracut-lib.sh@933(_emergency_shell): systemctl start >> dracut-emergency.service >> Trying to enqueue job dracut-emergency.service/start/replace >> Installed new job dracut-emergency.service/start as 39 >> Enqueued job dracut-emergency.service/start as 39 >> Starting of dracut-emergency.service requested but condition failed. Ignoring. >> Job dracut-emergency.service/start finished, result=done >> >> .. no rd.shell on rd.break... >> > > > Hi Harald, > > I tried your method, add > > > 1)"rd.break=pre-pivot action_on_fail=continue" to kernel cmdline; > > 2)add "ConditionKernelCommandLine=!action_on_fail=continue" into > dracut-emergency.service > > it works very well, won't drop into shell. And this works for 1st kernel > and kdump kernel. > > However, when I tried the mount failed method, it doesn't work. > > 1)"rd.break=pre-pivot action_on_fail=continue" to kernel cmdline; > > 2)add "ConditionKernelCommandLine=!action_on_fail=continue" into > dracut-emergency.service > > 3)change root to a wrong name in /proc/cmdline to make mount root failed. > > :/# cat /proc/cmdline > root=/dev/mapper/fedora-root111 action_on_fail=continue ..... > > In this way, it always drops into shell. This is why I said to double check, if you are dropped to dracut-emergency.service versus emergency.service.