Local Vars from rc.sysinit after login command

I want to transfer only one local var from the rc.sysinit to use in the .profile file, after the login command. But the problem is after the login comand i can´t find my specific local var from rc.sysinit. Can somebody me help?

You will probably need to put that local var into /etc/profile

/etc/profile is not possible. I want to set this Var as Flag for a funktion in .profile file. At the moment i´m creating a Symbolic Link in rc.sysinit. Is the Link set can the .profile file working with him. After this funktion, .profile delete this Link for next Reboot.

Setting environment variables in rc.sysinit isn’t very useful, because login starts another shell, and login clears the environment, except for a few selected variables unless you specify the -p option (see the docs for login). What are you trying to do? Do you have to do it in the user’s .profile?

The reason for this all is a automatic login in Photon. When I logging in a console /dev/con1 as root with the “on -t” command (direct in rc.sysint), the command “Photon -l Phlogin -U root” doesn´t work. It say “root to small, replaced with 1 etc…”. Thats is why i starting photon with the “ph” command in .profile. But i must make a difference to the options “safemode and nophoton”. Otherwise photon is starting always. I now that´s not very useful with local vars and I have now a better way for this. I want to have allways the same user. I logging now for safemode and nophoton as /dev/con4 and for my autologin as /dev/con1 with the “on” command in rc.sysinit. Now I can compare, in .profile with "if test $(tty) != … and select the ph command or not. But I have now a disadvantage in modes safemode/nophoton: I must manually change to /dev/con4 with keyboard. Is there a other way for this?

And why “Photon -l phlogin -U root” does not start? Comment from phlogin: “…value root to small, replaced with 1…”???

Edit: OK, Phlogin is now starting with this Syntax: /usr/photon/bin/Photon -l ‘/usr/photon/bin/phlogin -OUroot’. When I run this command in rc.sysinit or rc.local the autologin is running. The problem by this way, after few seconds working with ped, there are keyboard input errors and you can not normaly work with this program. The Method is not clean and I have decided to change back to first way. Starting over different consoles and starting ph in .profile file.

OK, Problem solved. I have found in /etc/default/login an enviroment, where I can define which LocalVar I want to keep. Thanx for help!

not sure why you made it so complicated for auto login photon.
If you put the following line in /etc/rc.d/rc.local, you will be able to autologin photon:

export LOGNAME=root

I have try it at the beginning. But login with export LOGNAME=root is not the same as a real login. For Example the background in Photon is black, homedir and other vars are not set.

Check this thread. homedir and other vars should all be set.