Click to See Complete Forum and Search --> : Cannot start services?


snipz
03-13-2003, 10:46 PM
Hi all,

I am having trouble running services for my Samba cleint. I have tried starting any service, and I keep getting:

[root@localhost root]# service smb restart
bash: service: command not found

Any help would be appreciated. Thanks!

leonpmu
03-14-2003, 01:06 AM
Ok, ere are some questions and I will try to answer your question with these questions.

1) Are you logged in as a normal user and then opening a shell prompt, SU'ing and trying to run the service command?

If so the problem is that you wil have to cd to /sbin and then issue the command as './service XXX start'

OR you can CTRL+ALT+F1 login as root and then just execute th command normally.

Hope it helps

L

z0mbix
03-14-2003, 05:33 AM
This is a very common question on these forums. The problem is that as a normal user you do not have the directory sbin in your $PATH variable. Type echo $PATH to find out which directories are. If you use su to assume root you will not load root's environment fully as you need to use su -. In anycase, you don't need to cd into /sbin, you can just run the command with it's full path i.e:

/sbin/service foobar start

or if you want to do it the proper way that most Linux systems use:

/etc/rc.d/init.d/foobar start

z0mbix
03-14-2003, 05:41 AM
Also, it may seem odd, but the message "service: command not found" means that the command `service' cannot be found. If you get that, then you can run the commands whereis service or which service to find out where the command `service' actually is. Also, don't forget that you can use the `find' and `locate' commands to find files on your system, but whereis and which are the best way to find executable commands.

Magueta
03-14-2003, 10:50 AM
Which and Whereis won't find this command because it isn't in any of the bins, at least not on my system. The command is in /etc/rc.d/init.d/. It's the script used by samba to start, stop, restart, etc the Samba server. Failing that you can just type (this will be in your path) smbd -D and nmbd -D. It won't startup automatically everytime you restart but it'll get you running until you can find out how to do it properly.

Joe