LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-10-2010, 12:15 PM   #1
Porch
LQ Newbie
 
Registered: Feb 2010
Location: Los Alamos, NM
Distribution: Mint
Posts: 10

Rep: Reputation: 0
Permanently add path to root via script?


Hi,
Long story short, i'm working on my first .deb package. I need to add the /usr/sbin directory to $PATH for root. I think the easiest way to accomplish this is to add a little code to the postinst file.

What's the easiest, most correct way to go about this?
Thanks in advance.
~Chris

Last edited by Porch; 05-11-2010 at 04:17 PM.
 
Old 05-11-2010, 04:57 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
that path should already be on any root users profile, it really sounds like you're going about what you want to do the wrong way. What is the actual scenario you're in?
 
Old 05-11-2010, 01:13 PM   #3
Porch
LQ Newbie
 
Registered: Feb 2010
Location: Los Alamos, NM
Distribution: Mint
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for the help!

It's a long story, but basically i'm using the Xen kernel for some custom stuff. The executable "xend" is in the /usr/sbin directory (i put it there with my package), but as a super user when you call it from any other directory it won't execute.

I'm pretty new to linux overall, so chances are pretty good that i don't know what i'm doing
 
Old 05-11-2010, 03:39 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
If I do a bit of guess work, are you getting root access by just running "su" ? if so, then that will cause exactly what you're seeing, i.e. the root user not getting a full root environment, including paths. run "su -" instead and that will give a full env setup, which will include /usr/sbin.
 
Old 05-11-2010, 04:17 PM   #5
Porch
LQ Newbie
 
Registered: Feb 2010
Location: Los Alamos, NM
Distribution: Mint
Posts: 10

Original Poster
Rep: Reputation: 0
Yep, that's exactly it! Thanks for the help!!
 
Old 05-11-2010, 04:37 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Woohooo! My Psychihat(tm)(r) pays off again.
 
  


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
how to add a file to a zip, without including the entire path from root marvelade Linux - Newbie 6 02-19-2009 05:32 AM
script help - add absolute path to list of filenames greengrocer Linux - Newbie 7 10-12-2008 04:23 AM
add to root's path permanently linuxfia Ubuntu 3 04-14-2008 11:42 PM
edit value of PATH permanently rsumbeling Linux - General 2 12-13-2004 10:57 AM
How to set PATH permanently chandhru Linux - Newbie 3 09-24-2002 12:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:20 AM.

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