Hello all.
I am using a script as part of the init.d start up to launch a daemon console app on Linux Raspberry Pi. When the script is run, the app will start but will not work because the code below errors.
// ****** This is where the error occurs
Dim n As NetworkInterface = System.GetNetworkInterface(0) //Get the NetworkInterface object for the selected item
If the app is started manually after boot, it runs fine without any errors.
This is the init.d scritp:
[code]#!/bin/sh
BEGIN INIT INFO
Provides: axcys-embedded-interface
Required-Start: $local_fs $syslog $time $network
Required-Stop: $local_fs $syslog $time $network
Default-Start: 2 3 4 5
Default-Stop: 0 1 6
Short-Description: Axcys Embedded Interface
Description: Axcys Embedded Interface
END INIT INFO
case $1 in
start)
start-stop-daemon --quiet --chuid pi --start --exec /home/pi/Public/axcys/gate/AxcysEmbeddedInterface
;;
stop)
start-stop-daemon --quiet --chuid pi --stop --exec /home/pi/Public/axcys/gate/AxcysEmbeddedInterface
;;
restart|force-reload)
$0 stop && $0 start
;;
status)
ps u -U pi
;;
*)
echo “Usage: sudo service axcys-embedded-interface {start|stop|restart|force-reload|status}”
;;
esac[/code]
Note that there are 2 other scripts virually identical to this one, for two other apps I have that I want started and controlled. They do not have the same problem. I am thinking it has to do with the startup order but cannot really tell. The required start objects are the same for all three. But apparently the $network one is missing something.
Can anyone suggest what other objects may not be ready, that have to do with networking, so I can add them to the script?
Thanks,
Tim