[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: YANQ (Yet another newbie question...)



On Mon, 24 Nov 1997, Andrew Akins wrote:

> I hope I didn't send this out twice...
Not that I saw.
> 
> I'm new to unix (let alone debian) and I can't seem to figure out two
> problems (which I think are related...)
> 
> 1) Where do I put programs (daemons) that I want to automatically
> startup, ie., what is the "Autoexec.bat" file of the unix world? I
> looked in .bashrc and .bash_profile, which seem to set a lot of
> enivronment variables, but I don't se if you can put programs in this.

You can.  In particular, you can put any bash command in there you want
(note however that aliases defined with the 'alias' command are
usually ignored while bash is reading from a file).

> In particular, I need to startup my postgres postmaster daemon no matter
> what account you're logged in as...so I need a system-wide init file.

Other people have already answered this so I won't repeat it.  I will say,
however, that even though it is more of a pain you really should go about
creating the separate start/stop file and symbolic links of the form
/etc/rc*.d/Snn* and /etc/rc*.d/Knn* (don't know about whether to use
specifically S99 and K99, though - you may want to use S20 and K20, which
is closer to the default), as opposed to simply adding files in
/etc/rc.boot.  This way, your postgres mail daemon will be stopped when
you take the system into single user mode for maintenance.

> 
> 2) I'm using Fvwm2 and FvwmButtons...and I must be doing somehting
> wrong. I can start my StarOffice applications from the command line (ie.
> swriter3 &) but the `Exec "" swriter3` command attatched to FvwmButtons
> or a menu don't seem to work...I'm wondering - are the enivronment
> variables (there are many for StarOffice) visible to fvwm2, and if not,
> how can I make it so? (I've set the variables in both .bashrc and
> .bash_profile).

Yep - your guesses are correct.  The reason is that fvwm2 (and modules)
aren't started by bash, so any environment variables set in bash login
scripts won't be available.  There are two solutions that I can think of
off the top of my head:
1) "per user" solution - this involves no work running as root, but will
only work for your user (so if you give your friends accounts, they'll
have similar problems).
Add the environment variables to your ~/.xsession file, before the line
that calls your window manager.  If you don't yet have a ~/.xession file,
create it and put something like the following into it:
-----Snip here-----
#!/bin/sh
export STAROFFICEVAR=/usr/local/whatever
exec fvwm2
-----Snip here-----
(since I know nothing about staroffice, I made a variable name up - use
whatever you need to, of course)
Then do:
  chmod u+x ~/.xsession

2) "system-wide" solution.  This requires work by root, but so do most
system-wide operations.  Create a file called /etc/environment and place
the definitions of environment variables you want defined both in X
sessions and in text-only logins in there.  (the format should still be
'export VARIABLENAME=variablevalue')  By default, X will look for this
file and source it (i.e. acquire any environment settings contained
therein) if it exists.  You still need to make a minor change, though, if
you want to use this one place for text-only logins as well - put the line
'source /etc/environment' into your /etc/profile.  Now, whenever you
install something that requires a global environment variable to be
specified (you shouldn't really add too many environment variables, but a
few won't hurt), you can just add it to /etc/environment and it'll affect
both text and X.


p.s. For the people on the list who follow the construction of the base
Debian system - why doesn't the default /etc/profile include the lines
if [ -f /etc/environment ] ; then
  . /etc/environment
fi
like the default /etc/X11/Xsession does?  And further, couldn't the
environment variables that are by default set in /etc/profile then be
moved to /etc/environment?


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: