[SOLVED] Devuan 3.0 - shutdown and mkfs command not found
Linux - DistributionsThis forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on...
Note: An (*) indicates there is no official participation from that distribution here at LQ.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you're using them via sudo, it depends a lot on how the program was built. Some builds of sudo set it to use the root command path, so that commands in /sbin and /usr/sbin are instantly available. Others stick with your user-defined path, which doesn't usually include these directories.
Well, there you are then! /sbin and /usr/sbin are not on root's command path. They ought to be. I don't know how Devuan does it but in most distros, the user login files, .profile and .bashrc, source standard profile and bashrc files in /etc that set these variables. That ensures that they are correctly set for all users.
In your case, the simplest solution is to edit the correct path in by hand in the appropriate root login file.
from what I understand the Debian 10 buster has the same problem
Not sure what problem you're referring to - it's necessary to use sudo/root for shutdown command but root's PATH on my Buster machine is correct.
It appears to be handled at the top of "/etc/profile"...
Code:
$ head -n10 /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
My guesses would be: your file is different; something is stopping it being executed; or something executed later is overriding PATH when it should be appending?
The way it's supposed to be done is that useradd creates a home directory for a new user and copies over any files it finds in /etc/skel. These files include specimen .bashrc and .profile files, and these in turn source /etc/profile and /etc/bashrc. It's complicated but necessary in an office system, where new accounts may need to be created frequently. For a home system, which typically has only one user account, it's overkill.
In this case, only the root path is problematic, so why not just edit the path in whichever file in /root sets it (probably .profile) adding ":/sbin:/usr/sbin" at the end of the line?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.