Using DietPi 146 on RPI3 i’ve successfully set my PI to STATIC IP (vs DHCP)
Everything OK, my PI is correctly networked.
However i get ifconfig “command not found” messages when i launch LXterminal and current IP is not displayed.
/DietPi/dietpi/func/obtain_network_details: line 48: ifconfig: command not found
/DietPi/dietpi/func/obtain_network_details: line 83: ifconfig: command not found
IP Address |
Also my current IP and Mask, not displayed on Dietpi-config - Ethernet Network Options - Current details
What’s the problem with ifconfig ?
It may be that you’ve accidentally/inadvertently removed the net-tools package (which contains ifconfig, and is required for dietpi-config to scrape network settings correctly) from the system.
Yep, PATH entry will exist on a fresh install, so not sure what the cause is, but yes its in /etc/profile:
From Odroid C2 /etc/profile (Should be same for all on Jessie):
/etc/profile# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
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
if [ "$PS1" ]; then
if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
My v146 RPI3 /etc/profile seems OK (quoted later).
So something else broke the PATH.
I’ve only installed (from the menus and as root user) Roonbridge, networkaudiod, and XRDP.
No manual edits and everything running perfectly (out of ifconfig path).
root@DietPi:~# more /etc/profile
/etc/profile: system-wide .profile file for the Bourne shell (sh(1))
and Bourne compatible shells (bash(1), ksh(1), ash(1), …).
if [ “id -u” -eq 0 ]; then
PATH=“/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin”
else
PATH=“/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games”
fi
export PATH
if [ “$PS1” ]; then
if [ “$BASH” ] && [ “$BASH” != “/bin/sh” ]; then
The file bash.bashrc already sets the default PS1.
PS1='\h:\w$ ’
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ “id -u” -eq 0 ]; then
PS1=‘# ’
else
PS1=’$ ’
fi
fi
fi
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
We do see similar issues due to filesystem corruptions. I actually pulled the plug on RPi 3 with Raspbian lite the other day, rebooted, ls/df command not found.
I believe the issues you are experiencing are due to filesystem corruptions. The only way to prevent it:
Thank you @Fourdee.
I’m not sure about your “filesystem corruption” diagnostic because when i’m running ifconfig command from OSX terminal, PATH is OK (ssh as root).
OK
The PATH issue arise when ifconfig command is run from LXterminal via RDP Microsoft Remote Desktop (as root too).
In this case /usr/sbin is not in the PATH replaced by /usr/X11R6/bin ?
No joy …
PATH KO from LXterminal via RDP and PATH OK when from OSX terminal.
Seems PATH is set differently when i’m logging from RDP (Microsoft Remote Desktop).
/usr/sbin is not in the PATH replaced by /usr/X11R6/bin
For example, same issue when running other command from LXterminal via RDP:
root@DietPi:~# reboot
root@DietPi:~# bash: reboot: command not found