The officially official Devuan Forum!

You are not logged in.

#1 2019-10-08 12:47:09

basati
Member
Registered: 2018-04-03
Posts: 31  

There is a bug in beowulf's /etc/profile file

There are two lines that are inverted and modify the root path

It's like this:

if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH

It should be like this:

if [ `id -u`" -eq 0 ]; then
   PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
else
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
fi
export PATH

you can check it simply by trying a user@machine# reboot

Change order the lines and resolved

a greeting


Gora gu ta gutarrok

8=þ

Offline

#2 2019-10-08 13:32:25

fsmithred
Administrator
Registered: 2016-11-25
Posts: 1,287  

Re: There is a bug in beowulf's /etc/profile file

It was correct the first way. If id is zero, you are root and need the sbin directories. If id is not zero, you are user and get games in your path.

If you think there's a problem with root's path in beowulf, I would say you are correct, but you mis-identified the cause of the problem.

In Beowulf:
- If you use su to become root, you keep the user's PATH, and need to use the full path to commands in *sbin, like this: /sbin/reboot
- If you use su - to become root, you get root's PATH and can run commands in *sbin directly, like this: reboot

To keep the old behavior, see https://dev1galaxy.org/viewtopic.php?pid=16456#p16456

Offline

Board footer