LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 09-11-2009, 06:37 AM   #1
zodehala
Member
 
Registered: Nov 2008
Posts: 53

Rep: Reputation: 15
bash: ntsysv: command not found


whenever i try to run ntsysv command as root it gives following error in CentOS 5.3
Code:
bash: ntsysv: command not found
 
Old 09-11-2009, 06:45 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
You simply don't have the package ntsysv installed. Search and install it using Add/Remove Software or
Code:
yum install ntsysv
from the command line. Note that you don't need an additional interface to configure runlevels. You can do the same using the Services Configuration Tool accessible from the menu System --> Administration --> Services, unless you really need the console application.

Last edited by colucix; 09-11-2009 at 06:47 AM.
 
Old 09-11-2009, 08:32 AM   #3
zodehala
Member
 
Registered: Nov 2008
Posts: 53

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
You simply don't have the package ntsysv installed. Search and install it using Add/Remove Software or
Code:
yum install ntsysv
from the command line. Note that you don't need an additional interface to configure runlevels. You can do the same using the Services Configuration Tool accessible from the menu System --> Administration --> Services, unless you really need the console application.
i connect via SSH

Code:
[root@localhost admin]# yum install ntsysv
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.linux.org.tr
 * updates: ftp.linux.org.tr
 * addons: ftp.linux.org.tr
 * extras: ftp.linux.org.tr
base                                                                                                                                  | 1.1 kB     00:00
updates                                                                                                                               |  951 B     00:00
addons                                                                                                                                |  951 B     00:00
extras                                                                                                                                | 1.1 kB     00:00
Setting up Install Process
Parsing package install arguments
Package ntsysv-1.3.30.1-2.i386 already installed and latest version
Nothing to do
[root@localhost admin]# ntsysv
bash: ntsysv: command not found
[root@localhost admin]#
 
Old 09-11-2009, 08:37 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Ok. Maybe a PATH problem. First check where the binary executable has been installed. Here is what I get on my system
Code:
# rpm -ql ntsysv | grep bin
/usr/sbin/ntsysv
then check if the directory is in the root's PATH. As a temporary workaround you can run the ntsysv command using absolute path:
Code:
# /usr/sbin/ntsysv
 
Old 09-11-2009, 08:38 AM   #5
mesiol
Member
 
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137
Hi,

what does
Code:
which ntsysv
say to you?

Probably ntsysv is not in your path. In my CentOS 5.3 installation it is located in /usr/sbin.
 
Old 09-11-2009, 08:43 AM   #6
Amy84
LQ Newbie
 
Registered: Aug 2009
Location: Netherlands
Distribution: CentOS 5.3
Posts: 27

Rep: Reputation: 15
can't you use chkconfig instead?
 
Old 09-12-2009, 04:10 AM   #7
zodehala
Member
 
Registered: Nov 2008
Posts: 53

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
Ok. Maybe a PATH problem. First check where the binary executable has been installed. Here is what I get on my system
Code:
# rpm -ql ntsysv | grep bin
/usr/sbin/ntsysv
then check if the directory is in the root's PATH. As a temporary workaround you can run the ntsysv command using absolute path:
Code:
# /usr/sbin/ntsysv
i run it as /usr/sbin/ntsysv but before this (in Centos5.2) i can run it just write ntsysv.

why does it run like such ?
 
Old 09-12-2009, 05:57 AM   #8
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by zodehala View Post
why does it run like such ?
As I already mentioned, maybe it is a PATH problem. Check it out. It may depend on the command you issued to login as root: if you used su from another user's console, maybe you missed the argument - (hyphen). If you omit the hyphen, root will inherit the user's environment, PATH included, without /sbin and /usr/sbin in it.
Code:
[user@localhost ~]$ su
Password:
[root@localhost ~]# echo $PATH
/usr/local/bin:/bin:/usr/bin:/home/user/bin
[root@localhost ~]# exit
[user@localhost ~]$ su -
Password:
[root@localhost ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
 
Old 09-12-2009, 08:13 AM   #9
scottro11
Member
 
Registered: Jun 2009
Location: NYC
Posts: 263

Rep: Reputation: 59
http://home.roadrunner.com/~computer...su/rhpath.html
 
Old 09-12-2009, 09:35 AM   #10
zodehala
Member
 
Registered: Nov 2008
Posts: 53

Original Poster
Rep: Reputation: 15
i can dir via echo $PATH

And how can i list installation directory for example i installed mysql and php and apache how can i see htdocs (public_html) dir. or mysql installation dir ? (lik echo $PATH)
 
Old 09-12-2009, 01:03 PM   #11
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by zodehala View Post
And how can i list installation directory for example i installed mysql and php and apache how can i see htdocs (public_html) dir. or mysql installation dir ? (lik echo $PATH)
A useful command is whereis, to list the locations where the executables and the manual pages ar installed, e.g.
Code:
whereis mysql
If you want to see where a package has copied (that is installed) its files, you can simply use the very powerful rpm command:
Code:
rpm -ql mysql
You can grep the results to see specific sections:
Code:
rpm -ql mysql | grep bin      # for executables
rpm -ql mysql | grep doc      # for the htdocs and so on...
While you will use yum to install and search available packages (since it manages dependencies and keeps the packages database updated), rpm has many useful options at hand. Just an example: if you want to see what package has provided a specific file, you can do
Code:
rpm -qf /path/to/file
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: command not found hamish Linux - Newbie 7 02-23-2011 04:28 PM
bash -command not found- ALInux Linux - Newbie 3 12-30-2006 12:41 PM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM
bash: command not found intels_ss Linux - Newbie 5 07-20-2005 07:41 PM
-bash: ls: command not found jchun Linux - General 3 11-02-2004 10:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration