Re: setting enviroment variable before deamon starts



tomb <tomb.fish@xxxxxxxxx> said:
I have problem with running deamon on boot up. I register deamon to
start at boot up in /etc/rc.rd/rc.local file :

#Add you want to add deamon
/home/progs/ts &~

Deamon starts up! but it should use 2 env variables, which I register
in bash profile (/etc/bash).

How can I register environment variable before deamon starts?

If the env.vars are something that just the daemon should see,
then there are two possibilities. One was already discussed;
make a script that starts the daemon, and that you call during
the system startup (in the rc.local script).

The other possibility is to use "env" command as a helper to start
the daemon; instead of the
/home/progs/ts &
you have above (supposing that's one of the daemons you're starting),
use
env VAR1=val1 VAR2=val2 /home/progs/ts &

--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
.



Relevant Pages

  • Re: How to create a daemon?
    ... > Q1> How do I create a daemon on UNIX OS, ... Typically by fork, the in the child, dis-associate with your tty (I ... programs run as deamon at start up. ... Refer to the classic "Unix system Programming" of Stevens ...
    (comp.unix.questions)
  • Re: setting enviroment variable before deamon starts
    ... I have problem with running deamon on boot up. ... but it should use 2 env variables, which I register ... Facciamo quello per cui siamo stati addestrati, per cui siamo stati cresciuti, per cui siamo nati. ...
    (comp.os.linux.development.apps)
  • Re: setting enviroment variable before deamon starts
    ... I have problem with running deamon on boot up. ... but it should use 2 env variables, which I register ...
    (comp.os.linux.development.apps)
  • setting enviroment variable before deamon starts
    ... I have problem with running deamon on boot up. ... but it should use 2 env variables, which I register ...
    (comp.os.linux.development.apps)