Listing 1. Example init Script
#!/bin/sh
# avoid typing full pathnames
export PATH=/usr/bin:/bin:/sbin:/usr/sbin
# remount root read-write, and mount all
mount -n -o remount,rw /
mount -a
swapon -a
# system log
syslogd
klogd
# start your lan
modprobe eth0 2> /dev/null
ifconfig eth0 192.168.0.1
route add 192.168.0.0 eth0
route add default gw 192.168.0.254
# start lan services
inetd
sendmail -bd -q30m
# Anything else: crond, named, ...
# And run one getty with a sane path
export PATH=/usr/bin:/bin
/sbin/mingetty tty1
Copyright © 1994 - 2018 Linux Journal. All rights reserved.