LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Restart services - 'service' command not found (https://www.linuxquestions.org/questions/linux-newbie-8/restart-services-service-command-not-found-88809/)

davee 09-03-2003 09:01 AM

Restart services - 'service' command not found
 
I've installed LInux at work - one thing I'm missing is 'service' to restart net services etc... Where can I get this? Should it be missing?

Dave

quatsch 09-03-2003 09:08 AM

you can restart services by
/etc/init.d/service-name restart (status, stop and start work too).
look in /etc/init.d/ for the services available.

davee 09-03-2003 09:36 AM

Thanks for that... does that mean 'service' is a script file?

Dave

quatsch 09-03-2003 09:40 AM

Yes. I don't think it comes with all distributions. It's a more complex script than one would think...

cheers

davee 09-04-2003 02:43 AM

...and obviously not SuSE 8.2! I wish it was, as it's a hell of an easier to remember/type than /etc/inet... etc etc

Thanks again,

Dave

plisken 09-20-2003 08:07 PM

Thats the first thing I missed when I installed SuSE 8.2

I use it all the time on my RH install.

sivaprakash123 03-05-2008 11:40 PM

Im using Fedora7 here the service is /sbin/service you can add it to environment variables like this

>PATH=$PATH:/sbin

this will work
GOOD LUCK !!!

aravind162 03-15-2013 09:10 PM

service command not found
 
if the package is installed from source code, service command wont work. service command will work only if you have installed the package using yum or rpm command.
Also you can check path of the commands using
$ echo $PATH
Sample outputs:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin:/home/vivekgite/bin
Usually, all user commands are in /bin and /usr/bin or /usr/local/bin directories. All your programs are installed in these directories. When you type the clear command, you are running /usr/bin/clear. So if it is not in your path try to add directories to your search path as follows (setup Linux or UNIX search path with following bash export command)
$ export PATH=$PATH:/bin:/usr/local/bin
You can also find out of path of any command with which or whereis commands:
$ which ls
And last but not least, linux is case sensitive. so make sure the case you are using is the right one ( silly mistake.but still can make problems)
thank you

lleb 03-15-2013 11:54 PM

Quote:

Originally Posted by davee (Post 461577)
...and obviously not SuSE 8.2! I wish it was, as it's a hell of an easier to remember/type than /etc/inet... etc etc

Thanks again,

Dave

The "service" command is something that RedHat came up with years ago. It is not used in most distros. If you wish to use the service command instead of the above /etc/init.d/ commands then use Fedora, but even that is changing with their new systemd setup. service does still work for most basic commands like network, etc...

linosaurusroot 03-16-2013 12:34 AM

Quote:

# rpm -qf /sbin/service
aaa_base-12.1-534.113.1.x86_64
The other thing involved is "chkconfig" or "systemctl" or both.


All times are GMT -5. The time now is 06:17 AM.