From: "buma2023@outlook.fr" <buma2023@outlook.fr>
To: 64455@debbugs.gnu.org
Cc: "buma2023@outlook.fr" <buma2023@outlook.fr>
Subject: bug#64455: shepherd: unable to use redefined system/system* in 0.10.1
Date: Mon, 3 Jul 2023 17:46:33 +0000 [thread overview]
Message-ID: <LO3P265MB188114B5038D45A8F6AA5EB0B129A@LO3P265MB1881.GBRP265.PROD.OUTLOOK.COM> (raw)
[-- Attachment #1: Type: text/plain, Size: 2110 bytes --]
Hello,
I am using happily shepherd since a few years as my init system on
Debian: amd64 (desktop and notebook), armhf (Cubox).
I was using 0.9.1 with guile-3.0.5 and fibers-1.1.1.
I recently tried 0.10.1 with guile-3.0.9 and fibers 1.3.1 and
encountered a problem with using system and system* in my services:
the simple fact to have the symbol system or system* in
/etc/shepherd.scm or included files (even if the command is not
executed) leads to a misbehaving shepherd, more specifically the
shepherd socket disappears; the system boots but with multiple
instances of the launched daemons.
If a system/system* command is executed while booting, shepherd
blocks at the point of its execution.
Example of service causing the failure:
(register-services
(make <service>
#:provides '(mytest)
#:start (lambda args
(system "touch /tmp/somefile")
#t)
))
The service is not started at boot, I have to do it manually afterwards,
but I never can go there, as the shepherd socket is missing.
I I add at the end of /etc/shepherd.scm:
(system "touch /tmp/somefile")
I have the same problem.
Strangely at build time the test tests/system-star.sh succeeds, and
after I have booted (without refering to a system/system* command) , I
can run:
# export PID=$$; herd eval root "(system \"echo success! >/proc/$PID/fd/1\")"
(in my case, output appears in /var/log/syslog so I need the redirection)
I have read a bit documentation and code to be aware that system and
system* were redefined in shepherd to be non blocking, I suspect the
problem is how this is done.
I would prefer to have new names in shepherd for the redefined
system/system* and keep the old ones intact.
I have a workaround for this problem: replacing system/system* by
helpers I use, like:
(define (system-value command)
"Return first line of output when calling (system command)"
(let* ((port (open-input-pipe command))
(str (read-line port)))
(close-pipe port)
str))
but this is a band-aid.
[-- Attachment #2: Type: text/html, Size: 4819 bytes --]
next reply other threads:[~2023-07-09 13:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-03 17:46 buma2023 [this message]
2023-07-10 22:46 ` bug#64455: shepherd: unable to use redefined system/system* in 0.10.1 Ludovic Courtès
2023-07-11 13:22 ` Ludovic Courtès
2023-07-30 17:23 ` urb59
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=LO3P265MB188114B5038D45A8F6AA5EB0B129A@LO3P265MB1881.GBRP265.PROD.OUTLOOK.COM \
--to=buma2023@outlook.fr \
--cc=64455@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).