From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1S9M6w-0000dP-Bg for garchives@archives.gentoo.org; Sun, 18 Mar 2012 19:49:50 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0951AE08BA; Sun, 18 Mar 2012 19:49:30 +0000 (UTC) Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com [209.85.214.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 90EEFE0885 for ; Sun, 18 Mar 2012 19:48:16 +0000 (UTC) Received: by bkwj4 with SMTP id j4so4626156bkw.40 for ; Sun, 18 Mar 2012 12:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=hvJwavc0Z33TcPZ2kB74v5RP4XMdm+aGVWKaNZsEBkA=; b=v5YZLzgbWBMjnjHj/ej9FPdvMamNc6HpETwWtSQaiU6BEN5hLItp7ibgZsse6I1eNl RI4mdUc5fA9XsdG11Ig4hKrjgtR/dBVaedimmZDf+5dco25U2CJ8on8JoYNArBZ4ncvs 4w8elzuR6C/y/Bzpa9SJmrn7vk//pnnV2nHKBhvgmzhM68OHbE17GU5z0GolZrsZo+t0 lj/SgCf6yhqrSEpIWWZatLr6ug1Ajp6C7+5SqFiCzCOYvT8qTaAmGRBnFuocisIE/Xr/ kvqrKsQckmi+nzwr6j9QZV5qF+ATLFDmU74Ea6Ek2xEqgvY9z5NyBhdi1zcGrKXKZ31n 8vzg== 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 Received: by 10.205.132.145 with SMTP id hu17mr3799858bkc.66.1332100095716; Sun, 18 Mar 2012 12:48:15 -0700 (PDT) Received: by 10.204.168.17 with HTTP; Sun, 18 Mar 2012 12:48:15 -0700 (PDT) In-Reply-To: References: <709768995.843751.1331957483491.JavaMail.open-xchange@email.1and1.com> <20120317115300.GB3615@acm.acm> <87obrugwvn.fsf@newton.gmurray.org.uk> Date: Sun, 18 Mar 2012 15:48:15 -0400 Message-ID: Subject: Re: [gentoo-user] Re: systemd? [ Was: The End Is Near ... ] From: Michael Mol To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: d132ef59-05ca-4205-b542-22fc0e5bec2a X-Archives-Hash: 06530a20f394908f6ef3a66c5e2705a7 On Sun, Mar 18, 2012 at 3:25 PM, Canek Pel=C3=A1ez Vald=C3=A9s wrote: > On Sun, Mar 18, 2012 at 5:23 AM, Pandu Poluan wrote: >> >> On Mar 18, 2012 3:52 PM, "Canek Pel=C3=A1ez Vald=C3=A9s" wrote: >>> >>> If the config file doesn't exists, the service will not start, and you >>> can check the reason why with >>> >>> systemctl status sshd.service >>> >>> And of course you can set another mini sevice unit file to create the >>> hostkeys. But I repeat: I think those tasks belong into the package >>> manager, no the init script. >>> >> >> Between installation by package manager and actual execution by the init >> system, things might happen on the required file(s). Gentoo's initscript >> guards against this possibility *plus* providing helpful error messages = in >> /var/rc.log >> >> Or, said configuration files might be corrupted; the OpenRC initscript -= - if >> written defensively -- will be able to detect that and (perhaps) fallbac= k to >> something sane. systemd can't do that, short of putting all required >> intelligence into a script which it executes on boot. > > That is a completely valid point, but I don't think that task belongs > into the init system. The init system starts and stops services, and > monitors them; checking for configuration files and creating hostkeys > is part of the installation process. If something got corrupted > between installation time and now, I would prefer my init system not > to start a service; just please tell me that something is wrong. > > However, it's of course debatible. I agree with systemd's behavior; > it's cleaner, more elegant, and it follows the Unix tradition: do one > thing, and doing it right. I like and see benefit to the systemd approach, honestly, but I don't think it necessarily follows to say that "that belongs in the installation process, since it shouldn't be the responsibility of the init process." The way things sit currently, Gentoo doesn't default to adding new services to any runlevel, and in the process of setting up or reconfiguring a system, services may be added, removed, then possibly added again. Having a service's launch script perform one-time checks makes perfect sense in this regard. It's lazy evaluation; you don't do non-trivial work until you know it needs to be done. (And generating a 2048-bit or 4096-bit SSH key certainly qualifies as non-trivial work!) Also, I think the "code golf" argument is a poor one; how many lines something does to meet some particular goal ignores any other intended goals the compared object also meets. When you're comparing apples to apples, the argument is fine. When you're comparing apples to oranges, the argument is weakened; they're both fruits, but they still have different purposes in the larger context. In this case, I think the happy medium would be for systemd to start a service-provided launch script, which performs whatever additional checks are wanted or desired. Either way, it's the responsibility of whoever maintains the package for that service. --=20 :wq