User login

Piston not found after installation, setting bash paths

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-sudo.html

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?

Resolution

Searched words: 
Add to sudo path linux add command to path debian add user to sudo group

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.