make check TESTS="tests/close-on-exec.sh" fails for me in shepherd.
it's the same with master, with v0.10.2, and with v0.10.1. i didn't check other revisions. the log file is attached. HTH, -- • attila lendvai • PGP: 963F 5D5F 45C7 DFCD 0A39 -- You cannot enslave a mind that knows itself, that values itself, that understands itself.
+ shepherd --version shepherd (GNU Shepherd) 0.10.2 Copyright (C) 2023 the Shepherd authors License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. + herd --version herd (GNU Shepherd) 0.10.2 Copyright (C) 2023 the Shepherd authors License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. + socket=t-socket-12913 + conf=t-conf-12913 + log=t-log-12913 + pid=t-pid-12913 + c_file=t-count-file-descriptors-12913.c + exe=/home/alendvai/workspace/guix/shepherd/t-count-file-descriptors-12913 + fd_count=/home/alendvai/workspace/guix/shepherd/t-fd-count-12913 + herd='herd -s t-socket-12913' + trap 'cat t-log-12913 || true; rm -f t-socket-12913 t-conf-12913 t-log-12913 /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 t-count-file-descriptors-12913.c /home/alendvai/workspace/guix/shepherd/t-count-file-descriptors-12913; test -f t-pid-12913 && kill `cat t-pid-12913` || true; rm -f t-pid-12913' EXIT + '[' -d /proc/self/fd ']' + cat + gcc -Wall t-count-file-descriptors-12913.c -o /home/alendvai/workspace/guix/shepherd/t-count-file-descriptors-12913 + /home/alendvai/workspace/guix/shepherd/t-count-file-descriptors-12913 0 -> /dev/pts/1 1 -> /home/alendvai/workspace/guix/shepherd/tests/close-on-exec.log 2 -> /home/alendvai/workspace/guix/shepherd/tests/close-on-exec.log 3 -> /proc/12945/fd + cat ++ type -P sleep + rm -f t-pid-12913 /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 + test -f t-pid-12913 + sleep 0.3 + shepherd -I -s t-socket-12913 -c t-conf-12913 -l t-log-12913 --pid=t-pid-12913 Starting service root... Service root started. Service root running with value #t. Service root has been started. Configuration successfully loaded from 't-conf-12913'. + test -f t-pid-12913 ++ cat t-pid-12913 + shepherd_pid=12949 + kill -0 12949 + herd -s t-socket-12913 start inetd-ctor Starting service inetd-ctor... Service inetd-ctor started. Service inetd-ctor running with value (#<input-output: socket 17>). Service inetd-ctor has been started. + ls -l /proc/12949/fd total 0 lr-x------ 1 alendvai users 64 Nov 17 21:46 0 -> /dev/null l-wx------ 1 alendvai users 64 Nov 17 21:46 1 -> /home/alendvai/workspace/guix/shepherd/tests/close-on-exec.log lrwx------ 1 alendvai users 64 Nov 17 21:46 10 -> anon_inode:[signalfd] l-wx------ 1 alendvai users 64 Nov 17 21:46 11 -> pipe:[16921055] lr-x------ 1 alendvai users 64 Nov 17 21:46 12 -> pipe:[16920173] l-wx------ 1 alendvai users 64 Nov 17 21:46 13 -> pipe:[16920173] lrwx------ 1 alendvai users 64 Nov 17 21:46 14 -> anon_inode:[eventpoll] lrwx------ 1 alendvai users 64 Nov 17 21:46 15 -> socket:[16920174] lrwx------ 1 alendvai users 64 Nov 17 21:46 17 -> socket:[16920178] l-wx------ 1 alendvai users 64 Nov 17 21:46 2 -> /home/alendvai/workspace/guix/shepherd/tests/close-on-exec.log lr-x------ 1 alendvai users 64 Nov 17 21:46 3 -> pipe:[16918174] l-wx------ 1 alendvai users 64 Nov 17 21:46 4 -> pipe:[16918174] lr-x------ 1 alendvai users 64 Nov 17 21:46 5 -> /home/alendvai/workspace/guix/shepherd/shepherd l-wx------ 1 alendvai users 64 Nov 17 21:46 6 -> /home/alendvai/workspace/guix/shepherd/t-log-12913 lr-x------ 1 alendvai users 64 Nov 17 21:46 7 -> pipe:[16920172] l-wx------ 1 alendvai users 64 Nov 17 21:46 8 -> pipe:[16920172] lr-x------ 1 alendvai users 64 Nov 17 21:46 9 -> pipe:[16921055] + herd -s t-socket-12913 start system-ctor Starting service system-ctor... Service system-ctor has been started. + herd -s t-socket-12913 status system-ctor Status of system-ctor: It is stopped (one-shot). It is enabled. Provides (system-ctor). Requires (). Will not be respawned. + test -f /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 ++ cat /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 + test 4 -eq 4 + herd -s t-socket-12913 start forkexec-ctor Starting service forkexec-ctor... Service forkexec-ctor started. Service forkexec-ctor running with value 13000. Service forkexec-ctor has been started. + herd -s t-socket-12913 status forkexec-ctor Status of forkexec-ctor: It is running since 21:46:15 (0 seconds ago). Running value is 13000. It is enabled. Provides (forkexec-ctor). Requires (). Will not be respawned. ++ herd -s t-socket-12913 status forkexec-ctor ++ grep 'Running value' ++ sed '-es/^.* \([0-9]\+\)\.$/\1/g' + pid=13000 + kill -0 13000 + ls -l /proc/13000/fd total 0 lr-x------ 1 alendvai users 64 Nov 17 21:46 0 -> /dev/null l-wx------ 1 alendvai users 64 Nov 17 21:46 1 -> pipe:[16918179] l-wx------ 1 alendvai users 64 Nov 17 21:46 2 -> pipe:[16918179] ++ cd /proc/13000/fd ++ echo 0 1 2 + test '0 1 2' = '0 1 2' + herd -s t-socket-12913 stop forkexec-ctor ++ seq 1 3 + for i in $(seq 1 3) + connect_to_server 5555 + rm -f /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 + guile -c '(use-modules (ice-9 match)) (define IN6ADDR_LOOPBACK 1) (define address (make-socket-address AF_INET INADDR_LOOPBACK 5555)) (define sock (socket (sockaddr:fam address) SOCK_STREAM 0)) (connect sock address)' + test -f /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 + sleep 0.3 + test -f /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 ++ cat /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 + test 4 -eq 4 + herd -s t-socket-12913 enable systemd-ctor Enabled service systemd-ctor. + herd -s t-socket-12913 start systemd-ctor Service systemd-ctor has been started. + connect_to_server 5556 + rm -f /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 + guile -c '(use-modules (ice-9 match)) (define IN6ADDR_LOOPBACK 1) (define address (make-socket-address AF_INET INADDR_LOOPBACK 5556)) (define sock (socket (sockaddr:fam address) SOCK_STREAM 0)) (connect sock address)' + test -f /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 + sleep 0.3 + test -f /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 ++ cat /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 + test 4 -eq 6 + cat t-log-12913 2023-11-17 21:46:15 Starting service root... 2023-11-17 21:46:15 Service root started. 2023-11-17 21:46:15 Service root running with value #t. 2023-11-17 21:46:15 Service root has been started. 2023-11-17 21:46:15 Configuration successfully loaded from 't-conf-12913'. 2023-11-17 21:46:15 Starting service inetd-ctor... 2023-11-17 21:46:15 Service inetd-ctor started. 2023-11-17 21:46:15 Service inetd-ctor running with value (#<input-output: socket 17>). 2023-11-17 21:46:15 Service inetd-ctor has been started. 2023-11-17 21:46:15 Starting service system-ctor... 2023-11-17 21:46:15 [sh] 0 -> /dev/null 2023-11-17 21:46:15 [sh] 1 -> pipe:[16920182] 2023-11-17 21:46:15 [sh] 2 -> pipe:[16920182] 2023-11-17 21:46:15 [sh] 3 -> /proc/12980/fd 2023-11-17 21:46:15 Service system-ctor has been started. 2023-11-17 21:46:15 Service system-ctor started. 2023-11-17 21:46:15 Service system-ctor running with value #t. 2023-11-17 21:46:15 Starting service forkexec-ctor... 2023-11-17 21:46:15 Service forkexec-ctor started. 2023-11-17 21:46:15 Service forkexec-ctor running with value 13000. 2023-11-17 21:46:15 Service forkexec-ctor has been started. 2023-11-17 21:46:15 Stopping service forkexec-ctor... 2023-11-17 21:46:15 Service forkexec-ctor stopped. 2023-11-17 21:46:15 Service forkexec-ctor is now stopped. 2023-11-17 21:46:15 Accepted connection on 127.0.0.1:5555 from 127.0.0.1:43514. 2023-11-17 21:46:15 Starting service t-count-file-descriptors-12913-1... 2023-11-17 21:46:15 Service t-count-file-descriptors-12913-1 started. 2023-11-17 21:46:15 Service t-count-file-descriptors-12913-1 running with value 13045. 2023-11-17 21:46:15 Service t-count-file-descriptors-12913-1 has been started. 2023-11-17 21:46:15 0 connections still in use after t-count-file-descriptors-12913-1 termination. 2023-11-17 21:46:15 Service t-count-file-descriptors-12913-1 has been disabled. 2023-11-17 21:46:15 Transient service t-count-file-descriptors-12913-1 terminated, now unregistered. 2023-11-17 21:46:16 Enabled service systemd-ctor. 2023-11-17 21:46:16 Starting service systemd-ctor... 2023-11-17 21:46:16 Service systemd-ctor has been started. 2023-11-17 21:46:16 Service systemd-ctor started. 2023-11-17 21:46:16 Service systemd-ctor running with value (("unknown" . #<input-output: socket 18>)). 2023-11-17 21:46:16 Spawning systemd-style service /home/alendvai/workspace/guix/shepherd/t-count-file-descriptors-12913. 2023-11-17 21:46:16 Running value of service systemd-ctor changed to 13077. 2023-11-17 21:46:16 [t-count-file-descriptors-12913] 0 -> /dev/null 2023-11-17 21:46:16 [t-count-file-descriptors-12913] 1 -> pipe:[16916369] 2023-11-17 21:46:16 [t-count-file-descriptors-12913] 2 -> pipe:[16916369] 2023-11-17 21:46:16 [t-count-file-descriptors-12913] 3 -> socket:[16920216] 2023-11-17 21:46:16 [t-count-file-descriptors-12913] 4 -> socket:[16918195] 2023-11-17 21:46:16 [t-count-file-descriptors-12913] 5 -> /proc/13077/fd 2023-11-17 21:46:16 Service systemd-ctor has been disabled. 2023-11-17 21:46:16 Accepted connection on 127.0.0.1:5555 from 127.0.0.1:43530. 2023-11-17 21:46:16 Starting service t-count-file-descriptors-12913-2... 2023-11-17 21:46:16 Service t-count-file-descriptors-12913-2 started. 2023-11-17 21:46:16 Service t-count-file-descriptors-12913-2 running with value 13081. 2023-11-17 21:46:16 Service t-count-file-descriptors-12913-2 has been started. 2023-11-17 21:46:16 0 connections still in use after t-count-file-descriptors-12913-2 termination. 2023-11-17 21:46:16 Service t-count-file-descriptors-12913-2 has been disabled. 2023-11-17 21:46:16 Transient service t-count-file-descriptors-12913-2 terminated, now unregistered. + rm -f t-socket-12913 t-conf-12913 t-log-12913 /home/alendvai/workspace/guix/shepherd/t-fd-count-12913 t-count-file-descriptors-12913.c /home/alendvai/workspace/guix/shepherd/t-count-file-descriptors-12913 + test -f t-pid-12913 ++ cat t-pid-12913 + kill 12949 + rm -f t-pid-12913 Stopping service root... Exiting shepherd... Exiting. FAIL tests/close-on-exec.sh (exit status: 1)