I have tried setting PGDATA=/home/postres/data then export PGDATA This works, but when the machine reboots, it is gone. How can I make the permanent for root? I put it in the /home/postgres/.profile but this does not seem to work Art
You could try putting it in /etc/profile.local that gets sourced from /etc/profile (which is maintained by the system) Or same thing for the pair bash.bashrc & bash.bashrc.local You could also use a script to start whatever program needs the var to set before calling the bin B-) On Wednesday 16 March 2005 09:36 am, Art Fore wrote:
I have tried setting PGDATA=/home/postres/data then export PGDATA This works, but when the machine reboots, it is gone. How can I make the permanent for root? I put it in the /home/postgres/.profile but this does not seem to work
Art
There is no /etc/profile.local, only a /etc/profile.dos and /etc/profile. This is in suse 9.2. Art Brad Bourn wrote:
You could try putting it in /etc/profile.local
that gets sourced from /etc/profile (which is maintained by the system)
Or same thing for the pair
bash.bashrc & bash.bashrc.local
You could also use a script to start whatever program needs the var to set before calling the bin
B-)
On Wednesday 16 March 2005 09:36 am, Art Fore wrote:
I have tried setting PGDATA=/home/postres/data then export PGDATA This works, but when the machine reboots, it is gone. How can I make the permanent for root? I put it in the /home/postgres/.profile but this does not seem to work
Art
Yes, it is true that the /etc/profile.local and bash.bashrc.local don't exist until you create them. They are referenced here /etc/profile line 244 - 248 # And now let's see if there is a local profile # (for options defined by your sysadmin, not SuSE Linux) # test -s /etc/profile.local && . /etc/profile.local /etc/bash.bashrc line 247 - 251 # And now let's see if there is a local bash.bashrc # (for options defined by your sysadmin, not SuSE Linux) # test -s /etc/bash.bashrc.local && . /etc/bash.bashrc.local That is how the magic happens. B-) On Wednesday 16 March 2005 10:19 am, Art Fore wrote:
There is no /etc/profile.local, only a /etc/profile.dos and /etc/profile. This is in suse 9.2.
Art
So would I creat a profile.local with only "PGDATA=/home/postgres/data" as the only line in it? Art Brad Bourn wrote:
Yes, it is true that the /etc/profile.local and bash.bashrc.local don't exist until you create them.
They are referenced here
/etc/profile line 244 - 248 # And now let's see if there is a local profile # (for options defined by your sysadmin, not SuSE Linux) # test -s /etc/profile.local && . /etc/profile.local
/etc/bash.bashrc line 247 - 251 # And now let's see if there is a local bash.bashrc # (for options defined by your sysadmin, not SuSE Linux) # test -s /etc/bash.bashrc.local && . /etc/bash.bashrc.local
That is how the magic happens.
B-)
On Wednesday 16 March 2005 10:19 am, Art Fore wrote:
There is no /etc/profile.local, only a /etc/profile.dos and /etc/profile. This is in suse 9.2.
Art
On Wednesday 16 March 2005 19:47, Art Fore wrote:
So would I creat a profile.local with only "PGDATA=/home/postgres/data" as the only line in it?
No. You need to export the variable too: echo 'export PGDATA="/home/postgres/data"' >> /etc/profile.local ;) Note: only creating this file will not affect current shells. It will only affect newly created shells. It might be necessary to logout of KDE or GNOME, or even to go briefly to runlevel 1... Cheers, Leen
You do have to logout to get the new lines to take effect in your current environment. Or You can use the same "source" command that is in the script that calls it. On the line that does the work [test -s /etc/profile.local && . /etc/profile.local] what is happing is (3 fold) first the program "test" gets run with the parameter "-s /etc/profile.local" which test to see if the file exists. If it does, the "&&" means if the command to the left exits without an error code, run the command to the right, otherwise don't So if the test command works (the file is present) it then runs this command [. /etc/profile.local] the "." at the beginning is the actual ?bash? command called "source" to execute the contents of the file at the current shell command line. So to test the functionality of your profile.local, all you need to do is run the same command [. /etc/profile.local] Then test to see if you environment var is set [set | grep "PGDATA"] which should give you the setting to the right of the "=" in your script. Hope this helps B-) On Wednesday 16 March 2005 12:04 pm, Leendert Meyer wrote:
Note: only creating this file will not affect current shells. It will only affect newly created shells. It might be necessary to logout of KDE or GNOME, or even to go briefly to runlevel 1...
Cheers,
Leen
This worked ans Postgresql now starts on reboot. thanks Art Leendert Meyer wrote:
On Wednesday 16 March 2005 19:47, Art Fore wrote:
So would I creat a profile.local with only "PGDATA=/home/postgres/data" as the only line in it?
No. You need to export the variable too:
echo 'export PGDATA="/home/postgres/data"' >> /etc/profile.local
;)
Note: only creating this file will not affect current shells. It will only affect newly created shells. It might be necessary to logout of KDE or GNOME, or even to go briefly to runlevel 1...
Cheers,
Leen
Art Fore wrote:
So would I creat a profile.local with only "PGDATA=/home/postgres/data" as the only line in it? I could be wrong, but I think it would be "export $PGDATA=/home/postgres/data" -- Joe Morris New Tribes Mission Email Address: Joe_Morris@ntm.org Registered Linux user 231871
On Wednesday 16 March 2005 20:05, Joe Morris (NTM) wrote:
Art Fore wrote:
So would I creat a profile.local with only "PGDATA=/home/postgres/data" as the only line in it?
I could be wrong, but I think it would be "export $PGDATA=/home/postgres/data"
Please try that in a shell. And don't be surprised... ;) Cheers, Leen
On Wednesday 16 March 2005 2:05 pm, Joe Morris (NTM) wrote:
Art Fore wrote:
So would I creat a profile.local with only "PGDATA=/home/postgres/data" as the only line in it?
I could be wrong, but I think it would be "export $PGDATA=/home/postgres/data" On Wednesday 16 March 2005 3:23 pm, Leendert Meyer wrote: Please try that in a shell. And don't be surprised... ;)
Not to steal Leen's steam, the correct syntax is:
"export PGDATA=/home/postgres/data"
NOT: "export $PGDATA=/home/postgres/data"
You set a variable using the variable name. You interpret the variable by
placing a dollar sign in front of it. You can blame Stephen Bourne for
that.
Actually, in the older SH the syntax is:
PGDATA=/home/postgres/data
export PGDATA
The newer POSIX shells expanded the syntax.
--
Jerry Feldman
Jerry, On Wednesday 16 March 2005 13:00, Jerry Feldman wrote:
On Wednesday 16 March 2005 2:05 pm, Joe Morris (NTM) wrote:
Art Fore wrote:
So would I creat a profile.local with only "PGDATA=/home/postgres/data" as the only line in it?
I could be wrong, but I think it would be "export $PGDATA=/home/postgres/data"
On Wednesday 16 March 2005 3:23 pm, Leendert Meyer wrote:
Please try that in a shell. And don't be surprised... ;)
Not to steal Leen's steam, the correct syntax is:
"export PGDATA=/home/postgres/data"
NOT: "export $PGDATA=/home/postgres/data" You set a variable using the variable name. You interpret the variable by placing a dollar sign in front of it. You can blame Stephen Bourne for that.
Blame?? Surely you would not want variables to be interpolated / dereferenced without a special signifier in a command interpreter. Far more of variable-name-like parameters you pass as arguments to programs are literals than are variable references.
...
Jerry Feldman
Randall Schulz
On Wednesday 16 March 2005 4:15 pm, Randall R Schulz wrote:
Surely you would not want variables to be interpolated / dereferenced without a special signifier in a command interpreter. Far more of variable-name-like parameters you pass as arguments to programs are literals than are variable references. I was joking when I mentioned "blame".
Parameters passed to programs are generally literal strings on Linux and
Unix. However, the shell could have been written to allow variable names to
be used without the leading dollar sign. (Awk does that). I go back to
FORTRAN, where variables were either floating point or integer depending on
the first letter (FORTRAN is better now).
I think that today, if someone were to write a totally new shell, he/she
might take a different approach, as they did with the C shell at Berkeley.
But, under the context of the tools Steve had when writing the shell, (TTY),
he did a great job. In any case, we have a user group meeting and I've go
to go to MIT through Boston traffic.
--
Jerry Feldman
On Wednesday 16 March 2005 01:47 pm, Art Fore wrote:
So would I creat a profile.local with only "PGDATA=/home/postgres/data" as the only line in it?
followed by an export command... Just like you did it from CLI
Art
Brad Bourn wrote:
Yes, it is true that the /etc/profile.local and bash.bashrc.local don't exist until you create them.
They are referenced here
/etc/profile line 244 - 248 # And now let's see if there is a local profile # (for options defined by your sysadmin, not SuSE Linux) # test -s /etc/profile.local && . /etc/profile.local
/etc/bash.bashrc line 247 - 251 # And now let's see if there is a local bash.bashrc # (for options defined by your sysadmin, not SuSE Linux) # test -s /etc/bash.bashrc.local && . /etc/bash.bashrc.local
That is how the magic happens.
B-)
On Wednesday 16 March 2005 10:19 am, Art Fore wrote:
There is no /etc/profile.local, only a /etc/profile.dos and /etc/profile. This is in suse 9.2.
Art
Op woensdag 16 maart 2005 17:36, schreef Art Fore:
I have tried setting PGDATA=/home/postres/data then export PGDATA This works, but when the machine reboots, it is gone. How can I make the permanent for root? I put it in the /home/postgres/.profile but this does not seem to work
you can put it in /etc/profile.d as a standalone script. It will be sourced in during boot. -- Richard Bos Without a home the journey is endless
participants (8)
-
Art Fore
-
Brad Bourn
-
Bruce Marshall
-
Jerry Feldman
-
Joe Morris (NTM)
-
Leendert Meyer
-
Randall R Schulz
-
Richard Bos