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 F2E091381F3 for ; Sat, 22 Jun 2013 11:13:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 02847E0B49; Sat, 22 Jun 2013 11:13:41 +0000 (UTC) Received: from spot.xmw.de (spot.xmw.de [176.9.87.236]) by pigeon.gentoo.org (Postfix) with ESMTP id 0337CE0B36 for ; Sat, 22 Jun 2013 11:13:39 +0000 (UTC) Received: from [IPv6:2001:6f8:1cd1:0:21d:72ff:fe88:9ac1] (x.l.xmw.de [IPv6:2001:6f8:1cd1:0:21d:72ff:fe88:9ac1]) by spot.xmw.de (Postfix) with ESMTPSA id DB9C814123658 for ; Sat, 22 Jun 2013 13:13:38 +0200 (CEST) Message-ID: <51C586DB.9040005@gentoo.org> Date: Sat, 22 Jun 2013 13:13:31 +0200 From: Michael Weber User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130610 Thunderbird/17.0.6 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] Re: eselect init References: <51A08A68.3020900@gentoo.org> <20130620205609.GB23719@linux1> <20130621043959.7eae0921@gentoo.org> <51C42B33.9090709@gentoo.org> <1371814006.2486.10.camel@localhost> <51C43DEA.6000006@gentoo.org> <20130621143657.GA26044@linux1> <1371829739.2486.20.camel@localhost> <1371895644.30388.7.camel@localhost> In-Reply-To: <1371895644.30388.7.camel@localhost> X-Enigmail-Version: 1.6a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: 652ebf67-89a2-4ae1-b677-ff71906bd968 X-Archives-Hash: 9af6e3b54b0a518b8982616f75a17060 On 06/22/2013 12:07 PM, Pacho Ramos wrote: > After talking with WilliamH yesterday, I have this opinion: > - Playing with /sbin/init (instead of /sbin/einit) has two interesting > advantages: > 1. For example, I now have init=/sbin/e4rat-preload in my grub.conf, if > I do a typo, it would fallback to /sbin/init. If /sbin/init is provided > by sysvinit, people running other init providers could have problems. > This wouldn't occur if /sbin/init has been changed to use desired init > system. > 2. Tools like e4rat or bootchart launch /sbin/init, if I switch to > systemd, I would need to edit separate configuration files for each tool > to point to new init. This wouldn't occur if we "play" with /sbin/init > => we would only change init in one place good point. maybe a ton other wrapper of that kind. shouldn't they read /proc/cmdline for init=^H^H^H^H^Hreal_init= , but that takes time. > - I have two doubts: > 1. Why do we need a wrapper instead of changing symlinks? And a plain symlink has the charm to either resolve (and load and most likely execure the target) or dangles and kernel tries the next one. No late, wrapper bailouts leaving the kernel in "You killed pid 1" panic. === kexec === speaking of panic. I've never actually used it, but newer kernels support kexec and in conjunction with pre-loaded panic-images[1] and corresponding (compiled-in) initramfs, it'd be possible to have an recovery shell. for either /sbin/init mixups, or late runtime crashes. These should have a the decency to respect the panic= timeout to allow automated reboots or idle till to the end of days. [sad enought, that kexec'd kernels don't pick up the process tables/heap of their predecessors and enable real kernel-hotswitching] === more fallback == maybe we could ask Mr. Tovalds to ad another line in init/main.c, say /sbin/init.fallback (but don't mention systemd) or we could abuse /etc/init or /bin/init or /sbin/sh (with an wrapper to test for PID=1) for an recovery-environment. Fabio: did you mean that? === security === Bailing into /bin/sh or whatever can compromise filesystem integrity/reveal root access to an uncrypted rootfs. There is a scenario of vandalism-proof installed computer pools (no physical access except keyboard/monitor) w/ unattended boot that should not end up in root-shell. ;-) Maybe I should fix that on my systems ... [1] sys-apps/kexec-tools http://kernel.org/pub/linux/utils/kernel/kexec/ -- Michael Weber Gentoo Developer web: https://xmw.de/ mailto: Michael Weber