[Samba] RE: [Samba]smb.conf and Environment Variables

Joel Hammer Joel at HammersHome.com
Tue Jan 29 18:24:05 GMT 2002


This is like the blind leading the blind, but, here is what I can figure
out.
If you want to set up a customized set of environmental variable, they can be
put into a file and then read into your global section. For example, if
you had a file like this, generated with the env command in this case:
LOGNAME=jlh
HOME=/home/jlh
SHELL=/bin/bash
USER=jlh

saved as MyEnvironment, you could use the following command:

source environment = MyEnvironment

to read these into your global section. I am not sure why you would want to
do this.

To access one variable, and this may only work in a share, haven't tried
this in the global section:
preexec = echo %$(HOME) > /tmp/MyHome
works.

Joel



On Tue, Jan 29, 2002 at 07:05:53PM -0600, Sanjiv Bawa wrote:
> Here is what the manual says on env vars:
> 
> 
> This is clear enough. Once they are there, you can set them pretty easily.
> 
> >>%$(envvar)
> >>The value of the environment variable envar.
> 
> 
> This is where I get confused. How do you do multiple envi variables? Are
> they semi colon separated or colon or anything else?
> 
> >>source environment (G)
> >>This parameter causes Samba to set environment variables as per the
> content of the file named.
> 
> >>If the value of this parameter starts with a "|" character then Samba will
> treat that value as a pipe command to >>open and will set the environment
> variables from the output of the pipe.
> 
> >>The contents of the file or the output of the pipe should be formatted as
> the output of the standard Unix env(1) >>command. This is of the form :
> 
> >>Example environment entry:
> 
> >>SAMBA_NETBIOS_NAME = myhostname
> 
> >>Default: No default value
> 
> >>Examples: source environment = |/etc/smb.conf.sh
> 
> >>Example: source environment = /usr/local/smb_env_vars
> 
> 
> 
> -----Original Message-----
> From: samba-admin at lists.samba.org [mailto:samba-admin at lists.samba.org]On
> Behalf Of Dwight Tovey
> Sent: Tuesday, January 29, 2002 3:37 PM
> To: Joel Hammer
> Cc: Sanjiv Bawa; samba at lists.samba.org
> Subject: Re: [Samba]smb.conf and Environment Variables
> 
> 
> On Tue, 2002-01-29 at 13:19, Joel Hammer wrote:
> > Please be more specific. What variables are your trying to read and how to
> > do plan on using them?
> >
> 
> I don't know Sanjiv's situation, but I could also use something like
> that.  What I have is an Oracle database running on a Unix box.  For
> some of the applications, users need to copy files from their PC to the
> Unix box where Oracle can get at them, then run an Oracle script to
> process those text files.  Users drop these files into $AP_TOP (an
> environment variable set by a global setup file) and the scripts use the
> same environment variable to find them.  Currently users use FTP to get
> the files from their machines to the Unix box, then move them to
> $AP_TOP.  I would like to use Samba to make it easier for them.
> 
> I could just define the share based on the current value of $AP_TOP, but
> occasionally during the course of installing updates or reallocating
> filesystems, the Oracle DBA will move the location $AP_TOP.  Currently
> he just changes the value of the environment variable setting in the
> global file and both users and the Oracle scripts are happy.  If we go
> to Samba, then we will have to remember to also change the share
> definition as well.  I feel that it would be less error prone if I could
> just get Samba to read the same global setup file and just use the
> environment variable to set the share path.
> 
> 	/dwight
> 
> --
> Dwight N. Tovey                     Unix System Administrator /
> Developer
> League of American Bicyclists       Idaho Transportation Dept.
>      Certified Instructor #750-K-C  3311 W. State St.
> Email: dwight at dtovey.net            Boise, ID.  83702
> http://www.dtovey.net/dwight        (208)334-8166 / fax: (208)334-8121
> ---
> If you choke a Smurf, what color does it turn?
> 
> 
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba
> 
> 
> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba




More information about the samba mailing list