LinuxQuestions.org
Register a domain and help support LQ
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 07-28-2013, 03:26 AM   #1
narke
Member
 
Registered: Apr 2010
Posts: 70

Rep: Reputation: 0
Where to set environment for boot processes


Hi,

Where is the right place to set some environments variables for boot processes (those started from /etc/rc.d/rc.[SM])? I think, /etc/profile is not suitable, since it only effects environments of login sessions).

Thanks in advance,
 
Old 07-28-2013, 06:10 AM   #2
torimus
Member
 
Registered: Apr 2013
Distribution: Slackware
Posts: 81

Rep: Reputation: Disabled
You can put them into corresponding init scripts or even in inittab itself. More important question - why do you need that, what are you trying to achieve ?
 
Old 07-28-2013, 11:20 PM   #3
narke
Member
 
Registered: Apr 2010
Posts: 70

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by torimus View Post
You can put them into corresponding init scripts or even in inittab itself. More important question - why do you need that, what are you trying to achieve ?
Because this is embedded system, most programs started from init. Some environments dedicated to these program, such as MY_APP_DATA_PATH, need to be set correctly.
 
Old 07-29-2013, 12:03 AM   #4
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 516

Rep: Reputation: 58
Quote:
Originally Posted by narke View Post
Hi,

Where is the right place to set some environments variables for boot processes (those started from /etc/rc.d/rc.[SM])? I think, /etc/profile is not suitable, since it only effects environments of login sessions).

Thanks in advance,
well from all above description I assume you have a application and you want to set up a path variable for that before it executes after the systems boots up!! is this correct ? if not it is still not clear what you are trying to do, if you can explain a bit in brief your requirement we would help you better.

taking the first situation, you can write a simple script to set up the env. variable and place it inside /etc/profile.d/, your script will be called everytime at startup.
 
Old 08-02-2013, 10:34 AM   #5
narke
Member
 
Registered: Apr 2010
Posts: 70

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by SAbhi View Post
well from all above description I assume you have a application and you want to set up a path variable for that before it executes after the systems boots up!! is this correct ? if not it is still not clear what you are trying to do, if you can explain a bit in brief your requirement we would help you better.

taking the first situation, you can write a simple script to set up the env. variable and place it inside /etc/profile.d/, your script will be called everytime at startup.
SAbih,

I think /etc/profile.d/* scripts will not be executed before /etc/rc.d/rc.M get executed, my application was started from rc.M. So, setting variables in /etc/profile.d/* does not help.
 
Old 08-02-2013, 11:20 AM   #6
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,428

Rep: Reputation: 867Reputation: 867Reputation: 867Reputation: 867Reputation: 867Reputation: 867Reputation: 867
have you tried exporting the variables directly at the top of rc.M (or just before your application is started there)?

Last edited by ponce; 08-02-2013 at 11:24 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 can the locale be set for processes started by boot scripts? catkin Slackware 2 03-08-2010 03:12 AM
oom-killer: How to set priorities to kill processes guarriman Linux - Security 1 01-31-2006 09:03 AM
Set environment salmanucit Linux - Software 1 01-04-2006 03:50 AM
I need to set a max number of processes for users zahadumy Linux - Software 1 11-15-2005 12:52 AM
Set Environment Variable lloyd_stevens Linux - Software 1 07-30-2003 12:38 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration