Create startup/shutdown command named ethcrossover in /etc/init.d
(You may change the name but make sure you fix it's references in each of the following code sections)
Quote:
#!/bin/sh
# Startup for Ethernet Crossover Project
# Filename: ethcrossover
case "$1" in
'start')
avahi-autoipd eth0
;;
'stop')
# not sure what goes here to shut it down
# probably not necessary to do so unless you
# routinely change from networking to non-networking runlevel
# without shutting down your system
;;
*)
echo "Usage: $0 { start | stop }"
;;
esac
exit 0
|
Change the script to executable
Quote:
chmod 766 /eth/init.d/ethcrossover
|
For each runlevel you want it automatically started in make a link to the file
The file names are sorted alphabetically to determine what to do. Your file must come after
any scripts that need to be run before it, and before any that must follow it.
For example, if you were to run a procedure that requires the ethernet bridge to run called sendfile then sendfile would have to follow ethcrossover. The ethcrossover script needs to start after networking starts!
The scripts to be started or stopped are located in /etc/rc?.d where ? is the runlevel of the system. It would be safe to place this script in each runlevel except runlevel 6. Runlevel 6 shuts down everything and is called before a restart or shutdown of the system.
Execute these commands to automate the startup
Quote:
ln -s /eth/init.d/ethcrossover /eth/rc2.d/S99ethcrossover
ln -s /eth/init.d/ethcrossover /eth/rc3.d/S99ethcrossover
ln -s /eth/init.d/ethcrossover /eth/rc4.d/S99ethcrossover
ln -s /eth/init.d/ethcrossover /eth/rc5.d/S99ethcrossover
|
If you need to shut it down before system shutdown add the following
(forces shutdown before apache services shutdown)
Be sure to determine what needs to happen for successful shutdown and fix the script first.
Quote:
ln -s /eth/init.d/ethcrossover /eth/rc3.d/K08ethcrossover
ln -s /eth/init.d/ethcrossover /eth/rc3.d/K08ethcrossover
|
This should get you running automatically again.