diff options
-rwxr-xr-x | src.etc/init.d/hostname | 19 | ||||
-rwxr-xr-x | src.etc/init.d/httpd | 26 | ||||
-rw-r--r-- | src.etc/init.d/klogd | 32 | ||||
-rwxr-xr-x | src.etc/init.d/mdev | 30 | ||||
-rwxr-xr-x | src.etc/init.d/networking | 37 | ||||
-rwxr-xr-x | src.etc/init.d/syslog | 34 | ||||
-rwxr-xr-x | src.etc/init.d/telnetd | 26 |
7 files changed, 150 insertions, 54 deletions
diff --git a/src.etc/init.d/hostname b/src.etc/init.d/hostname index aec1102..f64407d 100755 --- a/src.etc/init.d/hostname +++ b/src.etc/init.d/hostname @@ -1,13 +1,24 @@ #!/bin/sh +start() +{ + [ -f /etc/hostname ] && HOSTNAME="$(cat /etc/hostname)" + [ -z "${HOSTNAME}" ] && HOSTNAME="$(hostname)" + [ -z "${HOSTNAME}" ] && HOSTNAME='localhost' + + printf 'Setting hostname to %s... ' "${HOSTNAME}" + hostname "${HOSTNAME}" + printf 'done.\n' +} + case "${1}" in start) - printf 'Setting hostname... ' - [ -f /etc/hostname ] && hostname -F /etc/hostname || hostname none - printf 'done.\n' + start + ;; + stop) ;; *) - printf 'Usage: %s start\n' "${0}" >&2 + printf 'Usage: %s {start|stop}\n' "${0}" >&2 exit 1 ;; esac diff --git a/src.etc/init.d/httpd b/src.etc/init.d/httpd index 6a3045d..5f0106c 100755 --- a/src.etc/init.d/httpd +++ b/src.etc/init.d/httpd @@ -1,19 +1,29 @@ #!/bin/sh +start() +{ + printf 'Starting httpd...' + start-stop-daemon -S -q -n httpd -x httpd -- -h /var/www + printf 'done.\n' +} + +stop() +{ + printf 'Stopping httpd... ' + start-stop-daemon -K -q -n httpd + printf 'done.\n' +} + case "${1}" in start) - printf 'Starting httpd...' - start-stop-daemon -S -q -n httpd -x httpd -- -h /var/www - printf 'done.' + start ;; stop) - printf 'Stopping httpd... ' - start-stop-daemon -K -q -n httpd - printf 'done.' + stop ;; restart) - "${0}" stop - "${0}" start + stop + start ;; *) printf 'Usage: %s {start|stop|restart}\n' "${0}" diff --git a/src.etc/init.d/klogd b/src.etc/init.d/klogd new file mode 100644 index 0000000..dd9e10e --- /dev/null +++ b/src.etc/init.d/klogd @@ -0,0 +1,32 @@ +#!/bin/sh + +start() +{ + printf 'Starting klogd... ' + start-stop-daemon -S -q -n klogd -x klogd + printf 'done.\n' +} + +stop() +{ + printf 'Stopping klogd... ' + start-stop-daemon -K -q -n klogd + printf 'done.\n' +} + +case "${1}" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + *) + printf 'Usage: %s {start|stop|restart}\n' "${0}" + exit 1 + ;; +esac diff --git a/src.etc/init.d/mdev b/src.etc/init.d/mdev index 66070f8..aa5f618 100755 --- a/src.etc/init.d/mdev +++ b/src.etc/init.d/mdev @@ -1,19 +1,33 @@ #!/bin/sh +start() +{ + printf 'Enabling device hotplugging... ' + printf '/sbin/mdev\n' >/proc/sys/kernel/hotplug + mdev -s + printf 'done.\n' +} + +stop() +{ + printf 'Disabling device hotplugging... ' + printf '\n' >/proc/sys/kernel/hotplug + printf 'done.\n' +} + case "${1}" in start) - printf 'Enabling device hotplugging... ' - echo '/sbin/mdev' > /proc/sys/kernel/hotplug - mdev -s - printf 'done.\n' + start ;; stop) - printf 'Disabling device hotplugging... ' - echo '' > /proc/sys/kernel/hotplug - printf 'done.\n' + stop + ;; + restart) + stop + start ;; *) - printf 'Usage: %s {start|stop}\n' "${0}" >&2 + printf 'Usage: %s {start|stop|restart}\n' "${0}" >&2 exit 1 ;; esac diff --git a/src.etc/init.d/networking b/src.etc/init.d/networking index 12fb513..66967f9 100755 --- a/src.etc/init.d/networking +++ b/src.etc/init.d/networking @@ -1,22 +1,37 @@ #!/bin/sh +start() +{ + printf 'Configuring network interfaces... ' + ifdown -a >/dev/null 2>&1 + ifup -a + printf 'done.\n' +} + +stop() +{ + printf 'Deconfiguring network interfaces... ' + ifdown -a + printf 'done.\n' +} + +restart() +{ + printf 'Reconfiguring network interfaces... ' + ifdown -a + ifup -a + printf 'done.\n' +} + case "${1}" in start) - printf 'Configuring network interfaces... ' - ifdown -a > /dev/null 2>&1 - ifup -a - printf 'done.\n' + start ;; stop) - printf 'Deconfiguring network interfaces... ' - ifdown -a - printf 'done.\n' + stop ;; restart) - printf 'Reconfiguring network interfaces... ' - ifdown -a - ifup -a - printf 'done.\n' + restart ;; *) printf 'Usage: %s {start|stop|restart}\n' "${0}" >&2 diff --git a/src.etc/init.d/syslog b/src.etc/init.d/syslog index 082f9bf..3a3e980 100755 --- a/src.etc/init.d/syslog +++ b/src.etc/init.d/syslog @@ -2,27 +2,31 @@ SYSLOG_ROTATE_SIZE=65536 +start() +{ + printf 'Starting syslog... ' + start-stop-daemon -S -q -n syslogd -x syslogd -- \ + -s "${SYSLOG_ROTATE_SIZE}" + printf 'done.\n' +} + +stop() +{ + printf 'Stopping syslog... ' + start-stop-daemon -K -q -n syslogd + printf 'done.\n' +} + case "${1}" in start) - printf 'Starting syslog... ' - start-stop-daemon -S -q -n syslogd -x syslogd -- \ - -s "${SYSLOG_ROTATE_SIZE}" - printf 'done.' - printf 'Starting klogd... ' - start-stop-daemon -S -q -n klogd -x klogd - printf 'done.' + start ;; stop) - printf 'Stopping klogd... ' - start-stop-daemon -K -q -n klogd - printf 'done.' - printf 'Stopping syslog... ' - start-stop-daemon -K -q -n syslogd - printf 'done.' + stop ;; restart) - "${0}" stop - "${0}" start + stop + start ;; *) printf 'Usage: %s {start|stop|restart}\n' "${0}" diff --git a/src.etc/init.d/telnetd b/src.etc/init.d/telnetd index be9043b..b38a663 100755 --- a/src.etc/init.d/telnetd +++ b/src.etc/init.d/telnetd @@ -1,19 +1,29 @@ #!/bin/sh +start() +{ + printf 'Starting telnetd...' + start-stop-daemon -S -q -n telnetd -x telnetd + printf 'done.\n' +} + +stop() +{ + printf 'Stopping telnetd... ' + start-stop-daemon -K -q -n telnetd + printf 'done.\n' +} + case "${1}" in start) - printf 'Starting telnetd...' - start-stop-daemon -S -q -n telnetd -x telnetd - printf 'done.' + start ;; stop) - printf 'Stopping telnetd... ' - start-stop-daemon -K -q -n telnetd - printf 'done.' + stop ;; restart) - "${0}" stop - "${0}" start + stop + start ;; *) printf 'Usage: %s {start|stop|restart}\n' "${0}" |