From nobody Mon Apr 08 06:51:25 2024 X-Original-To: jail@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VCfrZ1SDPz5GLsJ for ; Mon, 8 Apr 2024 06:51:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VCfrY6N6Hz4sNs for ; Mon, 8 Apr 2024 06:51:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712559085; a=rsa-sha256; cv=none; b=iiEy0zASZi9wMq7v9tH1AwFjH0Ie2sU5gSjplijsKv1vTDQaOfbKpOQPRZrGU3b45V3hPN 7W506O/y2Fs3TyWModV7FaHtUyWAh2JMVrY4UnTRWphalPgf0mFkqqBjroDzrKz6mY6U52 Uedd9H1bZp3r39fot8g17FAM3kZuj6UY6c28b2NN5LPQ7zMnGuFqQVgxP2ENeC2hLtELLe fZKHYfG63pvuOsDixaDUdZU0LniTLwlI63f24IPzJZaz0ISAqiRyPotBX3Pfu0Hrl/v2Oj hAcqib4G6KXKXCIim2FagV9uy9EbS7HoOXl1CR0SNkJaADWVTZOxe3awev+08Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712559085; 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: in-reply-to:in-reply-to:references:references; bh=dmN6WwYuxb/Yf3E0GMPWvfhUSDc4LS53dwgYz2KNhc4=; b=BmE+n/hkDmfvjh6rjU/9OyE7xJo3bZLEXoWGA6e0lqvkRnkZ3Et7ZzTzuthg8JOcCfp9XD t9QgW41Xo1rJq0XFmqX/4QSWtQvRWhd58vqa1K3LZlO7I4JYiZXhHWFGYsqXVAWweIwNPH i5j9VPa4Bwi+jDNgbG4KvDEoa2TUVA+FC0EpD9rZUq9llAbPD9LdMhOTYZ3lA0/ATjaQ5x Ohh116UTV0sIg1SB8SRxozBPNTbvP/FfUGRCSL16xjoIwBSHpBVm0hGhgb6hYy3V8qgg/I y15BH463BqIAa4Uw5xqW5r4zcMfPO6cO0ebzbKSqt0yzRjPF0pWLKJXGWavB6w== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VCfrY5vsQz11ND for ; Mon, 8 Apr 2024 06:51:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 4386pPQI003864 for ; Mon, 8 Apr 2024 06:51:25 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4386pPuC003858 for jail@FreeBSD.org; Mon, 8 Apr 2024 06:51:25 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: jail@FreeBSD.org Subject: [Bug 278195] daemon in jail is exiting without informing that it failed to execute Date: Mon, 08 Apr 2024 06:51:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.3-RELEASE X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: zlei@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: jail@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussion about FreeBSD jail(8) List-Archive: https://lists.freebsd.org/archives/freebsd-jail List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-jail@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278195 --- Comment #3 from Zhenlei Huang --- Another truss(1) that show what happens when the `--close-fds` option is supplied. ``` # truss -f /tmp/daemon -fSl daemon echo OK ... 955: connect(3,{ AF_UNIX "/var/run/logpriv" },106) =3D 0 (0x0) 955: open("/dev/null",O_RDWR,00) =3D 4 (0x4) 955: sigaction(SIGHUP,{ SIG_IGN 0x0 ss_t },{ SIG_IGN SA_RESTART ss_t }) = =3D 0 (0x0) 956: 955: fork() =3D 956 (0x3bc) 956: setsid() =3D 956 (0x3bc) 956: sigaction(SIGHUP,{ SIG_IGN SA_RESTART ss_t },0x0) =3D 0 (0x0) 956: dup2(4,0) =3D 0 (0x0) 956: dup2(4,1) =3D 1 (0x1) 956: dup2(4,2) =3D 2 (0x2) 956: close(4) =3D 0 (0x0) 956: madvise(0x0,0,MADV_PROTECT) =3D 0 (0x0) 956: pipe2(0x7fffffffe950,0) =3D 0 (0x0) 956: write(2,"ld-elf.so.1: ",13) =3D 13 (0xd) 956: write(2,"/tmp/daemon: Undefined symbol "k"...,48) =3D 48 (0x30) 956: write(2,"\n",1) =3D 1 (0x1) 956: exit(0x1)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 956: process exit, rval =3D 1 955: exit(0x0)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 955: process exit, rval =3D 0 ``` So simply put, when `--close-fds` option is present, daemon(3) closes fd 0,= 1,2 and these fds are redirected to /dev/null but logfile or syslog is opened t= oo late to catch error messages. --=20 You are receiving this mail because: You are the assignee for the bug.=