About QNX6.2.1 Automatic log-in

I have changed the /etc/rc.d/rc.sysini. In this file, I added like this:

LOGNAME=root HOME=/root   PATH=/bin:/usr/bin……

Then when reboot my computer, the QNX can automatic log-in,
without any passwd. But about this user, I have set up the password.
The more important thing is, though has started to under root users, the system has not run .profile. So, have not set up success in a lot of
environmental variables.

In fact, I want to start QNX system automatically, and operate
the software that I designed automatically after starting.

Hope everybody gives directions , thanks a lot.

Is the software you designed a Photon application or a normal text based app?

Since you want your Photon to be automatically started as root, why do you need to create a different user?

Assuming you want Photon to be auto started as the new user, say, “myuser”, and your own application is a Photon GUI application called “myapp” located in /usr/bin.

Here are the steps:

  1. clean the stuff you added in rc.sysinit (LOGNAME… HOME …)

  2. create a file /etc/rc.d/rc.local if it is not already there, add the following lines at the end of rc.local

/bin/su - myuser -c “/usr/bin/ph”

  1. make sure the /etc/rc.d/rc.local is executable:
    chmod a+x /etc/rc.d/rc.local

  2. In the new user’s home directory:
    mkdir -p .ph
    cd .ph
    vi phapps
    and add your own application in there:
    /usr/bin/myapp &
    save the “phapps” file and make it executable
    chmod a+x phapps

That’s it.

The problem has been solved,
thank you for your answers very much.

what if I want to log in as root in photon automatically? Do I do the below?

/bin/su -root -c “/usr/bin/ph”

Yours looks good, except that you need a space before root:

/bin/su - root -c “/usr/bin/ph”