From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] services: lsh: Add "graceful" handling of daemonic option. Date: Sat, 06 Dec 2014 15:28:34 +0100 Message-ID: <87k324zwbx.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxGLl-0007ru-Hb for guix-devel@gnu.org; Sat, 06 Dec 2014 09:28:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XxGLc-00051u-GY for guix-devel@gnu.org; Sat, 06 Dec 2014 09:28:45 -0500 Received: from hera.aquilenet.fr ([2a01:474::1]:49736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxGLc-00051q-9C for guix-devel@gnu.org; Sat, 06 Dec 2014 09:28:36 -0500 In-Reply-To: (Deck Pickard's message of "Thu, 4 Dec 2014 23:24:02 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Deck Pickard Cc: guix-devel@gnu.org Deck Pickard skribis: > From 1fef935d6292016c04b9234eedb5dcaf006dc152 Mon Sep 17 00:00:00 2001 > From: nebuli > Date: Wed, 3 Dec 2014 22:51:48 +0100 > Subject: [PATCH] services: lsh: Add graceful handling of daemonic option. > > * doc/guix.texi: Mention use case. > * gnu/services/ssh.scm (lsh-service): New #:keys (daemonic?, pid-file?, > pid-file). Build new lshd-command and expand service-requirement > field. Nice! > (define* (lsh-service #:key > (lsh lsh) > + (daemonic? #f) > (host-key "/etc/lsh/host-key") > (interfaces '()) > (port-number 22) > (allow-empty-passwords? #f) > (root-login? #f) > (syslog-output? #t) > + (pid-file? #f) > + (pid-file "/var/run/lshd.pid") > (x11-forwarding? #t) > (tcp/ip-forwarding? #t) > (password-authentication? #t) I would be tempted to not expose #:daemonic?, #:pid-file? and #:syslog-output?, and instead always use --daemonic --pid-file=3D... In particular, when using --daemonic, having the PID file is required, otherwise dmd won=E2=80=99t know what the PID of this process is, and thus = will be unable to control it. For that reason, #:pid-file? must not be exposed. WDYT? > + (define requires > + (if (and daemonic? syslog-output?) > + '(networking syslogd) > + '(networking))) If we agree on the above, that would become '(networking syslogd) unconditionally. > (return (service > (documentation "GNU lsh SSH server") > (provision '(ssh-daemon)) > - (requirement '(networking)) > + (requirement #~(#$@requires)) This is strictly equivalent to: (requirement `(,@requires)) or simply: (requirement requires) :-) G-expressions are only needed when capturing references to /gnu/store items, packages, etc. Thanks, Ludo=E2=80=99.