Link to home
Start Free TrialLog in
Avatar of EEuser 357778
EEuser 357778

asked on

linux, command not found? simple?

Im running fedora core 10.

when i test:

sudo -u nobody  ffmpeg [options]

i get: sudo: ffmpeg: command not found

but if i do:

sudo -u nobody /ffmpeg/ffmpeg [options]

then it works

how do i get ffmpeg into the right place so that the first command will work>

thanks alot!

joe
ASKER CERTIFIED SOLUTION
Avatar of Michael Worsham
Michael Worsham
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of EEuser 357778
EEuser 357778

ASKER

rohitt:


did that
samething...

[root@fightube ~]# sudo -u nobody ffmpeg -i /var/www/html/wsngallery/attachments/googleearthvideo331a.wmv -ar 22050 -ab 32 -f flv -s 400x300 - /var/www/html/wsngallery/attachments/googleearthvideo331a.flv
sudo: ffmpeg: command not found


do i need to restart something after making that change?

also how do i disable iptables servcie on boot
[root@fightube ~]# nano .bash_profile
  GNU nano 2.0.6             File: .bash_profile
 
# .bash_profile
 
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
 
# User specific environment and startup programs
 
PATH=$PATH:$HOME/bin
 
export PATH
unset USERNAME
PATH="${PATH}":/ffmpeg
 
source the .bash_profile
$ source ~/.bash_profile

Open in new window

just add this line to your ".bash_profile"

PATH="${PATH}":/ffmpeg

then run this command from the terminal windows
$ source ~/.bash_profile

you don't have to include these lines in your .bash_profile

source the .bash_profile
$ source ~/.bash_profile
your .bash_profile should look like this

# .bash_profile
 
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
 
# User specific environment and startup programs
 
PATH=$PATH:$HOME/bin
PATH="${PATH}":/ffmpeg
export PATH
unset USERNAME

Open in new window

to disable iptables firewall execute these commands

service iptables save
service iptables stop
chkconfig iptables off
still same thing...
does seomthing need to be reset after i change this??

understand that typing int

ffmpeg  works.

ist just when i do sudo -u apache   ffmpeg...

or

sudo -u nobody ffmpeg....

or

sudo -u root  ffmpeg
When you do 'sudo -u nobody <command>', the PATH is being picked up by the '-u nobody' profile, not your own profile. The best way around this would be to modify the global profile (usually found under /etc/profile).

_OR_

If this is being kicked off from your account, do:

PATH=$PATH:/path/to/command
sudo -u userid command
sudo -u nobody ffmpeg....
you also need to add "/ffmpeg/" directory to the PATH of the user nobody

or add the "/ffmpeg" to  the the "system wide /etc/profile"
or you can just create a soft link to that command in /usr/bin with that command as root:

ln -s /ffmpeg/ffmpeg /usr/bin/ffmpeg

nothing else needed.
Hello

Type at prompt:
whereis ffmpeg
<must see the result>
PATH=$PATH:/pathoftheffmpeg
sudo -u <username> ffmpeg

Great is our GOD.
:)
rionroc
Unless configured to leave all environment symbols as is, sudo sanitises the environment
by cleaning it out and establishing the system defaults.

SO interactive PATH=$PATH ... won't work.

the symlink (to add an alias to /bin or better /usr/bin ) suggestion does work, the modification of your default environment should work (/etc/profile).
Also giving an explicit location to sudo should work...
sudo -u nobody /ffmpeg/ffmpeg .....       ;-)

Also why this location /ffmpeg/ffmpeg..., if you install an rpm it should be setup to all the right places.



I guess you should run the following before running the command:

export PATH=$PATH:/ffmpeg

And if you don't want to run this every time, then you can add this into you profile.