Piston not found after installation, setting bash paths

Key words and phrases: 
Add to sudo path linux add command to path debian add user to sudo group
Description & Info: 

http://neoarch.wordpress.com/2007/07/13/bash-cap-command-not-found/

vi ~/.bashrc

#Set path for Piston
export PATH=$PATH:/var/lib/gems/1.8/bin

source ~/.bashrc

server:~$ sudo vi /root/.bashrc
server:~$ source /root/.bashrc

/var/lib/gems/1.8/bin

restart bash

ben@server:~$ sudo /bin/bash --login

root@server:~# piston -h
Usage: piston [options]
-v, --verbose Show subversion commands and results as they are executed
-q, --quiet Do not output any messages except errors
-r, --revision=REVISION
-u, --show-updates Query the remote repository for out of dateness information
-l, --lock Close down and lock the imported directory from further changes
--dry-run Does not actually execute any commands
--force Force the command to run, even if Piston thinks it would cause a problem

root@server:~# exit
logout
ben@server:~$ sudo piston -h
sudo: piston: command not found

/srv/scripts/agaric-newproject.sh 5 jonassoftware jonassoftware.com

/var/lib/gems/1.8/bin/

/srv/scripts/agaric-getdrupal.sh: line 20: piston: command not found

sudo SECURE_PATH

Using Sudo
http://aplawrence.com/Basics/sudo.html

http://www.debianadmin.com/providing-root-privileges-for-users-using-sud...

How to override SECURE_PATH in sudo?
http://lists.debian.org/debian-user/2003/08/msg00682.html

add user to sudo group
http://electron.mit.edu/~gsteele/linuxfaq/

sudo adduser ben sudo

ben@server:~$ sudo piston --helpUsage: piston [options]
-v, --verbose Show subversion commands and results as they are executed
-q, --quiet Do not output any messages except errors
-r, --revision=REVISION
-u, --show-updates Query the remote repository for out of dateness information
-l, --lock Close down and lock the imported directory from further changes
--dry-run Does not actually execute any commands
--force Force the command to run, even if Piston thinks it would cause a problem

but it still doesn't work when run as a script

useful for the Vi commands G and o if nothing else:
http://www.kempston.net/solaris/sudo.html

What path sudo use: (no definitive solution)
http://ubuntuforums.org/showthread.php?t=555359

Finally! A reasonable workaround:

http://ubuntuforums.org/showthread.php?t=616698

Re: sudo PATH problem
Quote:
Originally Posted by MicahWedemeyer

When I installed rubygems (a development tool for Ruby), it installed several useful tools in the /var/lib/gems/1.8/bin directory. Some of these would be nice to run as root.
I'd take a different strategy there. If there are not too many files in that directory and if their names do not collide with any system-relevant program name (please check that before you do anything) you could create symbolic links between the files in /var/lib/gems/1.8/bin/ to /usr/bin/ ... So all the files in /var/lib/gems/1.8/bin/ would also be reachable via /usr/bin ... I am sure "sudo" can find stuff there regardless of what the differences between the $PATH variables between the various accounts are ... /usr/bin is most likely always in the list any account will look into when searching for a program.

Another idea could be to modify /etc/environment .... As far as I can tell that file defined the system-wide $PATH variable every account gets on a system?

by Benjamin Melançon
Posted on Tue, 2008-06-24 18:23
in
Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <small> <pre> <strike> <sub> <sup>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.