From nobody Fri Apr 5 09:33:52 2024 X-Original-To: ports-bugs@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 4V9tbP27FLz5G4XH for ; Fri, 5 Apr 2024 09:33:53 +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 4V9tbP14NWz4bpF for ; Fri, 5 Apr 2024 09:33:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712309633; a=rsa-sha256; cv=none; b=W4gvFEdXulbRs7xQWQdcW/8JIUzcmBAG69TJj8+PY+oIF0tOCml1iIB+6QeLwhf2rOfmMx BQWdGYKC8S7EVwMbbNGrOVGO/0tToPSgWxXSI4xvByRIY89dq1SJcB5SzNkjXknscN/Fvn HIhPiwxxbw+lJhwfxD00F8KhYri+Sm962nby+Iv8EjOJS6tMfK9sGiUJPGWxcdP2N7lBqi zyT3zCey0p6UcfmdJLtr6OEXHEUUDq+FkS3lOrM0gT9oGzTenqckoziNaDL3B3Fmjevb8c cR5ZZ6riP2qNRwW4/2QZu64iAUDnXOx4+giOmvS0H+Oyv1yclC/X+g5Bt+14lg== 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=1712309633; 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=1CSYgPwsdVIzZZxLBAAU1W6SSvzzjoLF6CsA+9SNL2A=; b=cDEo2mxyDDcxLMrXzWHz2TZmm5zY3+C96HJ4DmmAYOKAW795lYBQ/C/5PPKehaJzkCVvee UDnN+RnKyzWb8FSOkcL9UDmCjTONs2i5sjsVodATNNRtaFU2yWJ8jusHw6Wpszi6mb8LXQ xUnzDnEY0d/PGa3B1aCDP6kf1/F7xkwrO0Ez1EmdLVKhKxajL0Lns1KPT0Qr9EIvbsk2wm ukCfUIdnbxcgJ0ZceAC+jp8Skz79dsnZUeaggvBANepKtE2nOL8dyJE3jaYyqfK0aPA+JP WIujeUevZ4GUM2jCE5oWtlOG2GxNV333K/qLjEzyg04u9BxnNZUqU+T6bPGdjg== 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 4V9tbP0g4WzvRw for ; Fri, 5 Apr 2024 09:33:53 +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 4359XrQB015932 for ; Fri, 5 Apr 2024 09:33:53 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4359Xq1T015916 for ports-bugs@FreeBSD.org; Fri, 5 Apr 2024 09:33:52 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: ports-bugs@FreeBSD.org Subject: [Bug 278184] shells/bash: /etc/profile is not loaded Date: Fri, 05 Apr 2024 09:33:52 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: thomas.dreibholz@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ehaupt@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name Message-ID: 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: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278184 Bug ID: 278184 Summary: shells/bash: /etc/profile is not loaded Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: ehaupt@FreeBSD.org Reporter: thomas.dreibholz@gmail.com Flags: maintainer-feedback?(ehaupt@FreeBSD.org) Assignee: ehaupt@FreeBSD.org Bash does not load /etc/profile since some time. Instead, it expects ${LOCALBASE}/etc/profile. This is possibly intended behaviour now, but may = come unexpected to a user using a Bash shell on a system with system-wide profile settings. Just making a symlink /etc/profile -> /usr/local/etc/profile (as suggested = by https://forums.freebsd.org/threads/what-happened-to-etc-profile.78406/) also does not properly lead to the expected behaviour, since this leads to loadi= ng /etc/profile twice: The issue is that /etc/profile (at least in 14.0-RELEAS= E) is trying to avoid this recursion by checking whether it tries to load itse= lf. But since "/usr/local/etc/profile" is not equal to "/etc/profile", this che= ck fails. If the profile settings are just setting variables, this is probably= not an issue (just a bit of wasted time). However, if making output like a login banner (e.g. using the "td-system-tools" package, which installs /usr/local/etc/profile.d/system-info.sh for this purpose), the output is ma= de twice. A work around is to have a script /usr/local/etc/profile, which checks whet= her it is called by /etc/profile (/etc/profile sets a variable _loaded; if it is set, then just do not try to load /etc/profile again): if [ "${_loaded}" =3D "" ] ; then if [ -e /etc/profile ] ; then . /etc/profile fi fi May be such a /usr/local/etc/profile script should be installed by the Bash package as default, to get the probably expected user behaviour of getting = the system-wide profile settings with Bash shell as well? --=20 You are receiving this mail because: You are the assignee for the bug.=