Next
Previous
Contents
I use an old Linux RedHat 4.1 distribution. The location of the
files can be different on other GNU/Linux distributions but the
philosophy is the same (The Unix System V convention).
Create the file /etc/rc.d/init.d/plip with this content:
#!/bin/sh
##############################
# file /etc/rc.d/init.d/plip #
##############################
# See how we were called.
case "$1" in
start)
# Start daemons.
/bin/echo "Starting plip interface: "
/bin/echo "Doing /sbin/ifconfig plip0 source pointopoint target netmask 255.255.255.255 up"
/sbin/ifconfig plip0 source pointopoint target netmask 255.255.255.255 up
/bin/echo "Doing /bin/ping -q -c 4 target"
/bin/ping -q -c 4 target
/bin/echo "Starting plip interface: done"
;;
stop)
# Stop daemons.
/bin/echo "Shutting down plip interface:"
/bin/echo "Doing /sbin/ifconfig plip0 source pointopoint target netmask 255.255.255.255 down"
/sbin/ifconfig plip0 source pointopoint target netmask 255.255.255.255 down
/bin/echo "Doing /sbin/modprobe -r plip "
/sbin/modprobe -r plip
/bin/echo "Shutting down plip interface: done"
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
# === End of File ===
Only the ifconfig lines are strictly necessary. Perhaps you will
need to add some modprobe commands if you don't use
kerneld or the kmod feature of new kernels 2.2.x
Create the symbolic links in the rc*.d directories:
$ cd /etc/rc.d/rc0.d/
$ ln -s ../init.d/plip K97plip
$ cd /etc/rc.d/rc1.d/
$ ln -s ../init.d/plip K92plip
$ cd /etc/rc.d/rc3.d/
$ ln -s ../init.d/plip S11plip
$ cd /etc/rc.d/rc5.d/
$ ln -s ../init.d/plip S11plip
You can choose other numbers. Make sure that the two-digit number
after 'K' is greater than the number of every other file that stops
a service depending on plip.
Make sure that the two-digit number after 'S' is less than the
number of every other file that start a service depending on plip:
nfs, nis, ftp, http etc.
Update the /etc/conf.modules file, choosing the correct
IRQ number (7 is mine, yours may be different):
# /etc/conf.modules
...
alias parport_lowlevel parport_pc
post-install parport_pc echo 7 > /proc/parport/0/irq
...
Test the plip shell:
$ /etc/rc.d/init.d/plip
Usage: /etc/rc.d/init.d/plip {start|stop}
$ /etc/rc.d/init.d/plip stop
Shutting down plip interface:
Doing /sbin/ifconfig plip0 source pointopoint target netmask 255.255.255.255 down
Doing /sbin/modprobe -r plip
Shutting down plip interface: done
$ /etc/rc.d/init.d/plip start
Starting plip interface:
Doing /sbin/ifconfig plip0 source pointopoint target netmask 255.255.255.255 up
Doing /bin/ping -q -c 4 target
PING target (192.168.0.1): 56 data bytes
--- target ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 4.4/8.3/14.0 ms
Starting plip interface: done
Updating the start scripts is a good occasion to reboot a Unix
system, to check the modifications. Do it:
$ init 6 # or "shutdown -r now" or "reboot"
Update the file /etc/init.d/network :
#! /bin/sh
#######################
# /etc/init.d/network #
#######################
ifconfig lo 127.0.0.1
route add -net 127.0.0.0
ifconfig plip1 192.168.0.1 pointopoint 192.168.0.2 netmask 255.255.255.255 up
route add -host 192.168.0.2 dev plip1
That's all because the parport features are directly in the kernel.
Updating the start scripts is a good occasion to reboot a Unix
system, to check the modifications. Do it:
$ init 6
Next
Previous
Contents
|