LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-20-2007, 08:47 AM   #1
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
"Broken" envirnment variable (MANPATH) and "/etc/profile.d" question.


Hello.
I've recently installed Qt 4.2.2 and it looks like it changed MANPATH variable, and now system can't find some manpages (located in /usr/local/share/man).
I've searched through several scripts and finally found that MANPATH is set somewhere in scripts in the /etc/profile.d folder (/usr/lib/man.conf has correct paths, but it's ignored if MANPATH exists) to a folders that contain Qt documentation, but at the end of startup MANPATH doesn't contain paths listed in /usr/lib/man.conf.

The questions are:
1) Where should i assign/set MANPATH variable to guarantee that it won't get overwritten again? (It looks like some installation programs really like to break configuration files)
2) Is there another way to modify "man" behavior? (To make it search both MANPATH and /usr/lib/man.conf directories)
3) What is the purpose of profile.d folder (didn't find this in Slackware FAQ and using whatis and apropos)? It looks like it contains some scripts (I've already set system locale in the /etc/profile.d/lang.sh) that are called either at system startup or when user logs in, but I'm not certain about that. Where is this folder documented? And what and when calls scripts located inside?
 
Old 03-20-2007, 08:57 AM   #2
pdw_hu
Member
 
Registered: Nov 2005
Location: Budapest, Hungary
Distribution: Slackware, Gentoo
Posts: 346

Rep: Reputation: Disabled
1) /etc/profile, .bashrc, .bash_profile
2) dunno.
3) it has some additional scripts which are called from /etc/profile.d/

Read the bash manpage for more info on the mentioned files.

Last edited by pdw_hu; 03-20-2007 at 09:08 AM.
 
Old 03-20-2007, 09:25 AM   #3
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
1) I'd opt for personal files, like pwd_hu suggested: .bashrc/.bash_profile
2) Take a look at man's man page: man man
You'll probably have to play with -C and/or -M options.
3) They contain scripts to set enviroment values which are needed by programs which are not neccesary to normally run a system. That means, no critical packages, like QT,gtk,jre. To avoid having to thinker a lot to set these values, packages often includes this scripts which goes there, so they can easily be added or removed by just playing with a file inside profile.d.
These scripts are called at the end of /etc/profile's execution.
The "official" slackware package contains a script in profile.d which set some of these enviroment values you need, this is the bash script:
Code:
#!/bin/sh
# Environment variables for the Qt package.
#
# It's best to use the generic directory to avoid
# compiling in a version-containing path:
if [ -d /usr/lib/qt ]; then
  QTDIR=/usr/lib/qt
else
  # Find the newest Qt directory and set $QTDIR to that:
  for qtd in /usr/lib/qt-* ; do
    if [ -d $qtd ]; then
      QTDIR=$qtd
    fi
  done
fi
if [ ! "$CPLUS_INCLUDE_PATH" = "" ]; then
  CPLUS_INCLUDE_PATH=$QTDIR/include:$CPLUS_INCLUDE_PATH
else
  CPLUS_INCLUDE_PATH=$QTDIR/include
fi
MANPATH="$MANPATH:$QTDIR/doc/man"
PATH="$PATH:$QTDIR/bin"
export QTDIR
export CPLUS_INCLUDE_PATH
export MANPATH

Last edited by gbonvehi; 03-20-2007 at 09:29 AM.
 
Old 03-20-2007, 09:42 AM   #4
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202

Original Poster
Blog Entries: 3

Rep: Reputation: 62
pdw_hu, gbonvehi
Thanks a lot for a quick replies! The mention about /etc/profile was quite useful, now I know how this thing works... I think adding another script into the profile.d will solve the problem...
--added--
It was even simpler. MANPATH is declared at the start of /etc/profile. I just had to change initial value (I've added /etc/local/share/man).
Thanks again. problem solved.

Last edited by ErV; 03-20-2007 at 09:50 AM.
 
  


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
newbie question: whats the difference between "su root", "su" and "su -&quo mojarron Slackware 9 12-07-2009 04:08 PM
"clear" and "reset" bash commands broken AviJacobson Linux - General 6 07-03-2006 06:28 AM
"clear" and "reset" bash commands broken AviJacobson Linux - Software 1 06-29-2006 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:48 PM.

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