From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id EB1yEAorlGDQ7AAAgWs5BA (envelope-from ) for ; Thu, 06 May 2021 19:44:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aN8GDAorlGACIwAAbx9fmQ (envelope-from ) for ; Thu, 06 May 2021 17:44:42 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D91F32A387 for ; Thu, 6 May 2021 19:44:41 +0200 (CEST) Received: from localhost ([::1]:59488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lehoE-0001Kf-KB for larch@yhetil.org; Thu, 06 May 2021 13:29:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leho6-0001KR-VI for guix-patches@gnu.org; Thu, 06 May 2021 13:29:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leho6-0001YS-HN for guix-patches@gnu.org; Thu, 06 May 2021 13:29:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1leho6-0005lg-Ed for guix-patches@gnu.org; Thu, 06 May 2021 13:29:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48262] [PATCH version-1.3.0 2/3] services: spice-vdagent: Clear the socket file prior to starting. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 May 2021 17:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48262 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48262@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 48262-submit@debbugs.gnu.org id=B48262.162032208222140 (code B ref 48262); Thu, 06 May 2021 17:29:02 +0000 Received: (at 48262) by debbugs.gnu.org; 6 May 2021 17:28:02 +0000 Received: from localhost ([127.0.0.1]:38720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lehn8-0005kv-B8 for submit@debbugs.gnu.org; Thu, 06 May 2021 13:28:02 -0400 Received: from mail-qt1-f173.google.com ([209.85.160.173]:37587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lehn6-0005kX-Cw for 48262@debbugs.gnu.org; Thu, 06 May 2021 13:28:00 -0400 Received: by mail-qt1-f173.google.com with SMTP id g13so4616252qts.4 for <48262@debbugs.gnu.org>; Thu, 06 May 2021 10:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FLkC0Ke2hXvvB2RpvZvoheOARp0aZWFxKRyivduEY8M=; b=Z5mt6Cskdr0gNQeeYoHt/kceu/cfxR/NoKl+mEQIpRL2i9D2Lk58seimR17d5XV0Zs +0YmitCtL5dXg1hRNBW1zIq3ePIk+BRvzwllyWL0fRf5LLNmxuhJ8EuAjIlMmStCsPBd d/PadXWbNsxTvxo55oYyjFPrDdd4SQF+Se6Jl7lbu/zFoifhDH8gqF7uKbie2FWM8QUw WmQ5NPzSSHO8vzTJaGCIeygLXeiIYiU+rp89nXYIDgVtiCL1l/OybW8dSxLw/n2lDO4m pJXFcPLQ3dUf/rzIc3MYTXio5rA+UlCQjlPRL6Ql/lYZzRl+tszJMvziGY1nKRUOnTt7 UM4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FLkC0Ke2hXvvB2RpvZvoheOARp0aZWFxKRyivduEY8M=; b=imoeV+dUwnaxZT5Eqxnv3fPOmf9upBrK5RIa01Lo3qj4LxmM71Cnsk3NMP0PpD45yj SGShFR6i31qX7oWatn4nwLInv2dpY41/taIjOtGm+FfwG4+a6iE69P6MlCoNFlefKoYF kwiUCzaBPOK1vtlpfcdd/iuNSOWZ9GQFVucEaQ/bMyGPQ6prnQMxJDInLLuuT6zqz5hF jRVqn6IQV2rGdMWhwzkFjnoa9hMHp/tL9o5H6f1wXD40pTVXxMnWmpBTYbe1h4Ky/cPm SivH2nEtq+wcaXQ6UzRFkLq+/Ya1ynlcOAuFZhwHuGomERFsygboeDq4OKl+FdTq/Z9Q JV3Q== X-Gm-Message-State: AOAM533sSitrRtNwRB0hycR0CVpTeruEUwAQ9tfSM+VnuuN8/hNNVint FU4k5yEB4Yf8kYRJUPdGzV/PrhtRLDwH6Q== X-Google-Smtp-Source: ABdhPJx7S5Vs0wjNKXl/JCX6UfV1vAlC/7Bm6Djq9M9huZyfTPNYYcX5ju0N73QYxNBSZ1OWd3c6ZA== X-Received: by 2002:ac8:7fc5:: with SMTP id b5mr5284725qtk.122.1620322074328; Thu, 06 May 2021 10:27:54 -0700 (PDT) Received: from localhost.localdomain (dsl-10-131-245.b2b2c.ca. [72.10.131.245]) by smtp.gmail.com with ESMTPSA id y13sm2495704qkj.84.2021.05.06.10.27.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 10:27:54 -0700 (PDT) From: Maxim Cournoyer Date: Thu, 6 May 2021 13:27:31 -0400 Message-Id: <20210506172732.12294-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210506172732.12294-1-maxim.cournoyer@gmail.com> References: <20210506172732.12294-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620323082; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=FLkC0Ke2hXvvB2RpvZvoheOARp0aZWFxKRyivduEY8M=; b=fxngU8SNostOjL6MHhk65i2VgJ4+uC6OIXr5snbz7eEl6Dg2RlJa7gwlLXDiHpbrdDxozK Ns96wMvKCny7N/pB0oQk4ETN8AjNrfhhIQMHp0lF7hkPkPYi5M3mIllKws4VnMBcIm7rGJ sn9tDrplIjc9WPle1h3+LRccdFoVm5AV2iXIlzwKuPWDMCWuE3lWxisreGVLRUN88XJmHw gjA4p0nos0P325/ulKtikNFkRnVdyk4lDgz9k4+WgdZikENT3p0gZRKQoOIhERo7xxXC3G V4FSegIhNxlTGfsBX8I9Kf1MHti4IFUTJtU7cudlNNDwAWndX7AmjYCpNVOaPQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620323082; a=rsa-sha256; cv=none; b=f+LUZBHumFTiJJA4vSpfTnVOauGjPiBzYrCGgSd/SloHkozQP5LQtdPGAegS2GDarxJi/I njCXJNROS2sD7noR0HdsHInep1A1gRRZtEgSxIQTus19WUoPCRLV9GKfQJXVWEAhWt4Var lwoFYDEpCKCQLqz/kLnwKhGtzNKU2OyjIFeDQOLQtSFCLBha6FbCAURXgm6nCteHH173As OM0pb3eh+umUcv+vtqCyOd1ftN+YiYKYF5C1dJ4kaA6Z7orT6JF6GPrXW2r49vyihhh/uv 3y3NnGDsgitbIq4aqRLYiU1UNh4e4dHaZbYjil3rn/ffC+98AqVQu27ePpWblA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=Z5mt6Csk; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 4.14 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=Z5mt6Csk; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: D91F32A387 X-Spam-Score: 4.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: OrzK40/vfV7K This fixes the following issue where spice-vdagent would fail to start if the spice-vdagent-sock socket file already existed: spice-vdagentd: Fatal could not create the server socket /run/spice-vdagentd/spice-vdagent-sock: Error binding to address: Address already in use The requirement is also modified to depend on dbus-system, a cue taken from upstream's own systemd service file (see 'data/spice-vdagentd.service' in the sources). * gnu/services/spice.scm (spice-vdagent-activation): Delete procedure. (spice-vdagent-shepherd-service): Fix indentation. [requirement]: Replace udev by dbus-system. [start]: Ensure the spice-vdagentd run-time directory exists and that the spice-vdagent-sock socket file does *not* exist before forking the daemon. --- gnu/services/spice.scm | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/gnu/services/spice.scm b/gnu/services/spice.scm index a2aee4ab2a..3b88e29043 100644 --- a/gnu/services/spice.scm +++ b/gnu/services/spice.scm @@ -34,28 +34,29 @@ (spice-vdagent spice-vdagent-configuration-spice-vdagent (default spice-vdagent))) -(define (spice-vdagent-activation config) - "Return the activation gexp for CONFIG." - #~(begin - (use-modules (guix build utils)) - (mkdir-p "/run/spice-vdagentd"))) - (define (spice-vdagent-shepherd-service config) "Return a for spice-vdagentd with CONFIG." (define spice-vdagent (spice-vdagent-configuration-spice-vdagent config)) (define spice-vdagentd-command (list - (file-append spice-vdagent "/sbin/spice-vdagentd") - "-x")) + (file-append spice-vdagent "/sbin/spice-vdagentd") + "-x")) (list - (shepherd-service - (documentation "Spice vdagentd service") - (requirement '(udev)) - (provision '(spice-vdagentd)) - (start #~(make-forkexec-constructor '#$spice-vdagentd-command)) - (stop #~(make-kill-destructor))))) + (shepherd-service + (documentation "Spice vdagentd service") + (requirement '(dbus-system)) + (provision '(spice-vdagentd)) + (start #~(lambda args + ;; spice-vdagentd supports being activated upon the client + ;; connecting to its socket; when not using such feature, the + ;; socket should not exist before vdagentd creates it itself. + (mkdir-p "/run/spice-vdagentd") + (false-if-exception + (delete-file "/run/spice-vdagentd/spice-vdagent-sock")) + (fork+exec-command '#$spice-vdagentd-command))) + (stop #~(make-kill-destructor))))) (define spice-vdagent-profile (compose list spice-vdagent-configuration-spice-vdagent)) @@ -67,8 +68,6 @@ (extensions (list (service-extension shepherd-root-service-type spice-vdagent-shepherd-service) - (service-extension activation-service-type - spice-vdagent-activation) (service-extension profile-service-type spice-vdagent-profile))))) -- 2.31.1