Loading the rio module and firmware automatically – Perle Systems RIO 5500036-17 User Manual

Page 151

Advertising
background image

RIO Remote I/O System User Guide
Installing RIO under Linux

Page 151

Chapter 2 Installing hardware and software

Loading the RIO module and firmware automatically

1. To automatically configure the start up files to load the rio module and firmware, copy the

following script to the file

/etc/rc.d/init.d/rio.

2. Create symbolic links to the file in the relevant system start-up directories (

page 152

).

#!/bin/sh

#

# rio This shell script takes care of starting and stopping

# the RIO services.

#

# probe: true

# Source function library.

. /etc/rc.d/init.d/functions

#

# Exit if the rio utilities are not present

#

[ -f /usr/sbin/rioboot ] || exit 0

# See how we were called.

case "$1" in

start)

# Start driver and load module.

action "Starting RIO services: " /sbin/modprobe rio

echo -n "Starting RIO Firmware: "

#

# If we have a rio.cf file then just rioboot

#

if [ -f /etc/rio/rio.cf ]; then

daemon /usr/sbin/rioboot

else

daemon /usr/sbin/rioboot -f

fi

echo

;;

stop)

# Stop driver and unload module.

action "Shutting down RIO services: " /sbin/modprobe -r rio

echo

;;

status)

status rio

;;

restart|reload)

$0 stop

$0 start

;;

*)

echo "Usage: rio {start|stop|restart|reload|status}"

exit 1

esac

exit

Advertising