Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
There is probably a very simple answer to this question that I'm just not seeing 'cause I'm a total noob, but here goes:
If I'm in a Bash Shell (or midnight commander or linux console) logged in as root I can stop and start services all I want. If I am logged on as a user I can't. Even if I su root it still gives me the error message "bash: service: command not found"
I'm pretty sure there has got to be a way to fix this, but I'm not sure how.
e.g.
/sbin/service servicename start
instead of
service servicename start
when you just type in service, the system will look for service in your path. If it's not there, it will tell you 'command not found'. If you specify the path, e.g. /sbin/service, it will run the thing specified.
e.g.
/sbin/service servicename start
instead of
service servicename start
when you just type in service, the system will look for service in your path. If it's not there, it will tell you 'command not found'. If you specify the path, e.g. /sbin/service, it will run the thing specified.
what you will find is that /sbin is not in your path. if you type in "echo $PATH" you will see your current path settings for the user that you are running the command for. if you run "echo $PATH" again but as the root user you will see that the root user has extra path settings. It is possible to modify your own path, but for most things you want to do, you can either type in /sbin/command for example if it is something quick you want to do. or alternatively, if you require root access, eg to install something or to modify your system in any way, you can use the sudo command. e.g. "sudo service network restart" if you wish to restart your networking service.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.