Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ 1 [2] >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: How best to deal with conf and log files in a uci, First attempt at a uci extension< Next Oldest | Next Newest >
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: June 13 2007,10:43 QUOTE

I made a few tests and using the following symlinks in the uci works:

/opt/xorg72/var/log/ --> /var/log/
/opt/xorg72/etc/X11/xorg.conf --> /etc/xorg.conf

As said, xorg looks for xorg.conf in /etc/X11 first -  I know this because it tried to use my XF86Config-4 file and complained about a missing synaptics driver...

Although xorg finds the libs it needs when starting using startx, once started mini-apps like xclock complain about missing libs so I guess I will need to change the symlink X --> xorg to something like this:
Code Sample
export LD_LIBRARY_PATH=/opt/xorg72/lib:$LD_LIBRARY_PATH
export PATH=/opt/xorg72/bin:$PATH
xorg
Back to top
Profile PM 
^thehatsrule^ Offline





Group: Members
Posts: 3275
Joined: July 2006
Posted: June 13 2007,16:26 QUOTE

I have a feeling that you wouldn't need the wrapper if it was the original symlink to hd for some reason...

Some notes:
Isn't xorg, Xorg? (caps)
Though I'm sure PATH will be set almost all the time, LD_LIBRARY_PATH usually is not, and although having a trailing : may work, perhaps checking if it's empty first or not will be better (and then setting the appropriate string).
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: June 13 2007,17:58 QUOTE

It seems to me that the wrapper is needed for the x apps that require libraries installed into /opt/xorg72/lib. Also, if i'm understanding what you said, LD_LIBRARY_PATH *might* be set by the user prior to running Xorg, so I think it's best to include a possible existing $LD_LIBRARY_PATH when it is set rather than risk accidentally breaking other apps.  A check for an existing non-zero value (test -n or test -z, for example) will work as well, but a trailing colon will do no harm.

--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: June 14 2007,03:48 QUOTE

If I check the contents of the library path after running xorg, but before running xclock, I get this:
Code Sample
#echo $LD_LIBRARY_PATH

#

Where the space is deliberate - i.e. the library path is either empty or contains <space> and/or <cr>.

If I check the contents of the path, I don't remember exactly what it shows, but I remember end of the entry is ".../opt/bin:." where there is a full stop after the semi-colon -  I don't know if this is significant or not.
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: June 14 2007,05:03 QUOTE

The space is deliberate only because the echo command automatically adds a space to its output. If you were to use echo's "-n" parameter (echo -n $LD_LIBRARY_PATH), or used some other method of grabbing the variable, you would not see that space.
Your personal LD_LIBRARY_PATH variable, as well as that of any other DSL user who hasn't changed it, is empty (or possibly unset, although the difference between empty and unset is not important in this case). My earlier point about appending rather than replacing the variable, even if it is usually empty, is important because even though your variable is empty, someone else's may not be. If you're creating something that will be distributed to other users you shouldn't make assumptions about things like this, particularly when avoiding a potential problem is a simple task.

The dot at the end of PATH is not a full stop. It's a dot, which represents the present directory. What it means is that no matter what directory you are in, that directory becomes part of PATH so you can run commands in that directory without preceding the command with "./" (while you're in that directory).  I'm not really sure why this was done, especially considering many people claim this is a potential security issue. But at least the dot is at the end of PATH, so commands in ./ do not override system commands.

Also, I see you ran the echo command as root. Each user has a unique environment, so root's LD_LIBRARY_PATH is not going to be the same as dsl's LD_LIBRARY_PATH. If the application is run by dsl, root's environment has no influence over it.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
9 replies since June 12 2007,16:19 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ 1 [2] >/
reply to topic new topic new poll
Quick Reply: How best to deal with conf and log files in a uci

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code