From unknown Thu Aug 14 18:38:43 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#63982 <63982@debbugs.gnu.org> To: bug#63982 <63982@debbugs.gnu.org> Subject: Status: [Shepherd] shepherd does not handle signals after 'daemonize' Reply-To: bug#63982 <63982@debbugs.gnu.org> Date: Fri, 15 Aug 2025 01:38:43 +0000 retitle 63982 [Shepherd] shepherd does not handle signals after 'daemonize' reassign 63982 guix submitter 63982 Maxim Cournoyer severity 63982 normal tag 63982 moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 09 13:13:22 2023 Received: (at submit) by debbugs.gnu.org; 9 Jun 2023 17:13:22 +0000 Received: from localhost ([127.0.0.1]:60272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7fft-0002LR-Pj for submit@debbugs.gnu.org; Fri, 09 Jun 2023 13:13:22 -0400 Received: from lists.gnu.org ([209.51.188.17]:40128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7ffq-0002LI-Kq for submit@debbugs.gnu.org; Fri, 09 Jun 2023 13:13:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7ffq-0004HZ-Dd for bug-guix@gnu.org; Fri, 09 Jun 2023 13:13:18 -0400 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q7ffo-0002y2-3K for bug-guix@gnu.org; Fri, 09 Jun 2023 13:13:18 -0400 Received: by mail-qv1-xf36.google.com with SMTP id 6a1803df08f44-62b699b88e1so14696036d6.1 for ; Fri, 09 Jun 2023 10:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686330794; x=1688922794; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=M14wQyLhrjLHN0iIYw/2RfXpCT26Baq3ms5xcmfv7JI=; b=WKcYLNDqJ3v3ZI1hBtZS8Dl0YZsAbWmjsjj9086ppr/z772p21XLq36q4rxHISi/Rn npWDMS+NglS0rLHS/X86neZKeXiUqFwy55uRa6MFUr1mrE2t45rXFZP6I+Gk0kmwqiDV xFn7f4TVBef5Pu73jOQEHLg3arxpwWneG1x6pSfauSFPD9qUxgnVqcN6bu8FXyJ7TcRy Ak1zG02Wo0ipoTGcef117Sa8qrkzDxjsBLT4fbCHotjQe1aUhXS8AnY6+lJT4DFRzDTe gJiJt1ztPEh6Jiu13f36uQ/D3vI4ususFRr+4FPJnBzjIrjcZEIbHMMF3+UJOicDQXoM +3qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686330794; x=1688922794; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=M14wQyLhrjLHN0iIYw/2RfXpCT26Baq3ms5xcmfv7JI=; b=kL+YREfq7ORdhEbmBVl9ppI2wZYTVNuiuS5Hyd+/l3WWbuUZxcyYi5ZqzvLKNwSYBH IFkKGfUpQPO+AQtlgmN9poQQ/UOD0SkROJ7IxFqHQR5PFiHz6fucpZmNpIyesRIivdXZ MuECl7+46tWy2v1dV28FdmqFXU/r6l8FOhUqKCMsYKKEhu8Q5cZNojgTm/eoai1AzeXz otfKv+/QHLhjv7PPP5EfRUD0ZvmW2un0qCxoMuWxlcS6tqo7b9bue8e3a4KAzxGiYTdU IEqGiqKS7goTiRdSuhDbty9g/2KIVFm6E+OX8U2VXOWvaYKn9yJFpxOHCI1rOMohwi8H 2wVQ== X-Gm-Message-State: AC+VfDyBjukbwAt7cpnlR1dm/x47Y/Ocn3DDIaMSDcUf1bNipW7NvtEK 2M4N/rAtfANRbyGmS9wY2ZlErRBcSF7lbg== X-Google-Smtp-Source: ACHHUZ7glquOOkqEymD3zAQscitjbKDJkqFt46/lmJgu0Zjrmzcn1Zo+9W+F9Q0vWIRCB4WMLK+bGw== X-Received: by 2002:ad4:5964:0:b0:62b:5cf8:4ddc with SMTP id eq4-20020ad45964000000b0062b5cf84ddcmr2240192qvb.39.1686330793886; Fri, 09 Jun 2023 10:13:13 -0700 (PDT) Received: from hurd (dsl-158-203.b2b2c.ca. [66.158.158.203]) by smtp.gmail.com with ESMTPSA id p17-20020a0ccb91000000b0062629cbff11sm1291746qvk.11.2023.06.09.10.13.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 10:13:13 -0700 (PDT) From: Maxim Cournoyer To: bug-guix Subject: Shepherd can crash when a user service fails to start X-Debbugs-CC: "Ludovic =?utf-8?Q?Court=C3=A8s=22?= Date: Fri, 09 Jun 2023 13:13:11 -0400 Message-ID: <87mt18blug.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::f36; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Hi! I've noticed that while all my user services (managed via GNU Stow -- not via Guix Home) were working, 'herd status' would report that /run/user/1000/shepherd/socket was missing and bail out. Starting from a nonexistent /run/user/1000/shepherd/socket, using old Shepherd 0.9.1: --8<---------------cut here---------------start------------->8--- $ /gnu/store/dblbnj1yra4yrrfjbnzsa0ldcl3170ap-shepherd-0.9.1/bin/shepherd Service root has been started. WARNING: Use of `load' in declarative module (#{ g115}#). Add #:declarative? #f to your define-module invocation. Some deprecated features have been used. Set the environment variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program to get more information. Set it to "no" to suppress this message. $ Warning: due to a long standing Gtk+ bug https://gitlab.gnome.org/GNOME/gtk/issues/221 Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost. Using an Emacs configured with --with-x-toolkit=lucid does not have this problem. Loading time (native compiled elisp)... Loading time (native compiled elisp)...done Loading /home/maxim/.emacs.d/recentf... Loading /home/maxim/.emacs.d/recentf...done Cleaning up the recentf list... Cleaning up the recentf list...done (0 removed) ../../.emacs: Warning: Use keywords rather than deprecated positional arguments to `define-minor-mode' Preparing diary... No diary entries for Friday, June 9, 2023 Preparing diary...done Appointment reminders enabled Loading /home/maxim/.emacs.d/emms/cache... Loading /home/maxim/.emacs.d/emms/cache...done [yas] Prepared just-in-time loading of snippets successfully. [yas] Prepared just-in-time loading of snippets successfully. Starting new Ispell process aspell with english dictionary... \ Starting new Ispell process aspell with english dictionary...done Starting Emacs daemon. Unable to start the daemon. Another instance of Emacs is running the server, either as daemon or interactively. You can use emacsclient to connect to that Emacs process. Saving file /home/maxim/.emacs.d/emms/history... Wrote /home/maxim/.emacs.d/emms/history Wrote /home/maxim/.emacs.d/recentf Error: server did not start correctly Service emacs could not be started. gpg-agent: a gpg-agent is already running - not starting a new one Service gpg-agent could not be started. Service ibus-daemon has been started. $ herd status Started: + ibus-daemon + root Stopped: - emacs - gpg-agent - jackd - workrave --8<---------------cut here---------------end--------------->8--- If I then run it anew, it fails with "shepherd: while opening socket '/run/user/1000/shepherd/socket': bind: Address already in use", because apparently 'herd stop root' didn't remove it. --8<---------------cut here---------------start------------->8--- $ herd stop root Exiting. [...] $ /gnu/store/dblbnj1yra4yrrfjbnzsa0ldcl3170ap-shepherd-0.9.1/bin/shepherd Service root has been started. WARNING: Use of `load' in declarative module (#{ g115}#). Add #:declarative? #f to your define-module invocation. Some deprecated features have been used. Set the environment variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program to get more information. Set it to "no" to suppress this message. maxim@hurd ~/src/guix [env]$ Warning: due to a long standing Gtk+ bug https://gitlab.gnome.org/GNOME/gtk/issues/221 Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost. Using an Emacs configured with --with-x-toolkit=lucid does not have this problem. Loading time (native compiled elisp)... Loading time (native compiled elisp)...done Loading /home/maxim/.emacs.d/recentf... Loading /home/maxim/.emacs.d/recentf...done Cleaning up the recentf list... Cleaning up the recentf list...done (0 removed) ../../.emacs: Warning: Use keywords rather than deprecated positional arguments to `define-minor-mode' Preparing diary... No diary entries for Friday, June 9, 2023 Preparing diary...done Appointment reminders enabled Loading /home/maxim/.emacs.d/emms/cache... Loading /home/maxim/.emacs.d/emms/cache...done [yas] Prepared just-in-time loading of snippets successfully. [yas] Prepared just-in-time loading of snippets successfully. Starting new Ispell process aspell with english dictionary... \ Starting new Ispell process aspell with english dictionary...done Starting Emacs daemon. Unable to start the daemon. Another instance of Emacs is running the server, either as daemon or interactively. You can use emacsclient to connect to that Emacs process. Saving file /home/maxim/.emacs.d/emms/history... Wrote /home/maxim/.emacs.d/emms/history Wrote /home/maxim/.emacs.d/recentf Error: server did not start correctly Service emacs could not be started. gpg-agent: a gpg-agent is already running - not starting a new one Service gpg-agent could not be started. Service ibus-daemon has been started. shepherd: while opening socket '/run/user/1000/shepherd/socket': bind: Address already in use Exiting shepherd... Service ibus-daemon has been stopped. Some deprecated features have been used. Set the environment variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program to get more information. Set it to "no" to suppress this message. $ --8<---------------cut here---------------end--------------->8--- Even after removing it manually with 'rm /run/user/1000/shepherd/socket', it still fails: --8<---------------cut here---------------start------------->8--- $ /gnu/store/dblbnj1yra4yrrfjbnzsa0ldcl3170ap-shepherd-0.9.1/bin/shepherd Service root has been started. WARNING: Use of `load' in declarative module (#{ g115}#). Add #:declarative? #f to your define-module invocation. Some deprecated features have been used. Set the environment variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program to get more information. Set it to "no" to suppress this message. maxim@hurd ~/src/guix [env]$ Warning: due to a long standing Gtk+ bug https://gitlab.gnome.org/GNOME/gtk/issues/221 Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost. Using an Emacs configured with --with-x-toolkit=lucid does not have this problem. Loading time (native compiled elisp)... Loading time (native compiled elisp)...done Loading /home/maxim/.emacs.d/recentf... Loading /home/maxim/.emacs.d/recentf...done Cleaning up the recentf list... Cleaning up the recentf list...done (0 removed) ../../.emacs: Warning: Use keywords rather than deprecated positional arguments to `define-minor-mode' Preparing diary... No diary entries for Friday, June 9, 2023 Preparing diary...done Appointment reminders enabled Loading /home/maxim/.emacs.d/emms/cache... Loading /home/maxim/.emacs.d/emms/cache...done [yas] Prepared just-in-time loading of snippets successfully. [yas] Prepared just-in-time loading of snippets successfully. Starting new Ispell process aspell with english dictionary... \ Starting new Ispell process aspell with english dictionary...done Starting Emacs daemon. Unable to start the daemon. Another instance of Emacs is running the server, either as daemon or interactively. You can use emacsclient to connect to that Emacs process. Saving file /home/maxim/.emacs.d/emms/history... Wrote /home/maxim/.emacs.d/emms/history Wrote /home/maxim/.emacs.d/recentf Error: server did not start correctly Service emacs could not be started. gpg-agent: a gpg-agent is already running - not starting a new one Service gpg-agent could not be started. Service ibus-daemon has been started. shepherd: while opening socket '/run/user/1000/shepherd/socket': bind: Address already in use Exiting shepherd... Service ibus-daemon has been stopped. Some deprecated features have been used. Set the environment variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program to get more information. Set it to "no" to suppress this message. --8<---------------cut here---------------end--------------->8--- It apparently is caused by Emacs failing to start, because if I comment it out from the init.scm file, then the same Shepherd invocation is happy: --8<---------------cut here---------------start------------->8--- ;; Services to start when shepherd starts: (for-each start '(;emacs gpg-agent ibus-daemon)) --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- $ herd status Started: + ibus-daemon + root Stopped: - emacs - gpg-agent - jackd - workrave --8<---------------cut here---------------end--------------->8--- But that's with Shepherd 0.9.1. If I run the exact same config that now works, I see: --8<---------------cut here---------------start------------->8--- rm /run/user/1000/shepherd/socket $ /gnu/store/y826g8wrpzskcs82ffxppj7mmz257ksi-shepherd-0.10.1/bin/shepherd Starting service root... Service root started. Service root running with value #t. Service root has been started. WARNING: Use of `load' in declarative module (#{ g119}#). Add #:declarative? #f to your define-module invocation. Some deprecated features have been used. Set the environment variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program to get more information. Set it to "no" to suppress this message. Starting service gpg-agent... $ herd status herd: error: /run/user/1000/shepherd/socket: No such file or directory $ file /run/user/1000/shepherd/socket /run/user/1000/shepherd/socket: cannot open `/run/user/1000/shepherd/socket' (No such file or directory) $ pgrep -a shepherd 1 /gnu/store/4gvgcfdiz67wv04ihqfa8pqwzsb0qpv5-guile-3.0.9/bin/guile --no-auto-compile /gnu/store/nl0948z46yndpx3kihhi540l5c422wv4-shepherd-0.10.0/bin/shepherd --config /gnu/store/7dxbjccbqamk4wa0nyf7zsc4ywimb1fh-shepherd.conf 24700 /gnu/store/4gvgcfdiz67wv04ihqfa8pqwzsb0qpv5-guile-3.0.9/bin/guile --no-auto-compile /gnu/store/y826g8wrpzskcs82ffxppj7mmz257ksi-shepherd-0.10.1/bin/shepherd --8<---------------cut here---------------end--------------->8--- It seems a bug exists in both 0.9.1 and 0.10.1, but that something also regressed going from 0.9.1 to 0.10.1. Attached are the two relevant Shepherd config files to test: --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=init.scm Content-Transfer-Encoding: base64 Ozs7IFNoZXBoZXJkIFVzZXIgU2VydmljZXMKKGxvYWQgInNlcnZpY2VzLnNjbSIpCgoocmVnaXN0 ZXItc2VydmljZXMKIGVtYWNzCiBncGctYWdlbnQKIGphY2tkCiBpYnVzLWRhZW1vbgogd29ya3Jh dmUpCgo7OyBTZW5kIHNoZXBoZXJkIGludG8gdGhlIGJhY2tncm91bmQuCihhY3Rpb24gJ3NoZXBo ZXJkICdkYWVtb25pemUpCgo7OyBTZXJ2aWNlcyB0byBzdGFydCB3aGVuIHNoZXBoZXJkIHN0YXJ0 czoKKGZvci1lYWNoIHN0YXJ0ICcoZW1hY3MKCQkgIGdwZy1hZ2VudAoJCSAgaWJ1cy1kYWVtb24p KQo= --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=services.scm Content-Transfer-Encoding: base64 KGRlZmluZSBlbWFjcwogIChtYWtlIDxzZXJ2aWNlPgogICAgIzpwcm92aWRlcyAnKGVtYWNzKQog ICAgIzpyZXF1aXJlcyAnKCkKICAgICM6c3RhcnQgKG1ha2Utc3lzdGVtLWNvbnN0cnVjdG9yICJl bWFjcyAtLWRhZW1vbiIpCiAgICAjOnN0b3AgKG1ha2Utc3lzdGVtLWRlc3RydWN0b3IgImVtYWNz Y2xpZW50IC0tZXZhbCBcIihraWxsLWVtYWNzKVwiIikpKQoKKGRlZmluZSBpYnVzLWRhZW1vbgog IChtYWtlIDxzZXJ2aWNlPgogICAgIzpwcm92aWRlcyAnKGlidXMtZGFlbW9uKQogICAgIzpyZXF1 aXJlcyAnKCkKICAgICM6c3RhcnQgKG1ha2Utc3lzdGVtLWNvbnN0cnVjdG9yICJpYnVzLWRhZW1v biAtLXhpbSAtLWRhZW1vbml6ZSAtLXJlcGxhY2UiKQogICAgIzpzdG9wIChtYWtlLXN5c3RlbS1k ZXN0cnVjdG9yICJwa2lsbCBpYnVzLWRhZW1vbiIpKSkKCihkZWZpbmUgamFja2QKICAobWFrZSA8 c2VydmljZT4KICAgICM6cHJvdmlkZXMgJyhqYWNrZCkKICAgICM6cmVxdWlyZXMgJygpCiAgICAj OnN0YXJ0IChtYWtlLXN5c3RlbS1jb25zdHJ1Y3RvciAiamFja2QgLWQgYWxzYSAmIikKICAgICM6 c3RvcCAobWFrZS1zeXN0ZW0tZGVzdHJ1Y3RvciAicGtpbGwgamFja2QiKSkpCgooZGVmaW5lIGdw Zy1hZ2VudAogIChsZXQgKChwaW5lbnRyeSAoc3RyaW5nLWFwcGVuZCAoZ2V0ZW52ICJIT01FIikK CQkJCSAiLy5ndWl4LXByb2ZpbGUvYmluL3BpbmVudHJ5IikpKQogICAgKG1ha2UgPHNlcnZpY2U+ CiAgICAgICM6cHJvdmlkZXMgJyhncGctYWdlbnQpCiAgICAgICM6cmVxdWlyZXMgJygpCiAgICAg ICM6c3RhcnQgKG1ha2Utc3lzdGVtLWNvbnN0cnVjdG9yCgkgICAgICAgKHN0cmluZy1hcHBlbmQg ImdwZy1hZ2VudCAtLWRhZW1vbiAiCgkJCSAgICAgICItLXBpbmVudHJ5LXByb2dyYW0gIiBwaW5l bnRyeSkpCiAgICAgICM6c3RvcCAobWFrZS1zeXN0ZW0tZGVzdHJ1Y3RvciAiZ3BnY29uZiAtLWtp bGwgZ3BnLWFnZW50IikpKSkKCihkZWZpbmUgd29ya3JhdmUKICAobWFrZSA8c2VydmljZT4KICAg ICM6cHJvdmlkZXMgJyh3b3JrcmF2ZSkKICAgICM6cmVxdWlyZXMgJygpCiAgICAjOnN0YXJ0ICht YWtlLXN5c3RlbS1jb25zdHJ1Y3RvciAid29ya3JhdmUgJiIpCiAgICAjOnN0b3AgKG1ha2Utc3lz dGVtLWRlc3RydWN0b3IgInBraWxsIC05IHdvcmtyYXZlIikpKQo= --=-=-= Content-Type: text/plain -- Thanks, Maxim --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 12 09:44:29 2023 Received: (at 63982) by debbugs.gnu.org; 12 Jun 2023 13:44:29 +0000 Received: from localhost ([127.0.0.1]:39232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8hqP-0003Xe-8w for submit@debbugs.gnu.org; Mon, 12 Jun 2023 09:44:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8hqN-0003XP-2D for 63982@debbugs.gnu.org; Mon, 12 Jun 2023 09:44:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8hqH-0006cZ-Rv; Mon, 12 Jun 2023 09:44:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=jERaa1kGnRIuNKamHLUk+Y9A5yO1+sgew5G5NgHuoaA=; b=PguSQkakEhs5OCrNX6iZ 9Bmih+OzGEk624tGLs16CqY0oMXJrctK0f1aZ1E0u4DHAUjVtShZ4DhObTjQDRCSVSjmsvb81iZMR qrnxE5M4esZzizPkSLkSxCQ22RqV0PasBUWyk4ynyG/GpnxCbVW58BT03P/Yjo+IgTfHtEYYBNAf+ bZeKfpTGRXiVTbJZnsVH7Rem9RVhn+LN1YTP+3YU5M0ly+TuHhfqc1r+vb+eUCtFpIrXb03zuLtPf 07ZOu6r9faib60gGBNPfbwiL1HdAC4vO6KAmqH+6DvUFd7Z0EXwCZ6B4XyhRaZ34oHJonR/CsWU+3 NGQU2oEFzmguvA==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8hqH-0002Ti-Ey; Mon, 12 Jun 2023 09:44:21 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#63982: Shepherd can crash when a user service fails to start References: <87mt18blug.fsf@gmail.com> Date: Mon, 12 Jun 2023 15:44:18 +0200 In-Reply-To: <87mt18blug.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 09 Jun 2023 13:13:11 -0400") Message-ID: <87ilbsvlql.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63982 Cc: 63982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Maxim, Maxim Cournoyer skribis: > rm /run/user/1000/shepherd/socket > > $ /gnu/store/y826g8wrpzskcs82ffxppj7mmz257ksi-shepherd-0.10.1/bin/shepherd > Starting service root... > Service root started. > Service root running with value #t. > Service root has been started. > WARNING: Use of `load' in declarative module (#{ g119}#). Add #:declarat= ive? #f to your define-module invocation. > > Some deprecated features have been used. Set the environment > variable GUILE_WARN_DEPRECATED to "detailed" and rerun the > program to get more information. Set it to "no" to suppress > this message. > Starting service gpg-agent... > > $ herd status > herd: error: /run/user/1000/shepherd/socket: No such file or directory Thanks for the detailed bug report! I believe this is fixed by Shepherd commit 24c964021ebd3d63ce6e22808dd09dbe16116a6c, which introduces an additional change: loading the config file asynchronously. If you wish to test it, you can use the =E2=80=98shepherd=E2=80=99 channel. Let me know how it goes! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 12 13:32:30 2023 Received: (at 63982) by debbugs.gnu.org; 12 Jun 2023 17:32:30 +0000 Received: from localhost ([127.0.0.1]:40465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8lP4-0001aI-7L for submit@debbugs.gnu.org; Mon, 12 Jun 2023 13:32:30 -0400 Received: from mail-qk1-f177.google.com ([209.85.222.177]:62865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8lP0-0001a2-SL for 63982@debbugs.gnu.org; Mon, 12 Jun 2023 13:32:28 -0400 Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-7606e639083so8441385a.1 for <63982@debbugs.gnu.org>; Mon, 12 Jun 2023 10:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686591141; x=1689183141; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=CnaxsL4EyLvGb4GDbwf3jtvwD2jWICJiyTH1LJK7HwY=; b=OSDTeV8zmo1/IRFf+d9QD85VlbeCtbTFKGXDle4xJVD5OlgPbUdixVpqN5DrUOGw3R Yn0nWXw3L5hJee4G5/MLdNQAQH7VUU1IV+VZVmQtfkrVQ75QVCH6Eh8oQMxoT+I99/mE 2f6gEsnZkcrh5WfMSWrt2AL4blkuk2diPJbVdyByHk4Mso31LNB7LCuRtnuXnQyM7xtL ee9gF6H0N8DTXixXS6y8HykRC91z/NKvH59AwlWRv6RmPIAHmZLAjFJZK4WAjYq+/VFX LDTp8JU8IgOCUIk4RLe9jPamXkXaRrA/xjCRQx88TIfvm+XnCeCs+Blrb7jgv6oynnpt 1ecw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686591141; x=1689183141; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CnaxsL4EyLvGb4GDbwf3jtvwD2jWICJiyTH1LJK7HwY=; b=kR2IRtTKNDb9Xci/Ak1rv8CP1GiuSCyBqdWrofahWPy4Idun2ZeXnDtjIn5ApoplIF JmHbe0tpT1Fd9dayDc3KaUYnArGvY5dDUqa3WTwd9fW/UXvc0c41cdIDl1/1LoFFecT0 a+eaxpX0LaLFYvOl0SunOKbqUF3zLShmFUL2cz7x441no9eVJmGL2Bp1B9LrC7d/gUBg lXyZXCuXhoG8tVLa8kOPIy6JphL4/xt7XhRa1XRQtgv3yhiFmQDmomp+xWHlUP1SUbEO V411poMCXrIU+k9GGAoH5FYSot2ghoB089JnWlRnQlHNWLwyptSHyzlhNcqu6VQPL+av WK8g== X-Gm-Message-State: AC+VfDwnoVBvigX67okqV2SR5JYjIrbZtUL5jA1795cSsRoFcgViUpP5 gDSKef8QMMO/R/07PH1QXjbQdYsCRLd27g== X-Google-Smtp-Source: ACHHUZ7mmnGL/ngtGa2d+lZTc+dxXmnPxbT4FkSToMPKW8UCLLvuCaLOmtXTdnv1rr2uadCzqHAdcQ== X-Received: by 2002:ad4:5aeb:0:b0:626:1d7c:6a31 with SMTP id c11-20020ad45aeb000000b006261d7c6a31mr15760360qvh.10.1686591140779; Mon, 12 Jun 2023 10:32:20 -0700 (PDT) Received: from hurd (dsl-151-174.b2b2c.ca. [66.158.151.174]) by smtp.gmail.com with ESMTPSA id z7-20020a0cda87000000b00626195bdbbdsm568657qvj.132.2023.06.12.10.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 10:32:19 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#63982: Shepherd can crash when a user service fails to start References: <87mt18blug.fsf@gmail.com> <87ilbsvlql.fsf@gnu.org> Date: Mon, 12 Jun 2023 13:32:18 -0400 In-Reply-To: <87ilbsvlql.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 12 Jun 2023 15:44:18 +0200") Message-ID: <87pm60wpr1.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63982 Cc: 63982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Ludovic! Ludovic Court=C3=A8s writes: > Hi Maxim, > > Maxim Cournoyer skribis: > >> rm /run/user/1000/shepherd/socket >> >> $ /gnu/store/y826g8wrpzskcs82ffxppj7mmz257ksi-shepherd-0.10.1/bin/shephe= rd >> Starting service root... >> Service root started. >> Service root running with value #t. >> Service root has been started. >> WARNING: Use of `load' in declarative module (#{ g119}#). Add #:declara= tive? #f to your define-module invocation. >> >> Some deprecated features have been used. Set the environment >> variable GUILE_WARN_DEPRECATED to "detailed" and rerun the >> program to get more information. Set it to "no" to suppress >> this message. >> Starting service gpg-agent... >> >> $ herd status >> herd: error: /run/user/1000/shepherd/socket: No such file or directory > > Thanks for the detailed bug report! > > I believe this is fixed by Shepherd commit > 24c964021ebd3d63ce6e22808dd09dbe16116a6c, which introduces an additional > change: loading the config file asynchronously. Nitpick: I'd use a git message tag for 'Reported-by', as can be inserted in the commit buffer in Magit with C-c C-p. They should be placed at the bottom of the git message to be considered by tools parsing them. > If you wish to test it, you can use the =E2=80=98shepherd=E2=80=99 channe= l. I've done so by placing in my ~/.config/guix/channels.scm file: (channel (name 'shepherd) (url "https://git.savannah.gnu.org/git/shepherd.git") (introduction (make-channel-introduction "788a6d6f1d5c170db68aa4bbfb77024fdc468ed3" ;2022-05-21 (openpgp-fingerprint "3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5")))) =20=20=20=20=20=20=20=20=20=20=20 It'd be nice to have this in the Shepherd doc for easy copy & paste. > Let me know how it goes! I've edited my ~/.xsession file to use /gnu/store/ahzl8vxxcd5bqlljwgn8wkp4884sr72l-shepherd-0.10.99-tarball, and I'm now seeing this: --8<---------------cut here---------------start------------->8--- $ herd status D=C3=A9marr=C3=A9s=C2=A0: + root Starting: ^ emacs Arr=C3=AAt=C3=A9s=C2=A0: - gpg-agent - ibus-daemon - jackd - workrave --8<---------------cut here---------------end--------------->8--- =20 Interestingly, the Emacs client is usable. It doesn't change from there, and requesting it to be stopped hangs Shepherd: --8<---------------cut here---------------start------------->8--- $ herd stop emacs --8<---------------cut here---------------end--------------->8--- If I comment out the Emacs service from the ~/.config/shepherd/init.scm file, the same seems to happen on my next service, gpg-agent: --8<---------------cut here---------------start------------->8--- $ herd status D=C3=A9marr=C3=A9s=C2=A0: + root Starting: ^ gpg-agent Arr=C3=AAt=C3=A9s=C2=A0: - emacs - ibus-daemon - jackd - workrave --8<---------------cut here---------------end--------------->8--- Etc. if I comment that one (now hanging on starting ibus-daemon). It seems something is still off? Thanks for working toward a fix! --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 14 11:57:15 2023 Received: (at 63982) by debbugs.gnu.org; 14 Jun 2023 15:57:15 +0000 Received: from localhost ([127.0.0.1]:45207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9Srz-0008Kj-DA for submit@debbugs.gnu.org; Wed, 14 Jun 2023 11:57:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9Srx-0008KX-OI for 63982@debbugs.gnu.org; Wed, 14 Jun 2023 11:57:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q9Srs-0003xi-Fr; Wed, 14 Jun 2023 11:57:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=FVMKzsUlLo4gx6MBv/qo5gt27pNBOPSsol1wp0wkqLA=; b=aIF5dOBUvobwEHoB6619 m+TQCrmQVBMy3iDSPWLPQxckVsOnUMRhbAezG3Zc6lLs7KT1Tj7T24lBDCTHRy+STX6433FN+0olD BVvVXbopUDCj847JRa7d0eKwwNryeP7jCOfP43VaO+8ois6aFq99fUk3ANz3puJ0cZep/8oaLPOQK FKbQzjd+87HGyh5s6m9gKcomK7oojGpuy5tS6GvdZlGO7nR3yoL1BTLgvfHCrEHrzYGBqq2ak+cRW WC9scSwNMp0XyJQ9lMbTDSusslHzgDeoaWSADtnY8/pKdxD0jgv0USzA2plaTK6fZWq8op2gM7qKH o9j8f5WOnf6c0A==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q9Srs-0003JT-3P; Wed, 14 Jun 2023 11:57:08 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#63982: Shepherd can crash when a user service fails to start References: <87mt18blug.fsf@gmail.com> <87ilbsvlql.fsf@gnu.org> <87pm60wpr1.fsf@gmail.com> Date: Wed, 14 Jun 2023 17:57:05 +0200 In-Reply-To: <87pm60wpr1.fsf@gmail.com> (Maxim Cournoyer's message of "Mon, 12 Jun 2023 13:32:18 -0400") Message-ID: <87o7lirq9a.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63982 Cc: 63982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Maxim Cournoyer skribis: >> I believe this is fixed by Shepherd commit >> 24c964021ebd3d63ce6e22808dd09dbe16116a6c, which introduces an additional >> change: loading the config file asynchronously. > > Nitpick: I'd use a git message tag for 'Reported-by', as can be inserted > in the commit buffer in Magit with C-c C-p. They should be placed at > the bottom of the git message to be considered by tools parsing them. Neat, I didn=E2=80=99t know about it, I=E2=80=99ll do that now (I think I s= tarted using the =E2=80=9CReported by=E2=80=9D convention before Git came into existence= =E2=80=A6). >> If you wish to test it, you can use the =E2=80=98shepherd=E2=80=99 chann= el. > > I've done so by placing in my ~/.config/guix/channels.scm file: > > (channel > (name 'shepherd) > (url "https://git.savannah.gnu.org/git/shepherd.git") > (introduction > (make-channel-introduction > "788a6d6f1d5c170db68aa4bbfb77024fdc468ed3" ;2022-05-21 > (openpgp-fingerprint > "3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5")))) >=20=20=20=20=20=20=20=20=20=20=20=20 > > It'd be nice to have this in the Shepherd doc for easy copy & paste. I=E2=80=99ll add that to =E2=80=98README=E2=80=99. >> Let me know how it goes! > > I've edited my ~/.xsession file to use > /gnu/store/ahzl8vxxcd5bqlljwgn8wkp4884sr72l-shepherd-0.10.99-tarball, > and I'm now seeing this: > > $ herd status > D=C3=A9marr=C3=A9s=C2=A0: > + root > Starting: > ^ emacs > Arr=C3=AAt=C3=A9s=C2=A0: > - gpg-agent > - ibus-daemon > - jackd > - workrave Uh, so it remains in =E2=80=9Cstarting=E2=80=9D state? > Interestingly, the Emacs client is usable. It doesn't change from > there, and requesting it to be stopped hangs Shepherd: Technically it=E2=80=99s waiting for =E2=80=98emacs=E2=80=99 to be in =E2= =80=9Crunning=E2=80=9D state before attempting to stop it. > If I comment out the Emacs service from the ~/.config/shepherd/init.scm > file, the same seems to happen on my next service, gpg-agent: > > $ herd status > D=C3=A9marr=C3=A9s=C2=A0: > + root > Starting: > ^ gpg-agent > Arr=C3=AAt=C3=A9s=C2=A0: > - emacs > - ibus-daemon > - jackd > - workrave > > Etc. if I comment that one (now hanging on starting ibus-daemon). It > seems something is still off? Looks like it. Could you share ~/.local/var/log/shepherd.log? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 17 10:03:35 2023 Received: (at control) by debbugs.gnu.org; 17 Jun 2023 14:03:35 +0000 Received: from localhost ([127.0.0.1]:52193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAWWd-0004D5-3F for submit@debbugs.gnu.org; Sat, 17 Jun 2023 10:03:35 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:23488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAWWY-0004Cm-VB for control@debbugs.gnu.org; Sat, 17 Jun 2023 10:03:33 -0400 Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=ludo@gnu.org; dmarc=fail (p=none dis=none) d=gnu.org X-IronPort-AV: E=Sophos;i="6.00,250,1681164000"; d="scan'208";a="113355645" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2023 16:03:23 +0200 Date: Sat, 17 Jun 2023 16:03:24 +0200 Message-Id: <87wn02qj83.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #63982 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) tags 63982 + moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 18 12:12:23 2023 Received: (at 63982) by debbugs.gnu.org; 18 Jun 2023 16:12:23 +0000 Received: from localhost ([127.0.0.1]:54875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAv0o-0005ri-5v for submit@debbugs.gnu.org; Sun, 18 Jun 2023 12:12:23 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]:34976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAu7C-0004C1-Jr for 63982@debbugs.gnu.org; Sun, 18 Jun 2023 11:14:56 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4QkbzV4vNJz9sZJ for <63982@debbugs.gnu.org>; Sun, 18 Jun 2023 17:14:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=landt.email; s=MBO0001; t=1687101286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3LZTcSkVfY1ojZkw/uSd0jMR4w4c8mYSHc/wZ3dIGug=; b=EGc1hWZQNpS9NRnUG3VukE/bMDZobvMsVX1PmpEvsAzAXF4EMENX0Ir4Hiq79Zy1E8Rz70 IjP1rltNmkmU6vyFzCxTjZvYFcGY8ppfVbY3Gckd70tmcfAe0zdpU5+SK7pC+GJ6iOXfXi rBfvmcAsj9BMsblH1Yqmq65r6hNCDGRc7zSnyz/bg6ShBaGfDu6pXF974L8xkrJyUJMPwi vlkzz5d71uIbJN0i2wQwfBEnC+XXqP4OD/huQE9iQubEimb9V2RWola/gxPrBsrD+mYdVF 3mwQlZes5ESP5WAfUoJsfSIw1fCMB4iItDmMxSPl3Z41zL50Xy34BSozooEgew== Date: Sun, 18 Jun 2023 17:14:46 +0200 (CEST) From: nils@landt.email To: "63982@debbugs.gnu.org" <63982@debbugs.gnu.org> Message-ID: <1275452452.902121.1687101286088@office.mailbox.org> Subject: Shepherd wrong-type-arg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63982 X-Mailman-Approved-At: Sun, 18 Jun 2023 12:12:20 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, I am affected by this as well, but with slightly different symptoms. Using guix home on a foreign system (Debian 12), I tried different shepherd versions with (service home-shepherd-service-type (home-shepherd-configuration (shepherd (specification->package "shepherd@0.9"))) , and guix home describe --list-installed shows me that this works (in the sense that a different shepherd version is installed). None of the versions I tried got me a functional shepherd service. These are the error messages by shepherd version: 0.8.1: Service root has been started. WARNING: Use of `load' in declarative module (#{ g91}#). Add #:declarative? #f to your define-module invocation. Loading /gnu/store/w6rlja8v65dwv16ivcqx513q7827n6aq-shepherd.conf. herd: exception caught while executing 'load' on service 'root': In procedure string-append: Wrong type (expecting string): #f No /run/user/1000/shepherd/socket is created. 0.9.3: Service root has been started. WARNING: Use of `load' in declarative module (#{ g117}#). Add #:declarative? #f to your define-module invocation. wrong-type-arg("string-append" "Wrong type (expecting ~A): ~S" ("string" #f) (#f)) Some deprecated features have been used. Set the environment variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program to get more information. Set it to "no" to suppress this message. No /run/user/1000/shepherd/socket is created. 0.10.1: Starting service root... Service root started. Service root running with value #t. Service root has been started. WARNING: Use of `load' in declarative module (#{ g107}#). Add #:declarative? #f to your define-module invocation. wrong-type-arg("string-append" "Wrong type (expecting ~A): ~S" ("string" #f) (#f)) No /run/user/1000/shepherd/socket is created. 0.10.99: Starting service root... Service root started. Service root running with value #t. Service root has been started. WARNING: Use of `load' in declarative module (#{ g119}#). Add #:declarative? #f to your define-module invocation. Uncaught exception while loading configuration file '/gnu/store/w6rlja8v65dwv16ivcqx513q7827n6aq-shepherd.conf': (wrong-type-arg "string-append" "Wrong type (expecting ~A): ~S" ("string" #f) (#f)) , and then the reconfiguration hangs. /run/user/1000/shepherd/socket is created, and herd status shows that root is started, other services are not shown, and are not started. Content of config (/gnu/store/w6rlja8v65dwv16ivcqx513q7827n6aq-shepherd.conf): (begin (use-modules (srfi srfi-34) (system repl error-handling)) (apply register-services (map (lambda (file) (load file)) (quote ("/gnu/store/71n4r0hccps574aqcks7zyk5rz5zardq- shepherd-eww.scm" "/gnu/store/0r14z4psnf9h2nfqiflm0nv6m2bv04si-shepherd-eww-open-lockscreen-like-background.scm" "/gnu/store/ylidynn5akvk3lmqrxbgqkz0c8hn3y8c-shepherd-syncthing .scm" "/gnu/store/9igwbpbwavl6r94ph7qss7i5cqq9d8nj-shepherd-mcron.scm")))) (action (quote root) (quote daemonize)) (format #t "Starting services...~%") (let ((services-to-start (quote (eww eww-open-lockscreen-like-background syncthing mcron)))) (if (defined? (quote start-in-the-background)) (start-in-the-background services-to-start) (for-each start services-to-start)) (redirect-port (open-input-file "/dev/null") (current-input-port)))) ~/.local/state/log/shepherd.log does not contain anything that's not already in the messages above. Is there anything else I can provide? Without a running shepherd, my system doesn't work super well. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 18 21:43:08 2023 Received: (at 63982) by debbugs.gnu.org; 19 Jun 2023 01:43:08 +0000 Received: from localhost ([127.0.0.1]:55311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qB3v9-0005oc-Cd for submit@debbugs.gnu.org; Sun, 18 Jun 2023 21:43:07 -0400 Received: from mail-qt1-f175.google.com ([209.85.160.175]:53287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qB3v7-0005o9-5m for 63982@debbugs.gnu.org; Sun, 18 Jun 2023 21:43:05 -0400 Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-3fde9d3868fso8754681cf.2 for <63982@debbugs.gnu.org>; Sun, 18 Jun 2023 18:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687138979; x=1689730979; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=NPfaQZb0+Cxic9moDxNDUSCnQAU31ghcdXK/3eaP12U=; b=bo9jHJmaO4BjthH67LjY0sdifMqgEyfGdpIDXSG/7xWSolP0ql85a6nSHTaaOPkpQk L9DNatRvJPXLQVa1fNE52i+XHbmEBwsPSki2TLiy77v+oZDsZ8K3/adxKdmaU2vtrcKE 0vsffoFSk2AnqydE4T0lIfqOkuFRmyURhBXis2j5rTaA+1Vf7Wcpidhh1B+lC+zN9KEM QQdE8QtVoWXpRg2Ey1mKx+NWyXelu9D15bYU8NnG5rXxLppMQeHUXOQEjt3Tt9xDPLKm DfvWP42hmASd3k0R0yWN9OYmwc7mZr3r/tlHn1jFoA6o+mXnuH9GMYziY5jMZlSWaySj 3zGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687138979; x=1689730979; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NPfaQZb0+Cxic9moDxNDUSCnQAU31ghcdXK/3eaP12U=; b=dvWaY+TaoEPGWsTjAeyCzl2N7+eUvmhZD0/mQbq0tQZsuYFb6VZWmDS4XrL8DSHiBa 0Rx454vaXujQMUO7zl5kj6yLOOzTVOW4PZDuGagynt3ZEs65om9c5dXlMiPQoErxO07c TGhxXdG+pWJPWS1A6cgxQcTF76LkHvrep7O/GKBCKJbGRwZ16LIuA4q31prUi/DiPqZT dDIVZWeDD425jKFD4GGjoNUPDg/p2AxpFRV+nHx84/MaWK+s/XIysh5E7XpKWAcDphRC TtYoXnEQY6UrBuLvuO8zkS7BDYM+tzICf5mKqK0nQKR28EYnH3B8EjJD98UYpLeVBCI0 jjWw== X-Gm-Message-State: AC+VfDzD5OHmAsh92AveFRICyfY5e8BqsybAZZJGbV4x5ZHDL4QOFf4u b6zdZ/xIbLY+ohCPM3jvRUOg5VnYdXs= X-Google-Smtp-Source: ACHHUZ6rvfppkcWfqw1HTelIQS/Mu1CcBNay7LpiZxTd9eXlOpX44NjFr9f0QSzyAajEeJwKdUBHkg== X-Received: by 2002:a05:6214:2486:b0:61a:c2bf:9f0b with SMTP id gi6-20020a056214248600b0061ac2bf9f0bmr2213422qvb.6.1687138979324; Sun, 18 Jun 2023 18:42:59 -0700 (PDT) Received: from hurd (dsl-10-130-100.b2b2c.ca. [72.10.130.100]) by smtp.gmail.com with ESMTPSA id y9-20020a0ce049000000b0062628f1d1dfsm93203qvk.138.2023.06.18.18.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Jun 2023 18:42:58 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Service hangs in 'starting' with Shepherd 0.10 (was: Shepherd can crash when a user service fails to start) References: <87mt18blug.fsf@gmail.com> <87ilbsvlql.fsf@gnu.org> <87pm60wpr1.fsf@gmail.com> <87o7lirq9a.fsf@gnu.org> Date: Sun, 18 Jun 2023 21:42:57 -0400 In-Reply-To: <87o7lirq9a.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Wed, 14 Jun 2023 17:57:05 +0200") Message-ID: <87zg4wrzvi.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63982 Cc: 63982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludo, Ludovic Court=C3=A8s writes: > Hi, > > Maxim Cournoyer skribis: > >>> I believe this is fixed by Shepherd commit >>> 24c964021ebd3d63ce6e22808dd09dbe16116a6c, which introduces an additional >>> change: loading the config file asynchronously. >> >> Nitpick: I'd use a git message tag for 'Reported-by', as can be inserted >> in the commit buffer in Magit with C-c C-p. They should be placed at >> the bottom of the git message to be considered by tools parsing them. > > Neat, I didn=E2=80=99t know about it, I=E2=80=99ll do that now (I think I= started using > the =E2=80=9CReported by=E2=80=9D convention before Git came into existen= ce=E2=80=A6). > >>> If you wish to test it, you can use the =E2=80=98shepherd=E2=80=99 chan= nel. >> >> I've done so by placing in my ~/.config/guix/channels.scm file: >> >> (channel >> (name 'shepherd) >> (url "https://git.savannah.gnu.org/git/shepherd.git") >> (introduction >> (make-channel-introduction >> "788a6d6f1d5c170db68aa4bbfb77024fdc468ed3" ;2022-05-21 >> (openpgp-fingerprint >> "3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5")))) >> >> >> It'd be nice to have this in the Shepherd doc for easy copy & paste. > > I=E2=80=99ll add that to =E2=80=98README=E2=80=99. Neat, thank you. >>> Let me know how it goes! >> >> I've edited my ~/.xsession file to use >> /gnu/store/ahzl8vxxcd5bqlljwgn8wkp4884sr72l-shepherd-0.10.99-tarball, >> and I'm now seeing this: >> >> $ herd status >> D=C3=A9marr=C3=A9s=C2=A0: >> + root >> Starting: >> ^ emacs >> Arr=C3=AAt=C3=A9s=C2=A0: >> - gpg-agent >> - ibus-daemon >> - jackd >> - workrave > > Uh, so it remains in =E2=80=9Cstarting=E2=80=9D state? Yes! Which is surprising, because it's actually running fine, and Shepherd 0.9.3 didn't have this issue (perhaps because it only knew of a started/stopped service). The other surprising thing is that because it thinks that Emacs hasn't finished starting, it doesn't even attempt to try starting the other services; they remain stopped although they should work. [...] > Looks like it. Could you share ~/.local/var/log/shepherd.log? I have something a bit more detailed, with various versions (the logs are under ~/.local/state/shepherd/shepherd.log by default). If you need to, you should be able to reproduce on your end using the attached ~/.config/shepherd/{init.scm,services.scm} files (and ensuring the service commands are on your PATH): --8<---------------cut here---------------start------------->8--- Using /gnu/store/dblbnj1yra4yrrfjbnzsa0ldcl3170ap-shepherd-0.9.1/bin/shephe= rd $ herd status Started: + Emacs + Gpg-agent + ibus-daemon + jackd + root + workrave Using /gnu/store/cdc1gzbp3q15kdiwn2i5j3437jwx61ac-shepherd-0.9.2/bin/shephe= rd $ herd status Started: + emacs + gpg-agent + ibus-daemon + jackd + root + workrave Using /gnu/store/a9jdd8kgckwlq97yw3pjqs6sy4lqgrfq-shepherd-0.9.3/bin/shephe= rd $ herd status Started: + emacs + gpg-agent + ibus-daemon + jackd + root + workrave ~/.local/state/shepherd/shepherd.log: 2023-06-18 21:04:47 Service root d=C3=A9marr=C3=A9. 2023-06-18 21:04:57 Service emacs d=C3=A9marr=C3=A9. 2023-06-18 21:04:57 Service jackd d=C3=A9marr=C3=A9. 2023-06-18 21:04:57 Service gpg-agent d=C3=A9marr=C3=A9. 2023-06-18 21:04:57 Service ibus-daemon d=C3=A9marr=C3=A9. 2023-06-18 21:04:57 Service workrave d=C3=A9marr=C3=A9. Using /gnu/store/ahzl8vxxcd5bqlljwgn8wkp4884sr72l-shepherd-0.10.99-tarball/= bin/shepherd $ herd status Started: + root Starting: ^ emacs Stopped: - gpg-agent - ibus-daemon - jackd - workrave ~/.local/state/shepherd/shepherd.log: 2023-06-18 21:06:12 Starting service root... 2023-06-18 21:06:12 Service root started. 2023-06-18 21:06:12 Service root running with value #t. 2023-06-18 21:06:12 Service root d=C3=A9marr=C3=A9. 2023-06-18 21:06:12 Starting service emacs... 2023-06-18 21:06:12 [bash]=20 2023-06-18 21:06:12 [bash] Warning: due to a long standing Gtk+ bug 2023-06-18 21:06:12 [bash] https://gitlab.gnome.org/GNOME/gtk/issues/221 2023-06-18 21:06:12 [bash] Emacs might crash when run in daemon mode and th= e X11 connection is unexpectedly lost. 2023-06-18 21:06:12 [bash] Using an Emacs configured with --with-x-toolkit= =3Dlucid does not have this problem. 2023-06-18 21:06:13 [bash] Loading time (native compiled elisp)... 2023-06-18 21:06:13 [bash] Loading time (native compiled elisp)...done 2023-06-18 21:06:13 [bash] Loading /home/maxim/.emacs.d/recentf... 2023-06-18 21:06:13 [bash] Loading /home/maxim/.emacs.d/recentf...done 2023-06-18 21:06:13 [bash] Cleaning up the recentf list... 2023-06-18 21:06:13 [bash] Cleaning up the recentf list...done (0 removed) 2023-06-18 21:06:13 [bash] .emacs: Warning: Use keywords rather than deprec= ated positional arguments to `define-minor-mode' 2023-06-18 21:06:15 [bash] Preparing diary... 2023-06-18 21:06:15 [bash] No diary entries for Sunday, June 18, 2023: Fath= er's Day 2023-06-18 21:06:15 [bash] Preparing diary...done 2023-06-18 21:06:15 [bash] Appointment reminders enabled 2023-06-18 21:06:16 [bash] Loading /home/maxim/.emacs.d/emms/cache... 2023-06-18 21:06:16 [bash] Loading /home/maxim/.emacs.d/emms/cache...done 2023-06-18 21:06:18 [bash] [yas] Prepared just-in-time loading of snippets = successfully. 2023-06-18 21:06:20 [bash] [yas] Prepared just-in-time loading of snippets = successfully. 2023-06-18 21:06:22 [bash] Starting new Ispell process aspell with english = dictionary... \=20 2023-06-18 21:06:22 [bash] Starting new Ispell process aspell with english = dictionary...done 2023-06-18 21:06:22 [bash] Starting Emacs daemon. --8<---------------cut here---------------end--------------->8--- --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=init.scm Content-Transfer-Encoding: base64 Ozs7IFNoZXBoZXJkIFVzZXIgU2VydmljZXMKKGxvYWQgInNlcnZpY2VzLnNjbSIpCgoocmVnaXN0 ZXItc2VydmljZXMKIGVtYWNzCiBncGctYWdlbnQKIGphY2tkCiBpYnVzLWRhZW1vbgogd29ya3Jh dmUpCgo7OyBTZW5kIHNoZXBoZXJkIGludG8gdGhlIGJhY2tncm91bmQuCihhY3Rpb24gJ3NoZXBo ZXJkICdkYWVtb25pemUpCgo7OzsgRklYTUU6IEFsbCBkaXNhYmxlZCBiZWNhdXNlIG9mIHRoaXMg YnVnOiBodHRwczovL2lzc3Vlcy5ndWl4LmdudS5vcmcvNjM5ODIKOzsgU2VydmljZXMgdG8gc3Rh cnQgd2hlbiBzaGVwaGVyZCBzdGFydHM6Cihmb3ItZWFjaCBzdGFydCAnKGVtYWNzCiAgICAgICAg ICAgICAgICAgIGphY2tkCgkJICBncGctYWdlbnQKCQkgIGlidXMtZGFlbW9uCiAgICAgICAgICAg ICAgICAgIHdvcmtyYXZlKSkK --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=services.scm Content-Transfer-Encoding: base64 KGRlZmluZSBlbWFjcwogIChtYWtlIDxzZXJ2aWNlPgogICAgIzpwcm92aWRlcyAnKGVtYWNzKQog ICAgIzpyZXF1aXJlcyAnKCkKICAgICM6c3RhcnQgKG1ha2Utc3lzdGVtLWNvbnN0cnVjdG9yICJl bWFjcyAtLWRhZW1vbiIpCiAgICAjOnN0b3AgKG1ha2Utc3lzdGVtLWRlc3RydWN0b3IgImVtYWNz Y2xpZW50IC0tZXZhbCBcIihraWxsLWVtYWNzKVwiIikpKQoKKGRlZmluZSBpYnVzLWRhZW1vbgog IChtYWtlIDxzZXJ2aWNlPgogICAgIzpwcm92aWRlcyAnKGlidXMtZGFlbW9uKQogICAgIzpyZXF1 aXJlcyAnKCkKICAgICM6c3RhcnQgKG1ha2Utc3lzdGVtLWNvbnN0cnVjdG9yICJpYnVzLWRhZW1v biAtLXhpbSAtLWRhZW1vbml6ZSAtLXJlcGxhY2UiKQogICAgIzpzdG9wIChtYWtlLXN5c3RlbS1k ZXN0cnVjdG9yICJwa2lsbCBpYnVzLWRhZW1vbiIpKSkKCihkZWZpbmUgamFja2QKICAobWFrZSA8 c2VydmljZT4KICAgICM6cHJvdmlkZXMgJyhqYWNrZCkKICAgICM6cmVxdWlyZXMgJygpCiAgICAj OnN0YXJ0IChtYWtlLXN5c3RlbS1jb25zdHJ1Y3RvciAiamFja2QgLWQgYWxzYSAmIikKICAgICM6 c3RvcCAobWFrZS1zeXN0ZW0tZGVzdHJ1Y3RvciAicGtpbGwgamFja2QiKSkpCgooZGVmaW5lIGdw Zy1hZ2VudAogIChsZXQgKChwaW5lbnRyeSAoc3RyaW5nLWFwcGVuZCAoZ2V0ZW52ICJIT01FIikK CQkJCSAiLy5ndWl4LXByb2ZpbGUvYmluL3BpbmVudHJ5IikpKQogICAgKG1ha2UgPHNlcnZpY2U+ CiAgICAgICM6cHJvdmlkZXMgJyhncGctYWdlbnQpCiAgICAgICM6cmVxdWlyZXMgJygpCiAgICAg ICM6c3RhcnQgKG1ha2Utc3lzdGVtLWNvbnN0cnVjdG9yCgkgICAgICAgKHN0cmluZy1hcHBlbmQg ImdwZy1hZ2VudCAtLWRhZW1vbiAiCgkJCSAgICAgICItLXBpbmVudHJ5LXByb2dyYW0gIiBwaW5l bnRyeSkpCiAgICAgICM6c3RvcCAobWFrZS1zeXN0ZW0tZGVzdHJ1Y3RvciAiZ3BnY29uZiAtLWtp bGwgZ3BnLWFnZW50IikpKSkKCihkZWZpbmUgd29ya3JhdmUKICAobWFrZSA8c2VydmljZT4KICAg ICM6cHJvdmlkZXMgJyh3b3JrcmF2ZSkKICAgICM6cmVxdWlyZXMgJygpCiAgICAjOnN0YXJ0ICht YWtlLXN5c3RlbS1jb25zdHJ1Y3RvciAid29ya3JhdmUgJiIpCiAgICAjOnN0b3AgKG1ha2Utc3lz dGVtLWRlc3RydWN0b3IgInBraWxsIC05IHdvcmtyYXZlIikpKQo= --=-=-= Content-Type: text/plain -- Thanks, Maxim --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 21 10:21:12 2023 Received: (at 63982) by debbugs.gnu.org; 21 Jun 2023 14:21:12 +0000 Received: from localhost ([127.0.0.1]:33862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qByhr-0005US-UQ for submit@debbugs.gnu.org; Wed, 21 Jun 2023 10:21:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qByhp-0005UD-5b for 63982@debbugs.gnu.org; Wed, 21 Jun 2023 10:21:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qByhj-0000Im-Te; Wed, 21 Jun 2023 10:21:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=xdIvoGBO3gM6uDTR2EiUGJm+Jh9YVCi77GQg6Im4SiY=; b=X5gJYzFnxaNot+voFcRr 6EOcxbMOJOfnDoApW5ISFUxlI4PudwJwobGUnpzV9irwjqlwm6BGOCAqWqk5gaVs18ltT5FPXY8Dp hhE0uxPhKR6AUp7axzOWkkIY2YRvdc/H5L+V3o/i11emIkh0T1ZO/WsgEWDcezyDN4Dgf4f+BmkJt RjAsFXftfQZMHNw6uAgcqlQPzss9PrjIalDonv00V2kwjSfcY276rzhDHVXF4XP4qYwDn+MhInPa+ hES4N/LVQpBMcZ/ftLTzWGGFEmYjEIEQeuEN3/ttMBmw0wb6SZbdLASFfeWdG4yRPQ7hKlwWX5Eh3 Sumy2sG+ZD9xTQ==; Received: from [109.190.253.15] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qByhj-0000qC-Bg; Wed, 21 Jun 2023 10:21:03 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#63982: Shepherd can crash when a user service fails to start References: <87mt18blug.fsf@gmail.com> <87ilbsvlql.fsf@gnu.org> <87pm60wpr1.fsf@gmail.com> <87o7lirq9a.fsf@gnu.org> <87zg4wrzvi.fsf_-_@gmail.com> Date: Wed, 21 Jun 2023 16:20:58 +0200 In-Reply-To: <87zg4wrzvi.fsf_-_@gmail.com> (Maxim Cournoyer's message of "Sun, 18 Jun 2023 21:42:57 -0400") Message-ID: <87y1kc7v79.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63982 Cc: 63982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Maxim Cournoyer skribis: > The other surprising thing is that because it thinks that Emacs hasn't > finished starting, it doesn't even attempt to try starting the other > services; they remain stopped although they should work. This is because you=E2=80=99re starting them sequentially with: (for-each start =E2=80=A6) If you instead use =E2=80=98start-in-the-background=E2=80=99, it=E2=80=99ll= start them in parallel. (BTW, you might want to use the new interface eventually: .) > Using /gnu/store/ahzl8vxxcd5bqlljwgn8wkp4884sr72l-shepherd-0.10.99-tarbal= l/bin/shepherd > > $ herd status > Started: > + root > Starting: > ^ emacs > Stopped: > - gpg-agent > - ibus-daemon > - jackd > - workrave > > ~/.local/state/shepherd/shepherd.log: > > 2023-06-18 21:06:12 Starting service root... > 2023-06-18 21:06:12 Service root started. > 2023-06-18 21:06:12 Service root running with value #t. > 2023-06-18 21:06:12 Service root d=C3=A9marr=C3=A9. > 2023-06-18 21:06:12 Starting service emacs... > 2023-06-18 21:06:12 [bash]=20 > 2023-06-18 21:06:12 [bash] Warning: due to a long standing Gtk+ bug > 2023-06-18 21:06:12 [bash] https://gitlab.gnome.org/GNOME/gtk/issues/221 > 2023-06-18 21:06:12 [bash] Emacs might crash when run in daemon mode and = the X11 connection is unexpectedly lost. > 2023-06-18 21:06:12 [bash] Using an Emacs configured with --with-x-toolki= t=3Dlucid does not have this problem. > 2023-06-18 21:06:13 [bash] Loading time (native compiled elisp)... > 2023-06-18 21:06:13 [bash] Loading time (native compiled elisp)...done > 2023-06-18 21:06:13 [bash] Loading /home/maxim/.emacs.d/recentf... > 2023-06-18 21:06:13 [bash] Loading /home/maxim/.emacs.d/recentf...done > 2023-06-18 21:06:13 [bash] Cleaning up the recentf list... > 2023-06-18 21:06:13 [bash] Cleaning up the recentf list...done (0 removed) > 2023-06-18 21:06:13 [bash] .emacs: Warning: Use keywords rather than depr= ecated positional arguments to `define-minor-mode' > 2023-06-18 21:06:15 [bash] Preparing diary... > 2023-06-18 21:06:15 [bash] No diary entries for Sunday, June 18, 2023: Fa= ther's Day > 2023-06-18 21:06:15 [bash] Preparing diary...done > 2023-06-18 21:06:15 [bash] Appointment reminders enabled > 2023-06-18 21:06:16 [bash] Loading /home/maxim/.emacs.d/emms/cache... > 2023-06-18 21:06:16 [bash] Loading /home/maxim/.emacs.d/emms/cache...done > 2023-06-18 21:06:18 [bash] [yas] Prepared just-in-time loading of snippet= s successfully. > 2023-06-18 21:06:20 [bash] [yas] Prepared just-in-time loading of snippet= s successfully. > 2023-06-18 21:06:22 [bash] Starting new Ispell process aspell with englis= h dictionary... \=20 > 2023-06-18 21:06:22 [bash] Starting new Ispell process aspell with englis= h dictionary...done > 2023-06-18 21:06:22 [bash] Starting Emacs daemon. And what=E2=80=99s the process tree like, if you run =E2=80=9Cpstree -p N= =E2=80=9D where N is the PID of shepherd? It looks as though =E2=80=98bash -c "emacs --daemon"=E2=80=99 didn=E2=80=99= t terminate, which is what=E2=80=99s needed to transition from =E2=80=9Cstarting=E2=80=9D to =E2= =80=9Crunning=E2=80=9D. Could you =E2=80=98strace -f -s 100 -o /tmp/log.strace shepherd=E2=80=99, k= eeping only the =E2=80=98emacs=E2=80=99 service? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 22 16:09:22 2023 Received: (at 63982) by debbugs.gnu.org; 22 Jun 2023 20:09:22 +0000 Received: from localhost ([127.0.0.1]:36853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCQcM-00075A-6v for submit@debbugs.gnu.org; Thu, 22 Jun 2023 16:09:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCQcK-00074y-Dd for 63982@debbugs.gnu.org; Thu, 22 Jun 2023 16:09:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCQcC-0005gt-Rx; Thu, 22 Jun 2023 16:09:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=4i07T18NLQhHxGaiG+CJ4pmnz5UGvw2Y/QE6GtjpMzc=; b=H6/YbvJf9jSlKgwSdEqt 9d3mjxxuFQoLSfoRPsAADEnmyY6q2YynC1CcPjR/y+s5QMz1rrSxKVd74fGttNdjYPhFoChff0IMt OynABNjgCyld5CK27QW8T79YYnCl+TPlFkaOsxzMkPjHC5C5jJrtZJU6ygs9FpkWuDsTvSzRBa13Q zx3LOppcRoP7xupX31+cCRiotBdQQ9lJsJPpr0/DbykEjcuxfWUP1mqyCEhuDvHkz3rGhIo+muYss NGswayFxAdlGj89J7azlqEdFOZVmfy6Ui9qFNguOLZVMbVfgg+KKD3KqZalH53tKcR8weDwLGJwri kXeo/WTWtK9h2g==; Received: from lsm-cpl.in2p3.fr ([134.158.178.2] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCQc0-0007Wc-Jj; Thu, 22 Jun 2023 16:09:12 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: nils@landt.email Subject: Re: bug#63982: Shepherd can crash when a user service fails to start References: <87mt18blug.fsf@gmail.com> <1275452452.902121.1687101286088@office.mailbox.org> Date: Thu, 22 Jun 2023 22:08:56 +0200 In-Reply-To: <1275452452.902121.1687101286088@office.mailbox.org> (nils@landt.email's message of "Sun, 18 Jun 2023 17:14:46 +0200 (CEST)") Message-ID: <87cz1n45uv.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63982 Cc: "63982@debbugs.gnu.org" <63982@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, nils@landt.email skribis: > 0.10.99: > Starting service root... > Service root started. > Service root running with value #t. > Service root has been started. > WARNING: Use of `load' in declarative module (#{ g119}#). Add #:declarat= ive? #f to your define-module invocation. > Uncaught exception while loading configuration file '/gnu/store/w6rlja8v6= 5dwv16ivcqx513q7827n6aq-shepherd.conf': (wrong-type-arg "string-append" "Wr= ong type (expecting ~A): ~S" > ("string" #f) (#f)) > > , and then the reconfiguration hangs. /run/user/1000/shepherd/socket is c= reated, and herd status shows that root is started, other services are not = shown, and are not started. > > > Content of config (/gnu/store/w6rlja8v65dwv16ivcqx513q7827n6aq-shepherd.c= onf): > (begin (use-modules (srfi srfi-34) (system repl error-handling)) (apply r= egister-services (map (lambda (file) (load file)) (quote ("/gnu/store/71n4r= 0hccps574aqcks7zyk5rz5zardq- > shepherd-eww.scm" "/gnu/store/0r14z4psnf9h2nfqiflm0nv6m2bv04si-shepherd-e= ww-open-lockscreen-like-background.scm" "/gnu/store/ylidynn5akvk3lmqrxbgqkz= 0c8hn3y8c-shepherd-syncthing > .scm" "/gnu/store/9igwbpbwavl6r94ph7qss7i5cqq9d8nj-shepherd-mcron.scm")))= ) (action (quote root) (quote daemonize)) (format #t "Starting services...~= %") (let ((services-to-start > (quote (eww eww-open-lockscreen-like-background syncthing mcron)))) (if (= defined? (quote start-in-the-background)) (start-in-the-background services= -to-start) (for-each start > services-to-start)) (redirect-port (open-input-file "/dev/null") (current= -input-port)))) This suggests a problem in the config file: one of the shepherd-*.scm files listed above ends up calling (string-append #f =E2=80=A6). We=E2=80=99d need to see those files to understand what=E2=80=99s happening= but it looks different from what Maxim reported. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 22 17:35:21 2023 Received: (at 63982) by debbugs.gnu.org; 22 Jun 2023 21:35:21 +0000 Received: from localhost ([127.0.0.1]:36886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCRxZ-0000r6-FQ for submit@debbugs.gnu.org; Thu, 22 Jun 2023 17:35:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCRxW-0000qr-Oe for 63982@debbugs.gnu.org; Thu, 22 Jun 2023 17:35:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCRxR-0000WU-E6; Thu, 22 Jun 2023 17:35:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=2QGQM+qVY1PKWVkeuFNERzdTmm89+LEpMu+0Mr5HtmI=; b=e3VL4ji8kSGs7UeYs1qy HY127SZk8mM7bxm5eVmxzz6oC3y015Vc0tdN2MkBXDgmsGAmwNM9A7evfXw2LGJyHY6RKJt/xrbCf an/x7WSemgbljs/NV2naO+cUeKc0y1MV+6aeXSpynp3y76SCALdXVuhPTKNJCe/haqU2LyDSMSDCe hKOZ6SMJnF1G67xF/1WsM0j7fdmIrNF40togh014E0p+4VxkguVW6k52t68BNt/SRquU45TndCjmH VaflRzRKoDD1VkkgGOvPS7aGFQgFLe+Dz1qQUpiiR4UO225rcBVGIEZT6h5UNMwi78VSFlweXvN6K HkX9XPGepZF2TA==; Received: from lsm-cpl.in2p3.fr ([134.158.178.2] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCRxK-0002vh-KI; Thu, 22 Jun 2023 17:35:12 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#63982: Shepherd can crash when a user service fails to start References: <87mt18blug.fsf@gmail.com> <87ilbsvlql.fsf@gnu.org> <87pm60wpr1.fsf@gmail.com> <87o7lirq9a.fsf@gnu.org> <87zg4wrzvi.fsf_-_@gmail.com> Date: Thu, 22 Jun 2023 23:35:04 +0200 In-Reply-To: <87zg4wrzvi.fsf_-_@gmail.com> (Maxim Cournoyer's message of "Sun, 18 Jun 2023 21:42:57 -0400") Message-ID: <878rcb41vb.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63982 Cc: 63982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: [...] >> Uh, so it remains in =E2=80=9Cstarting=E2=80=9D state? > > Yes! Turns out that this happens when calling the =E2=80=98daemonize=E2=80=99 ac= tion on =E2=80=98root=E2=80=99. I have a reproducer now and am investigating=E2=80= =A6 Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 25 10:33:37 2023 Received: (at 63982) by debbugs.gnu.org; 25 Jun 2023 14:33:37 +0000 Received: from localhost ([127.0.0.1]:43212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDQo2-0001zS-8q for submit@debbugs.gnu.org; Sun, 25 Jun 2023 10:33:37 -0400 Received: from mout-p-101.mailbox.org ([80.241.56.151]:51606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDPPS-0007wi-39 for 63982@debbugs.gnu.org; Sun, 25 Jun 2023 09:04:07 -0400 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4QprlL6pSmz9sbg; Sun, 25 Jun 2023 15:03:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=landt.email; s=MBO0001; t=1687698238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=okBh6D+qQXXi7pH0T0oEhHjAYKbYNREunIRrMHWpIIs=; b=uSYs49M1clkTYMLWkM6N1yPu/3gB7A5q9r/I/9g2e/NDgKIpTa0m1mS+fGTbCsF6zkwxtV rD58ttdfhxpoA/x4BeXiuoaWwzD1cetPCN6ml/1jlbUrq5tYNRGQrkfPnFFl+8sMVueaWT vOQJ/7BJF7Qmp4EQ8eMkHRMgsj+Z25JKF5xbOv+GjH2lkw7T+E1dqLpIDF6VgjiTYiqvpN rpSU7/83kPQuHeEZjbcx88wEyfbYhW48p+VEF1MxW7/kOz/kZJf77D6aM9gcx5/QeVLhFS 8bNXtm/3804F3MVc4Nk83Z60BbIGmoSyAjKBWcS5q21zA3V1Ob4tQ4yRcQlAAg== Date: Sun, 25 Jun 2023 15:03:58 +0200 (CEST) From: nils@landt.email To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Message-ID: <84694188.1493786.1687698238340@office.mailbox.org> In-Reply-To: <87cz1n45uv.fsf_-_@gnu.org> References: <87mt18blug.fsf@gmail.com> <1275452452.902121.1687101286088@office.mailbox.org> <87cz1n45uv.fsf_-_@gnu.org> Subject: Re: bug#63982: Shepherd can crash when a user service fails to start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Normal X-Rspamd-Queue-Id: 4QprlL6pSmz9sbg X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63982 X-Mailman-Approved-At: Sun, 25 Jun 2023 10:33:33 -0400 Cc: "63982@debbugs.gnu.org" <63982@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Ludovic Court=C3=A8s hat am 22.06.2023 22:08 CEST geschrie= ben: > This suggests a problem in the config file: one of the shepherd-*.scm > files listed above ends up calling (string-append #f =E2=80=A6). >=20 > We=E2=80=99d need to see those files to understand what=E2=80=99s happeni= ng but it looks > different from what Maxim reported. Indeed I misdiagnosed the issue because it happened after a guix upgrade. I used $XDG_LOG_HOME in my shepherd services, and as of f74df2ab879fc545798= 2bbc85b7455a90e82317d this is no longer set by default.=20 Thanks for your help! From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 11:53:33 2023 Received: (at 63982) by debbugs.gnu.org; 26 Jun 2023 15:53:33 +0000 Received: from localhost ([127.0.0.1]:46904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDoWz-000483-9d for submit@debbugs.gnu.org; Mon, 26 Jun 2023 11:53:33 -0400 Received: from mail-qv1-f45.google.com ([209.85.219.45]:58759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDoWx-00047p-DK for 63982@debbugs.gnu.org; Mon, 26 Jun 2023 11:53:31 -0400 Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-62ffe4cabc0so27873396d6.1 for <63982@debbugs.gnu.org>; Mon, 26 Jun 2023 08:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687794805; x=1690386805; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=ToRJTm3it8uKwjut7slZc6G7eBYY24MOPSXfDNb80G8=; b=ZjF7rKlrgC66ZABllCakxYGYKwJ9peJSYMUiTyt2agNTsfivTT1GoQUk14M2adPZu2 dFPpYsIB/TTXQj1Yj2QRtF5tGGv3YwjGCr0RrrI0CM+np5/F8WasBw/UuvUg8ZiVRG0m 0ib8r7DDBU/QdGU9tMwpEEGmPKLtHJjMUpMoFcw8EWq9zKALnlg0vCTOyTztT8MnPbXk K7psTf9pvPDnkvci+bs4jGpkDUpyK5osRYvfjYY5AHafP74YTyQGBP9tNa6z4bN/th/D B3WVVfaP1lxtcuSCni9sSsfTKaRoF0zMv4XSW6vRgLfJkueDfCtEbz2cMZaJTieQe5/9 kCMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687794805; x=1690386805; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ToRJTm3it8uKwjut7slZc6G7eBYY24MOPSXfDNb80G8=; b=fvnP8UVv+YUDCFVxfDGLASA1f1BZ7rjwUZyVuHI9xdbkrsrxJsNHo6PfR+Jf6dqW9R 4XzYQ5IXWvSoRTEAfBYNhR+/OhECqNHyQlSS+bLHqHgmPNBBlkrYsMcKZlLayPCiuG3B TXe5jCykOsw4YsrnTdfou3uJAB6x5G8TKxYAg0tVrHaJRBKh3dPYBpMHHFRzedchOYCC tH2PYckbV+6yQQM2Ly875q2HLQnxQYrfyLz5/M0iOUt1W04IlbW/mwwKZF1/i+coYMNn ifWhTSGqvfnYfeQ1nX9r6LRiuDIUfukEwVUlP6JU6EtU4q0ub2U8cdCpUBQ9oJhg+BMN feGA== X-Gm-Message-State: AC+VfDydr8WL5lMqEkRk9fD3orlW1sbD5NlrNTKnytM6BLdttX8WXDmH LyP2DzltGwzUDshA6lbJTMo6cqqnBTg= X-Google-Smtp-Source: ACHHUZ7LmJU+LoflYmZT54BdzwsHAEBLvK61xMO/IhwI7tp3QHQw2cM92R7ikp3xUoE+ayg/Mtzygw== X-Received: by 2002:a05:6214:410:b0:61b:79ab:7129 with SMTP id z16-20020a056214041000b0061b79ab7129mr41199744qvx.37.1687794805137; Mon, 26 Jun 2023 08:53:25 -0700 (PDT) Received: from hurd (dsl-205-236-230-110.b2b2c.ca. [205.236.230.110]) by smtp.gmail.com with ESMTPSA id oj2-20020a056214440200b0062fffa42cc5sm3280026qvb.79.2023.06.26.08.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 08:53:24 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#63982: Shepherd can crash when a user service fails to start References: <87mt18blug.fsf@gmail.com> <87ilbsvlql.fsf@gnu.org> <87pm60wpr1.fsf@gmail.com> <87o7lirq9a.fsf@gnu.org> <87zg4wrzvi.fsf_-_@gmail.com> <878rcb41vb.fsf_-_@gnu.org> Date: Mon, 26 Jun 2023 11:53:23 -0400 In-Reply-To: <878rcb41vb.fsf_-_@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Thu, 22 Jun 2023 23:35:04 +0200") Message-ID: <87v8fa1aq4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63982 Cc: 63982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Ludo, Ludovic Court=C3=A8s writes: > Hi, > > Maxim Cournoyer skribis: > >> Ludovic Court=C3=A8s writes: > > [...] > >>> Uh, so it remains in =E2=80=9Cstarting=E2=80=9D state? >> >> Yes! > > Turns out that this happens when calling the =E2=80=98daemonize=E2=80=99 = action on > =E2=80=98root=E2=80=99. I have a reproducer now and am investigating=E2= =80=A6 Great, thanks for investigating and let me know if I can provide something useful. It seems introducing cooperative scheduling is a path layered with traps, eh :-). --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 12 13:11:36 2023 Received: (at control) by debbugs.gnu.org; 12 Jul 2023 17:11:36 +0000 Received: from localhost ([127.0.0.1]:52870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJdNH-0005P1-Rf for submit@debbugs.gnu.org; Wed, 12 Jul 2023 13:11:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJdNG-0005Ol-Kj for control@debbugs.gnu.org; Wed, 12 Jul 2023 13:11:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJdNB-0001Fz-Er for control@debbugs.gnu.org; Wed, 12 Jul 2023 13:11:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to: references; bh=ClfVeSJVb+/VN7AallgflmvcJghVgSkdzbdGxrNuJwc=; b=ni6liDlsM1497X 4JHlMgJqmx+++/aXu4tChk7nrTpEFNaOVQ2pugyI0MJb1T0RBnk+5KfrZAEDnFwd5frC53p7nwBOl 0wNSp1gBEVgytRgd+dSb6Y3HHt/yaH4sBe6hXmo/XXqsoQA450EfOPIu/UOPNQWldm4d/LY3/nVel fyuKtiSrEbz1oJZ+wJ4D6ShAUm/nPheCisOGteKicGpADpeshJA7pq7uQTi7suK7EneGBnyNMcHgG ZJHUUV+D8UaiIobxjbDIN4UaDmMnjYHEypQpJZTVI6IxyPzYtV4qzOG6k0ng0b9OVk9UVaIR1aGJA Se/fgHJa74EXFE4kAYDA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJdNB-0007gM-2U for control@debbugs.gnu.org; Wed, 12 Jul 2023 13:11:29 -0400 Date: Wed, 12 Jul 2023 19:11:27 +0200 Message-Id: <87y1jl12dc.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #63982 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) retitle 63982 [Shepherd] shepherd does not handle signals after 'daemonize' quit From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 12 13:47:08 2023 Received: (at 63982) by debbugs.gnu.org; 12 Jul 2023 17:47:08 +0000 Received: from localhost ([127.0.0.1]:52911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJdvf-0000Of-RW for submit@debbugs.gnu.org; Wed, 12 Jul 2023 13:47:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJdvd-0000O9-Dd for 63982@debbugs.gnu.org; Wed, 12 Jul 2023 13:47:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJdvX-0007XV-JB; Wed, 12 Jul 2023 13:46:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=RIRMf0vtkZDttVTaQoUZDimaL0r7DS5e54O1ycNojSI=; b=V16LzW0jiJ9b9OZ+GaAJ 7PJFOBXf305jvK1vXtbms9VLgLbZ6vxYBca28dVaoFS1E8X8oCs1mKphYBZIqaIanGo6a509/Fanl 2s4cyphQ+X+YIHiX8PvgcbjrUJdoW6YDx/f88C5mk7LN35PCbvwxV4cbo3O3P3TxxiiijVu0xon7U F4BGPgFbAB6Ht9bu6n5b3PpFIwxn22aGd9cYZQvmZgMS0q3MyQAYn7qg+0mwmexyhZd74/7vwN9Qc m+O/iYycm06F9McxPy0j68Ah7Xsy865lMAUMbMYSNq0sDcmMYuirUjKRKAH6nrf9cw3xUQr4B/Zym MU2smMjUfs7mDg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJdvX-0006ub-6T; Wed, 12 Jul 2023 13:46:59 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#63982: Shepherd can crash when a user service fails to start References: <87mt18blug.fsf@gmail.com> <87ilbsvlql.fsf@gnu.org> <87pm60wpr1.fsf@gmail.com> <87o7lirq9a.fsf@gnu.org> <87zg4wrzvi.fsf_-_@gmail.com> <878rcb41vb.fsf_-_@gnu.org> Date: Wed, 12 Jul 2023 19:46:56 +0200 In-Reply-To: <878rcb41vb.fsf_-_@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Thu, 22 Jun 2023 23:35:04 +0200") Message-ID: <87ttu910q7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63982 Cc: 63982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Ludovic Court=C3=A8s skribis: > Turns out that this happens when calling the =E2=80=98daemonize=E2=80=99 = action on > =E2=80=98root=E2=80=99. I have a reproducer now and am investigating=E2= =80=A6 Good news: this is fixed in Shepherd commit f4272d2f0f393d2aa3e9d76b36ab6aa5f2fc72c2! The root cause is inconsistent semantics when mixing epoll, signalfd, and fork, specifically this part from signalfd(2): epoll(7) semantics If a process adds (via epoll_ctl(2)) a signalfd file descriptor to= an epoll(7) instance, then epoll_wait(2) returns events only for sign= als sent to that process. In particular, if the process then uses fork= (2) to create a child process, then the child will be able to read(2) s= ig=E2=80=90 nals that are sent to it using the signalfd file descriptor, = but epoll_wait(2) will not indicate that the signalfd file descriptor = is ready. In this scenario, a possible workaround is that after = the fork(2), the child process can close the signalfd file descriptor t= hat it inherited from the parent process and then create another signa= lfd file descriptor and add it to the epoll instance. [=E2=80=A6] The C program below illustrates this behavior: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline; filename=signalfd+epoll.c Content-Transfer-Encoding: quoted-printable Content-Description: The C program. #include #include #include #include #include #include int main () { int ep, sfd; sigset_t signals; sigemptyset (&signals); sigaddset (&signals, SIGINT); sigaddset (&signals, SIGHUP); sigprocmask (SIG_BLOCK, &signals, NULL); sfd =3D signalfd (-1, &signals, SFD_CLOEXEC); ep =3D epoll_create1 (EPOLL_CLOEXEC); struct epoll_event events =3D { .events =3D EPOLLIN | EPOLLONESHOT, .data= =3D NULL }; epoll_ctl (ep, EPOLL_CTL_ADD, sfd, &events); epoll_wait (ep, &events, 1, 123); if (fork () =3D=3D 0) { /* Quoth signalfd(2): If a process adds (via epoll_ctl(2)) a signalfd file descriptor to an epoll(7) instance, then epoll_wait(2) returns events only for signals sent to that process. In particular, if the process then uses fork(2) to create a child process, then the child will be able to read(2) sig=E2= =80=90 nals that are sent to it using the signalfd file descriptor, but epoll_wait(2) will not indicate that the signalfd file descriptor is ready. */ printf ("try this: kill -INT %i\n", getpid ()); while (1) { struct signalfd_siginfo info; if (epoll_wait (ep, &events, 1, 777) > 0) { read (sfd, &info, sizeof info); printf ("got signal %i!\n", info.ssi_signo); epoll_ctl (ep, EPOLL_CTL_MOD, sfd, &events); } } } return 0; } --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Of course it took me a while to find out about this; I first looked at things individually and didn=E2=80=99t expect the mixture to behave inconsistently. Maxim, let me know if it works for you! Thanks, Ludo=E2=80=99. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 18 21:11:56 2023 Received: (at 63982-done) by debbugs.gnu.org; 19 Jul 2023 01:11:56 +0000 Received: from localhost ([127.0.0.1]:54541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLvjP-00037e-Ku for submit@debbugs.gnu.org; Tue, 18 Jul 2023 21:11:56 -0400 Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:46532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLvjK-00037N-88 for 63982-done@debbugs.gnu.org; Tue, 18 Jul 2023 21:11:53 -0400 Received: by mail-qt1-x82d.google.com with SMTP id d75a77b69052e-403fab47687so8446811cf.1 for <63982-done@debbugs.gnu.org>; Tue, 18 Jul 2023 18:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689729104; x=1692321104; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=YooKPkzD/Oa8Oh4hN8i5eIJxI9xxZ/KcKMxFMXsfkv0=; b=F9VibykMqeEA49G4J9eqFeyDyL9MBDVnfDykzZQv9dGq5NHzS+1joOLcSdgCsa/BfG H3/jzlixJaIm7OUXc1zMWg06eDHzdqeFBWM6a2K7T8qf8gOIf4y97vmz3d9tQ2PxsC0e LZdScCm/RzqwkZXemiasRdjT5kZj1Ru5/321arK1VCYvfvpuIAr1wH7mQsRsHNIkl/53 3sk4+CKOFRzuTIPXM508RWbDHaJPSB4fFmXH2BrVxx2K4RGI8XRDa37InjyMifa9YyOh D//OicIX5hMICkmt7Idtrgiw8JVWQaQTp//TpBbGCEoAZYGazNDhIrKuFA4efuXWqRJ1 QZtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689729104; x=1692321104; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=YooKPkzD/Oa8Oh4hN8i5eIJxI9xxZ/KcKMxFMXsfkv0=; b=Kv/OvKpb67e2kD6TQ/o6shGYGdmN/vftyTo+jEXFEC9Bc3ZYsQdUxY3ZPFfMv9tyTA Ocu9u+WzxvqWPJchq8sYWPDKkm1Im7jUetlltNXo56AdVhxUpYezRtJYnPWKYS1wlMiw UmuS5H03BKvSESiCGmYGgtvvpahzC+T2jwYpdgQ+yx1+yV3zm8KtZghy7cr9D7Aao18F DhoT63otNeDsACNV7KuoeJeBYkij+sai614x5FwIarANQHe0lBao0AfyMPRexlJDfW74 I95jS1WWQ74rxOKh6l3Og8FuS1Wo7M0h68t79Wm9NZhRzz/347bXCg9IRIFVwE7E5Kzs rf3A== X-Gm-Message-State: ABy/qLbQI7XmoXMDtcKQFL3GtncAwHJ6U9xzERfa3J0fjur7q6yvhM6k 1raX0YQU5SKFWc0poLlV7lwO3PWGpr8= X-Google-Smtp-Source: APBJJlFTaSJWn7hNzlG3A+4QTHZS0MXo76mfoa7YGDTfo52Cr0cO9Zb9YKFyp3NF9GqUCl16cfr9bQ== X-Received: by 2002:ac8:590c:0:b0:3ff:23e4:40b4 with SMTP id 12-20020ac8590c000000b003ff23e440b4mr1233061qty.42.1689729104527; Tue, 18 Jul 2023 18:11:44 -0700 (PDT) Received: from hurd (dsl-154-160.b2b2c.ca. [66.158.154.160]) by smtp.gmail.com with ESMTPSA id k5-20020ac80745000000b00403715e4cb7sm996197qth.79.2023.07.18.18.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 18:11:43 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#63982: Shepherd can crash when a user service fails to start References: <87mt18blug.fsf@gmail.com> <87ilbsvlql.fsf@gnu.org> <87pm60wpr1.fsf@gmail.com> <87o7lirq9a.fsf@gnu.org> <87zg4wrzvi.fsf_-_@gmail.com> <878rcb41vb.fsf_-_@gnu.org> <87ttu910q7.fsf@gnu.org> Date: Tue, 18 Jul 2023 21:11:42 -0400 In-Reply-To: <87ttu910q7.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Wed, 12 Jul 2023 19:46:56 +0200") Message-ID: <87sf9kln75.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 63982-done Cc: 63982-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hey Ludo! Ludovic Court=C3=A8s writes: > Hi! > > Ludovic Court=C3=A8s skribis: > >> Turns out that this happens when calling the =E2=80=98daemonize=E2=80=99= action on >> =E2=80=98root=E2=80=99. I have a reproducer now and am investigating=E2= =80=A6 > > Good news: this is fixed in Shepherd commit > f4272d2f0f393d2aa3e9d76b36ab6aa5f2fc72c2! > > The root cause is inconsistent semantics when mixing epoll, signalfd, > and fork, specifically this part from signalfd(2): > > epoll(7) semantics > If a process adds (via epoll_ctl(2)) a signalfd file descriptor = to an > epoll(7) instance, then epoll_wait(2) returns events only for si= gnals > sent to that process. In particular, if the process then uses fo= rk(2) > to create a child process, then the child will be able to read(2) = sig=E2=80=90 > nals that are sent to it using the signalfd file descriptor= , but > epoll_wait(2) will not indicate that the signalfd file descripto= r is > ready. In this scenario, a possible workaround is that afte= r the > fork(2), the child process can close the signalfd file descriptor = that > it inherited from the parent process and then create another sig= nalfd > file descriptor and add it to the epoll instance. [=E2=80=A6] > > The C program below illustrates this behavior: > > #include > #include > #include > #include > #include > #include > > int > main () > { > int ep, sfd; > > sigset_t signals; > sigemptyset (&signals); > sigaddset (&signals, SIGINT); > sigaddset (&signals, SIGHUP); > > sigprocmask (SIG_BLOCK, &signals, NULL); > sfd =3D signalfd (-1, &signals, SFD_CLOEXEC); > > ep =3D epoll_create1 (EPOLL_CLOEXEC); > > struct epoll_event events =3D { .events =3D EPOLLIN | EPOLLONESHOT, .da= ta =3D NULL }; > epoll_ctl (ep, EPOLL_CTL_ADD, sfd, &events); > > epoll_wait (ep, &events, 1, 123); > > if (fork () =3D=3D 0) > { > /* Quoth signalfd(2): > > If a process adds (via epoll_ctl(2)) a signalfd file descriptor to an > epoll(7) instance, then epoll_wait(2) returns events only for signals > sent to that process. In particular, if the process then uses fork(2) > to create a child process, then the child will be able to read(2) sig= =E2=80=90 > nals that are sent to it using the signalfd file descriptor, but > epoll_wait(2) will not indicate that the signalfd file descriptor is > ready. */ > > printf ("try this: kill -INT %i\n", getpid ()); > while (1) > { > struct signalfd_siginfo info; > if (epoll_wait (ep, &events, 1, 777) > 0) > { > read (sfd, &info, sizeof info); > printf ("got signal %i!\n", info.ssi_signo); > epoll_ctl (ep, EPOLL_CTL_MOD, sfd, &events); > } > } > } > > return 0; > } > > > Of course it took me a while to find out about this; I first looked at > things individually and didn=E2=80=99t expect the mixture to behave > inconsistently. Tricky! Thanks for sharing the result of your investigation, it's always enlightening! > Maxim, let me know if it works for you! Better than ever! Thanks a lot for fixing the various issues reported here. I'm closing this one! --=20 Thanks, Maxim From unknown Thu Aug 14 18:38:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 16 Aug 2023 11:24:12 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator