View Full Version : restorecon: command not found

31st May 2007, 12:56 AM
Hi, I'm attempting to install Asterisk on fedora core 6 (2.6.20) and I've run into a problem with the restorecon command. Every time I attempt to run the command the system comes back with command not found, although the restorecon file exists in /sbin where it's shown as a shared library.

I'm new to this and I can't find any reason why the command won't work. I've looked in the release notes and the bug lists and can't find any reference to this problem. Anyone got any ideas?

31st May 2007, 01:16 AM
I don't know anything about asterisk, but I'd try this:

$ /sbin/restorecon

If that doesn't work then try it as a root user:

$ su (enter password)
# restorecon

31st May 2007, 01:33 AM
Many thanks, that worked a treat!

31st May 2007, 04:15 AM
in a console, type the following

echo $PATH
you will get a list of different paths seperated by colons. Whenever you want to start something by just giving it's filename (omitting the path) the system checks for this program in these directories and (if found) executes it.

As you see, /sbin is not part of your PATH variable and so you had to specify the whole path


31st May 2007, 04:26 AM
Also, /sbin is not in the default PATH for normal users because many of the apps in it will not function (or won't function fully) for normal users, but only for root. You can add /sbin to your PATH for any user, but don't be surprised if you get errors/warnings unless you are acting as root.