I'm not interested in this blah blah. I'm interested in the system working properly.Well, maybe version 15 will work fine, let's wait.Why did MС start simply in all previous versions, but in version 14 MC -U ?kerogaz You badly need to learn debugging. If you read "command not found" what does that tell you?
The issues you're running into have absolutely nothing to do with the version of FreeBSD.Well, maybe version 15 will work fine, let's wait.
While thiis simple script work in bash in Arch linux and Debian but not work in sh FreeBSD?I think OP is still struggling with invoking the script, not with anything inside the script.
-r-xr-xr-x 1 root wheel 168728 Jul 16 13:43 /bin/shI'll try again, what doesls -l /bin/shshow?
This!What happens when you dosudo /home/pal/MONITOR_IP? If that still fails, sudo this simple script and tell us what it outputs:
#!/binsh
pwd
/usr/bin/printenv | /usr/bin/grep PATH
/usr/bin/which tcpdump
PATH variable wasn't properly configured, it gave me the message "command cannot be found"..profile - Bourne Shell startup script for login shellsThis!
It happened to me recently, thePATHvariable wasn't properly configured, it gave me the message "command cannot be found".
Pretty easy to verify, just invoke commands by using their full path, if it works it means the shell configuration file is not good or not sourced for some reason.
sudo script.sh (#!/bin/sh)What happens when you dosudo /home/pal/MONITOR_IP? If that still fails, sudo this simple script and tell us what it outputs:
#!/binsh
pwd
/usr/bin/printenv | /usr/bin/grep PATH
/usr/bin/which tcpdump
sudo ./script.shsudo ./script.shfrom scripts directory.
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"But what can I do? My /usr/local/etc/sudoers :Ok. This is due to a setting in /usr/local/erc/sudoers:
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
If you have another standard place where stash commonly used commands, you can add to above. But probably better to just stick to this and use full paths for non standard commands.
And the man page doesn't list all the gotchas. Give your users the ability to more(1) a file. Most people are surprised what this allows. Our junior sysadmins have been fooled by savvy clients requesting to be able to view files with more(1). Be knowledgeable. Understand and careful.I suggest *carefully* reading the manpage for sudo and how PATH gets used. I can't tell you what to do since I don't know what you are doing and why but between reading the relevant man pages and this thread you should be able to figure out what you need to do. It seems you are not very familiar so I suggest *not* editing the secure_path.
But why are there such difficulties with the 14.3 system I installed in January 2025? Everything works fine with the system I installed on another server in 2014 (version 10) and have consistently upgraded to 14.3 without these hacks; I can just start with ./script.shsudo sh -c script.sh and leave sudoers as is
There must be some difference between these two systems. You might be running different versions of security/sudo, are they the same?But why are there such difficulties with the 14.3 system I installed in January 2025? Everything works fine with the system I installed on another server in 2014 (version 10) and have consistently upgraded to 14.3 [...]
pkg query -e '%n=sudo' '%n %v'Compare the config files between the two systems.But why are there such difficulties with the 14.3 system I installed in January 2025? Everything works fine with the system I installed on another server in 2014 (version 10) and have consistently upgraded to 14.3 without these hacks; I can just start with ./script.sh