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 BB8AA1381FB for ; Tue, 25 Dec 2012 18:15:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7238921C0B7; Tue, 25 Dec 2012 18:15:34 +0000 (UTC) Received: from mail-ie0-f181.google.com (mail-ie0-f181.google.com [209.85.223.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CE8FE21C009 for ; Tue, 25 Dec 2012 18:14:23 +0000 (UTC) Received: by mail-ie0-f181.google.com with SMTP id 16so9707996iea.40 for ; Tue, 25 Dec 2012 10:14:23 -0800 (PST) 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=PBwB1qMAU5I+TUqqBFqJ9flG0otutJq88Va2CFl5i2c=; b=yzqpgFN+mlEuVtevlMRr6+WizkxOgsnHyhHBxn/cFXzlyVL62jeiQwjVJhUCXWJ8UA H8ngp1o0eK2ozraCZOaQK1+4G2pu3Tt0twJoOQRWo9KsnotKXa3fwbgNoZq+q7qB0zyv xKh91wp8N2+w35t8RCseuYID4WVw6GLYp9ahH4xw+jRTkpeabxpluvQ96CYKFmn0DgYn 1ojlcc5cxDcY9H2Km3kxychhnFJjqwhvaLyN131zJVc7M4zlKmk2n65wlqfI8/g+itGQ xHy4/4FRv6J7VIpUbyuRiGXrERXJM+44BhTv01ENz434+GotKRQN2NqFBk3oiBj7H+Cx /g4w== 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.50.5.236 with SMTP id v12mr22694107igv.6.1356459263099; Tue, 25 Dec 2012 10:14:23 -0800 (PST) Received: by 10.64.32.195 with HTTP; Tue, 25 Dec 2012 10:14:23 -0800 (PST) In-Reply-To: References: <50CB1942.3020900@gmail.com> <50CB4A3C.1030109@gmail.com> <50CB5406.7040404@gmail.com> <8738z7hgsa.fsf@ist.utl.pt> <20121216171043.71084070@khamul.example.com> <20121217104621.735bf43a@khamul.example.com> <20121218163332.7956f31a@khamul.example.com> <87txrd6pb3.fsf@ist.utl.pt> <20121223182037.1553813f@khamul.example.com> <87bodk7lb6.fsf@ist.utl.pt> <20121224085528.56f535ec@khamul.example.com> <50D85167.9060309@gmail.com> <20121224204817.335033c6@khamul.example.com> <50D957F0.1060406@gmail.com> Date: Tue, 25 Dec 2012 12:14:23 -0600 Message-ID: Subject: Re: [gentoo-user] Re: Anyone switched to eudev yet? -> what was wron with SysVInit? From: =?UTF-8?B?Q2FuZWsgUGVsw6FleiBWYWxkw6lz?= To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: a902cec6-1767-4a13-b050-c24e7e453bf8 X-Archives-Hash: e69efb12112841f6d4fadd74b6742f89 On Tue, Dec 25, 2012 at 7:56 AM, Joshua Murphy wrote: > On Tue, Dec 25, 2012 at 3:01 AM, Canek Pel=C3=A1ez Vald=C3=A9s wrote: >> [ snip ] >> * Really simple service unit files: The service unit files are really >> small, really simple, really easy to understand/modify. Compare the 9 >> lines of sshd.service: >> >> $ cat /etc/systemd/system/sshd.service >> [Unit] >> Description=3DSSH Secure Shell Service >> After=3Dsyslog.target >> >> [Service] >> ExecStart=3D/usr/sbin/sshd -D >> >> [Install] >> WantedBy=3Dmulti-user.target >> >> with the 84 of /etc/init.d/sshd (80 without comments). >> > [snip] >> >> Hope it helps. >> >> Regards. >> -- >> Canek Pel=C3=A1ez Vald=C3=A9s >> Posgrado en Ciencia e Ingenier=C3=ADa de la Computaci=C3=B3n >> Universidad Nacional Aut=C3=B3noma de M=C3=A9xico >> > > I've not yet made the leap, as the benefit of faster boot really > doesn't affect me between systems that're always on and laptops that > typically spend 75% of their time asleep, rather than ever getting > turned off, so I'm in no position to speak for or against the whole of > systemd's changes... but one issue I've had with the claimed benefits > is the reduction in size compared to startup scripts like > /etc/init.d/sshd ... based on that service declaration above, it's a > horribly unfair comparison. /etc/init.d/sshd is doing a lot more than > simply starting/stopping the service and dropping all of that > functionality, then claiming "these few lines serve the same purpose" > isn't an equal comparison. It would still be a (notable, at that) drop > in size if the shell script was redone to provide exactly the same set > of features, then compared, but that size difference wouldn't have the > same shock value as the comparison against 80+ lines. The argument > that those functions should be handled by the service rather than the > service handler is for another day, 'course. No, I think that's the interesting argument. Like you say "/etc/init.d/sshd is doing a lot more than simply starting/stopping the service"; why it should do that? That's the work of the package manager and/or the administrator. An init system should only start/stop/monitor the services; it should not be checking if the keys are generated or not, or if the config file is there or not. That should happen at install time, and if for some reason they got borked between the last reboot and this one, the system is probably fucked up anyway, and putting checks in the *init script* will not help at all. But *even* if you really want to have those checks, you can do it in systemd in a cleaner way: put the checks in an executable script, and call the script with ExecStartPre: [Unit] Description=3DSSH Secure Shell Service After=3Dsyslog.target [Service] ExecStartPre=3D/usr/local/bin/checksshd ExecStart=3D/usr/sbin/sshd -D [Install] WantedBy=3Dmulti-user.target There; the unit file is now 10 lines, it *still* doesn't use a Turing-complete language, you got your checks (which I believe they don't belong there, but whatever), and it will timeout if the checksshd goes into an infinite loop (30 seconds is the default timeout, I believe). That's how yo properly do more than start/stop/monitor services; the init system doesn't need to know about it, you clearly move the init system responsibility (start/stop/monitor services) from the service requirements (checking that the config files are there, or that you need to generate keys, which I repeat, I think they belong at install time), and it keeps the unit files nice and simple. Regards. --=20 Canek Pel=C3=A1ez Vald=C3=A9s Posgrado en Ciencia e Ingenier=C3=ADa de la Computaci=C3=B3n Universidad Nacional Aut=C3=B3noma de M=C3=A9xico