Cannot autostart OpenSSH from rc.local

I’ve intalled OpenSSH from “QNX Momentics Third Party ISO”
and have some problems with auto start sshd:

I have to put ‘sleep 5’ before ‘sshd’ in my rc.local file
to make sshd working.

Is there any other (“smart”) way
that makes sshd working on autostart ?

Yes,

You can do a waitfor command instead.

You need to know what OpenSSH needs to wait for tho (probably io-net). But if you remove the sleep 5 command the OpenSSH failure will hopefully tell you what it needs. Then you can wait for it with something like:

waitfor /dev/io-net

Tim

Are you using QNX 6.3?
Check this thread: openqnx.com/PNphpBB2-viewtopic-t4714-.html

Yes, I know that I can replace ‘sleep’ with ‘waitfor sth’,
but what I have to ‘waitfor’ ?

/in that article they waitfor /dev/random or /dev/urandom,
but it doesn’t work, and they didn’t solve this problem :frowning:

Oink,

Since Open SSH needs networking, my guess (never used open SSH) is you need to wait for io-net, netmanager, inetd etc.

I’d try:

waitfor /dev/io-net/io-net

Tim

if you are using dhcp then it’s possible ( never used open ssh either) that you must wait for the ip address to be assigned. I do not know of an easy way to wait for this.

You could write a script that does
sleep 5
sshd

And start that script from rc.local with a &. That way rc.local would not block for 5 seconds.

There is always “if_up” when it comes down to network.