Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
variable not exporting during boot!
Name: MarcusTorres Date: February 19, 2003 at 12:23:36 Pacific OS: solaris 2.6 CPU/Ram: 440mhz/256mb
Comment:
I have a script in /etc/rcS.d which basically just sets a variable:
DISKSTATE="blah" ; export DISKSTATE
Then later during bootup, in /etc/rc3.d i have another script which calls that variable. The problem is , the variable is always empty. It's losing it's value even though i exported it early during bootup. How can keep the value of the variable throughtout the system bootup!? Any help would be greatly appreciated.
p.s. I've tried a workaround, instead of making a variable, i would write to a tmp file.... BUT...you cant write to the disk during bootup. why not?
Name: Mauro Date: February 20, 2003 at 09:16:19 Pacific
Reply:
1. You can't set a variable in a script and then get its value in the other, because... this is the way it works! When you run a process (in this case a shell) it has its private environment, that is a memory area. In this env you can set variables for your private use. Exporting a variable simply means: when your process will span a new process, this will inherit your variable. In effect exporting is a way to pass parameters to your children processes (example: DISPLAY variable). See man page exec(2), the envp[] parameter. 2. I read in /etc/rcS.d/README, that after the execution of S30rootusr I have / and /usr mounted read-only. I think they will be mounted read-write by S40standardmounts.sh
Summary: On solaris 8, This will happen if you have a bad disk. When the disk fails it boots from net by default boot-device is “disk” then “net”. This also happens sometimes if you turn off/lose power during ...
Summary: I wanted to start sshd during bootup and have created a soft link /etc/rc2.d/s98sshd -> /etc/init.d/sshd. sshd file has the script written below, but whenever I restart the server, sshd is not runnin...
Summary: Need your help!!! I have a SPARC Ultra 10 machine running Solaris 10, it was using static ip address, recently I changed the config from static ip to dynamic ip which connected to a gateway, added the...