With these lines
Code: Select all
if [ `whoami` != "root" ]; then
export PATH="$(/bin/ls -d /opt/cprocsp/{s,}bin/*|tr '\n' ':')$PATH"
fi
if [ `whoami` == "root" ]; then
export PATH="$(/bin/ls -d /opt/cprocsp/{s,}bin/*|tr '\n' ':')$PATH"
fi
if [ "$UID" -eq 0 ]; then
export PATH="$(/bin/ls -d /opt/cprocsp/{s,}bin/*|tr '\n' ':')$PATH"
fi
Code: Select all
guest@porteus:~$ echo $PATH
/opt/cprocsp/bin/amd64:/opt/cprocsp/sbin/amd64:/usr/local/bin:/usr/bin:/bin:/usr/games:/opt/porteus-scripts
guest@porteus:~$ su
Пароль:
root@porteus:/home/guest# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
root@porteus:/home/guest#
Ed_P wrote: ↑04 Sep 2017, 19:08
Before your "if" put these in your script:
echo USER=$USER
echo whoami=`whoami`
echo UID=$UID
read
Press Enter after reviewing the display.
This is freezes boot up and Xorg does not started.
I logged as root and via vi removed these lines.
Now with Xorg all ok.
-update-
I found it in /etc/login.defs
Code: Select all
#
# REQUIRED The default PATH settings, for superuser and normal users.
#
# (they are minimal, add the rest in the shell startup files)
ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
ENV_PATH PATH=/usr/local/bin:/bin:/usr/bin
NOTE.
for root user need to tweak /etc/login.defs
Code: Select all
ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
for guest user need to tweak /etc/profile
Code: Select all
# Set the default system $PATH:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/opt/porteus-scripts"
A new issue. How I can add output of this variable $(/bin/ls -d /opt/cprocsp/{s,}bin/*|tr '\n' ':')
Code: Select all
root@porteus:~# echo $(/bin/ls -d /opt/cprocsp/{s,}bin/*|tr '\n' ':')
/opt/cprocsp/bin/amd64:/opt/cprocsp/sbin/amd64:
root@porteus:~#
to
ENV_SUPATH PATH=HERE/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16