mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: Alexander Dahl <ada@thorsis.com>
Cc: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] bbinit: Remove /bin and /sbin from PATH after /usr merge
Date: Fri, 23 Jun 2023 09:02:02 +0200	[thread overview]
Message-ID: <ZJVDasFF00m3G/n0@pengutronix.de> (raw)
In-Reply-To: <20230607091040.214960-1-ada@thorsis.com>

On Wed, Jun 07, 2023 at 11:10:40AM +0200, Alexander Dahl wrote:
> The so called /usr merge was done back with ptxdist-2017.05.0 and since
> then /bin is just a symlink to /usr/bin and /sbin just a symlink to
> /usr/sbin.  Putting /bin _and_ /usr/bin to PATH would actually put the
> same directory twice to PATH.
> 
> Signed-off-by: Alexander Dahl <ada@thorsis.com>
> ---
> 
> Notes:
>     Not sure if this should have been RFC first?  This does not affect
>     PATH set by /etc/profile on login and there are more scripts outside
>     of /etc/init.d which set a PATH.

It's better than before, so I applied it. I'm not sure why my git hook did
not notice that and send an email.

Michael

>  projectroot/etc/init.d/NetworkManager | 2 +-
>  projectroot/etc/init.d/atd            | 2 +-
>  projectroot/etc/init.d/avahi-daemon   | 2 +-
>  projectroot/etc/init.d/chrony         | 2 +-
>  projectroot/etc/init.d/dropbear       | 2 +-
>  projectroot/etc/init.d/haveged        | 2 +-
>  projectroot/etc/init.d/inetd          | 2 +-
>  projectroot/etc/init.d/lighttpd       | 2 +-
>  projectroot/etc/init.d/lldpd          | 2 +-
>  projectroot/etc/init.d/monit          | 2 +-
>  projectroot/etc/init.d/nftables       | 2 +-
>  projectroot/etc/init.d/ntp-client     | 2 +-
>  projectroot/etc/init.d/ntp-server     | 2 +-
>  projectroot/etc/init.d/openssh        | 2 +-
>  projectroot/etc/init.d/proftpd        | 2 +-
>  projectroot/etc/init.d/pureftpd       | 2 +-
>  projectroot/etc/init.d/rc-once        | 2 +-
>  projectroot/etc/init.d/samba          | 2 +-
>  projectroot/etc/init.d/sysctl         | 2 +-
>  projectroot/etc/init.d/zeroconf       | 2 +-
>  20 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/projectroot/etc/init.d/NetworkManager b/projectroot/etc/init.d/NetworkManager
> index 50a5467ad..f76e01131 100644
> --- a/projectroot/etc/init.d/NetworkManager
> +++ b/projectroot/etc/init.d/NetworkManager
> @@ -19,7 +19,7 @@ exec_prefix=/usr
>  sbindir=${exec_prefix}/sbin
>  localstatedir=/var
>  
> -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
> +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
>  DESC="network connection manager"
>  NAME="NetworkManager"
>  
> diff --git a/projectroot/etc/init.d/atd b/projectroot/etc/init.d/atd
> index 7253f646c..62bfef811 100644
> --- a/projectroot/etc/init.d/atd
> +++ b/projectroot/etc/init.d/atd
> @@ -3,7 +3,7 @@
>  #
>  # atd
>  #
> -PATH=/usr/bin:/usr/sbin:/bin:/sbin
> +PATH=/usr/bin:/usr/sbin
>  
>  PREFIX="atd: "
>  ATD="/usr/sbin/atd"
> diff --git a/projectroot/etc/init.d/avahi-daemon b/projectroot/etc/init.d/avahi-daemon
> index 27c22cc52..7aadb7525 100644
> --- a/projectroot/etc/init.d/avahi-daemon
> +++ b/projectroot/etc/init.d/avahi-daemon
> @@ -4,7 +4,7 @@
>  # Mi 22. Jul 21:46:28 CEST 2009
>  
>  #set -e
> -PATH=/sbin:/bin:/usr/bin
> +PATH=/usr/sbin:/usr/bin
>  BINARY=/usr/sbin/avahi-daemon
>  OPTIONS="-D"
>  
> diff --git a/projectroot/etc/init.d/chrony b/projectroot/etc/init.d/chrony
> index d112927f8..a40e2e621 100644
> --- a/projectroot/etc/init.d/chrony
> +++ b/projectroot/etc/init.d/chrony
> @@ -7,7 +7,7 @@
>  # Last change:  Bj?rn B?rger <b.buerger@pengutronix.de>
>  # Date:		Tue Mar  6 16:00:30 UTC 2007
>  
> -PATH=/sbin:/bin:/usr/bin:/usr/sbin
> +PATH=/usr/sbin:/usr/bin
>  BINARY="/usr/sbin/chronyd"
>  CONFIG="/etc/chrony/chrony.conf"
>  PREFIX="chrony: "
> diff --git a/projectroot/etc/init.d/dropbear b/projectroot/etc/init.d/dropbear
> index 1b16de20a..bec330ab2 100644
> --- a/projectroot/etc/init.d/dropbear
> +++ b/projectroot/etc/init.d/dropbear
> @@ -1,6 +1,6 @@
>  #!/bin/sh
>  
> -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
> +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
>  DAEMON=/usr/sbin/dropbear
>  NAME=dropbear
>  
> diff --git a/projectroot/etc/init.d/haveged b/projectroot/etc/init.d/haveged
> index 1a4fc62a2..14e391320 100755
> --- a/projectroot/etc/init.d/haveged
> +++ b/projectroot/etc/init.d/haveged
> @@ -1,6 +1,6 @@
>  #!/bin/sh
>  
> -PATH='/sbin:/usr/sbin:/bin:/usr/bin'
> +PATH='/usr/sbin:/usr/bin'
>  DESC='haveged entropy daemon'
>  NAME='haveged'
>  DAEMON="/usr/sbin/$NAME"
> diff --git a/projectroot/etc/init.d/inetd b/projectroot/etc/init.d/inetd
> index 128d41a82..8fb10d994 100644
> --- a/projectroot/etc/init.d/inetd
> +++ b/projectroot/etc/init.d/inetd
> @@ -3,7 +3,7 @@
>  # This is an inetd init.d script which ist called by init(1) with [start|stop] as argument
>  #
>  
> -PATH=/sbin:/bin:/usr/bin
> +PATH=/usr/sbin:/usr/bin
>  BINARY=/usr/sbin/inetd
>  
>  # --- nothing to change after this line ---
> diff --git a/projectroot/etc/init.d/lighttpd b/projectroot/etc/init.d/lighttpd
> index 24a17e2a0..e1b17c984 100644
> --- a/projectroot/etc/init.d/lighttpd
> +++ b/projectroot/etc/init.d/lighttpd
> @@ -3,7 +3,7 @@
>  #
>  # lighttpd
>  #
> -PATH=/usr/bin:/usr/sbin:/bin:/sbin
> +PATH=/usr/bin:/usr/sbin
>  
>  PREFIX="lighttpd: "
>  LIGHTTPD="/usr/sbin/lighttpd"
> diff --git a/projectroot/etc/init.d/lldpd b/projectroot/etc/init.d/lldpd
> index 00c8240f5..a592730fb 100755
> --- a/projectroot/etc/init.d/lldpd
> +++ b/projectroot/etc/init.d/lldpd
> @@ -1,6 +1,6 @@
>  #!/bin/sh
>  
> -PATH=/sbin:/usr/sbin:/bin:/usr/bin
> +PATH=/usr/sbin:/usr/bin
>  DESC="LLDP daemon"
>  NAME=lldpd
>  DAEMON=/usr/sbin/$NAME
> diff --git a/projectroot/etc/init.d/monit b/projectroot/etc/init.d/monit
> index 96ec86ab9..c27543204 100644
> --- a/projectroot/etc/init.d/monit
> +++ b/projectroot/etc/init.d/monit
> @@ -1,6 +1,6 @@
>  #!/bin/sh
>  
> -PATH=/sbin:/usr/sbin:/bin:/usr/bin
> +PATH=/usr/sbin:/usr/bin
>  DESC="daemon monitor"
>  NAME=monit
>  DAEMON=/usr/bin/$NAME
> diff --git a/projectroot/etc/init.d/nftables b/projectroot/etc/init.d/nftables
> index c10db5d90..27a5d707e 100644
> --- a/projectroot/etc/init.d/nftables
> +++ b/projectroot/etc/init.d/nftables
> @@ -7,7 +7,7 @@
>  
>  CONF=/etc/nftables.conf
>  
> -PATH=/sbin:/usr/sbin:/bin:/usr/bin
> +PATH=/usr/sbin:/usr/bin
>  DESC="firewall service"
>  NAME=nftables
>  BIN=/usr/sbin/nft
> diff --git a/projectroot/etc/init.d/ntp-client b/projectroot/etc/init.d/ntp-client
> index edca3f297..d3748c5e5 100644
> --- a/projectroot/etc/init.d/ntp-client
> +++ b/projectroot/etc/init.d/ntp-client
> @@ -3,7 +3,7 @@
>  # This is a ntp-client init.d script which ist called by init(1) with
>  # [start|stop] as argument
>  
> -PATH=/sbin:/bin:/usr/bin
> +PATH=/usr/sbin:/usr/bin
>  BINARY=/usr/sbin/ntpdc
>  PIDFILE="/var/run/ntpdc.pid"
>  CONFIG="/etc/ntp-client.conf"
> diff --git a/projectroot/etc/init.d/ntp-server b/projectroot/etc/init.d/ntp-server
> index bda35616e..550cd7bfa 100644
> --- a/projectroot/etc/init.d/ntp-server
> +++ b/projectroot/etc/init.d/ntp-server
> @@ -3,7 +3,7 @@
>  # This is a ntp init.d script which ist called by init(1) with [start|stop] as argument
>  #
>  
> -PATH=/sbin:/bin:/usr/bin
> +PATH=/usr/sbin:/usr/bin
>  BINARY=/usr/sbin/ntpd
>  PIDFILE="/var/run/ntpd.pid"
>  CONFIG="/etc/ntp-server.conf"
> diff --git a/projectroot/etc/init.d/openssh b/projectroot/etc/init.d/openssh
> index b65880e5d..ad760ddda 100644
> --- a/projectroot/etc/init.d/openssh
> +++ b/projectroot/etc/init.d/openssh
> @@ -1,6 +1,6 @@
>  #!/bin/sh
>  
> -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
> +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
>  DAEMON=/usr/sbin/sshd
>  NAME=sshd
>  PIDFILE=/var/run/sshd.pid
> diff --git a/projectroot/etc/init.d/proftpd b/projectroot/etc/init.d/proftpd
> index ae69bb814..4ebd008e1 100644
> --- a/projectroot/etc/init.d/proftpd
> +++ b/projectroot/etc/init.d/proftpd
> @@ -4,7 +4,7 @@
>  # Start the proftpd FTP daemon.
>  #
>  
> -PATH=/bin:/usr/bin:/sbin:/usr/sbin
> +PATH=/usr/bin:/usr/sbin
>  DAEMON=/usr/sbin/proftpd
>  NAME=proftpd
>  
> diff --git a/projectroot/etc/init.d/pureftpd b/projectroot/etc/init.d/pureftpd
> index 4d23aec2c..a89f62a82 100644
> --- a/projectroot/etc/init.d/pureftpd
> +++ b/projectroot/etc/init.d/pureftpd
> @@ -3,7 +3,7 @@
>  # /etc/init.d/pure-ftpd
>  #
>  
> -PATH=/bin:/usr/bin:/sbin:/usr/sbin
> +PATH=/usr/bin:/usr/sbin
>  
>  # defaults
>  DAEMON="pure-ftpd"
> diff --git a/projectroot/etc/init.d/rc-once b/projectroot/etc/init.d/rc-once
> index e610254ef..657dd047f 100644
> --- a/projectroot/etc/init.d/rc-once
> +++ b/projectroot/etc/init.d/rc-once
> @@ -1,6 +1,6 @@
>  #!/bin/sh
>  
> -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
> +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
>  
>  . /usr/lib/init/initmethod-bbinit-functions.sh
>  . /usr/lib/init/rc-once.sh
> diff --git a/projectroot/etc/init.d/samba b/projectroot/etc/init.d/samba
> index a85bdc5db..04761ecfb 100644
> --- a/projectroot/etc/init.d/samba
> +++ b/projectroot/etc/init.d/samba
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  #
>  
> -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
> +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
>  DAEMON_SMB=/usr/sbin/smbd
>  DAEMON_NMB=/usr/sbin/nmbd
>  NAME=samba
> diff --git a/projectroot/etc/init.d/sysctl b/projectroot/etc/init.d/sysctl
> index d23f9d5b2..5be2fad9d 100644
> --- a/projectroot/etc/init.d/sysctl
> +++ b/projectroot/etc/init.d/sysctl
> @@ -2,7 +2,7 @@
>  # /etc/init.d/sysctl: Set kernel variables from /etc/sysctl.conf
>  #
>  
> -PATH=/sbin:$PATH
> +PATH=/usr/sbin:$PATH
>  which sysctl > /dev/null || exit 0
>  
>  case "$1" in
> diff --git a/projectroot/etc/init.d/zeroconf b/projectroot/etc/init.d/zeroconf
> index ad4ebc135..6fc0f98fe 100644
> --- a/projectroot/etc/init.d/zeroconf
> +++ b/projectroot/etc/init.d/zeroconf
> @@ -3,7 +3,7 @@
>  # This is a zeroconf init.d script which ist called by init(1) with [start|stop] as argument
>  # Mi 22. Jul 21:46:28 CEST 2009
>  
> -PATH=/sbin:/bin:/usr/bin
> +PATH=/usr/sbin:/usr/bin
>  BINARY=/usr/sbin/avahi-autoipd
>  OPTIONS="--force-bind -D"
>  INTERFACES="eth0"
> 
> base-commit: 2354b57b893f0e116ad3b56fe2c9826d08748094
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      reply	other threads:[~2023-06-23  7:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07  9:10 Alexander Dahl
2023-06-23  7:02 ` Michael Olbrich [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZJVDasFF00m3G/n0@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ada@thorsis.com \
    --cc=ptxdist@pengutronix.de \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox