bash: <command name> command not found
I am new to running Linux. I have Mandrake 7.2. I have just put in a 3com 3c900 NIC. I want to bring it up. I edited my /etc/config.modules file to read "alias eth0 3c90x" then I navigated to /etc/rc.d/init.d/ and ran the command network restart. I got the following message: bash: network restart: command not found. I can see the executable in the directory, but when I try to run any command from the /etc/rc.d/init.d directory I get the same error. Thanks for any help.
|
if its executable and ure in /etc/rc.d/init.d prepend "./" , else gotta prepend the whole path.
|
Quote:
In order to override this behavior you can tell the shell to "look for the file in the current directory, by prepending "./" to the name. The . indicates the current directory, so basically you're specifying an explicit path to the file of current directory /somefile. This is no different than if you were in another directory and specified the fully qualified filepath ie, you are in /etc and type /etc/rc.d/init.d/network restart Thus if you're in /etc/rc.d/init.d/ and want to run the network script, you should type ./network restart |
Thanks
Thanks to all who replied. Now I see the light.
|
In the RedHat/Mandrake/Fedora/Mandriva distros you can access your services with the service command, e.g.
service network status service network start You don't have to supply the full path and you don't have to be in the /etc/rc.d/init.d directory. |
Also, in some distros like RedHat, you can modify permanently is a service starts or not at startup with
Code:
/sbin/chkconfig --list # to get all services inscribed in chkconfig and their state at each runlevel It is way easier then to make your own symbolic links in /etc/rc.d/rc[0-6].d/ ! That is why, in some scripts in /etc/init.d/, you see theses comments (this one is /etc/init.d/network) : Code:
# chkconfig: 2345 10 90 That is how your machine knows to start you network interface (position 10) before your database (ex : position 80) and before your web server (ex : Apache = position 90). |
All times are GMT -5. The time now is 02:26 AM. |