108
•
Step-by-Step Guide to your own Linux Application
Running the new Program
WAGO-I/O-SYSTEM
750
Linux Fieldbus Coupler
The Konqueror is another FTP client. Start the program and change to the
/targetfs
root directory. Start another instance of the program instance and
change to the target directory of the Linux fieldbus coupler using
ftp://<IP
address>/bin
. Now you can drag and drop files between the directories.
5.8 Running the new Program
The new program can be executed on the Linux coupler via the console, e.g.
via the terminal (see chapter 4.3).
> chmod +x /bin/newProg
In any directory you can run the command
> newProg
HelloWorld!
5.9 Automatic start of new Programs (inittab/startwago)
During the startup of the operating system, Linux starts the processes that can
be found in the
inittab
file during boot-up: in our system,
inittab
looks as
follows:
::sysinit:/etc/rc
::sysinit:/etc/startwago
::respawn:/etc/getty -L ttyS0 38400
In this file, the
startwago
file with the attribute
sysinit
is run, among others.
This means, the
startwago
script is started once during the system start-up.
The getty program which also supports the serial interface is started as a
respawn process. This process is thus restarted automatically if it is
terminated. The attributes are:
•
sysinit
Is started once during system start-up.
•
bootwait
Is started once after all sysinit processes.
•
respawn
Is restarted automatically if the process was terminated.
Please refer to the initab manpage for more attributes.