summaryrefslogtreecommitdiffstats
path: root/core/busybox-initscripts
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-06-10 20:05:21 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-06-10 20:05:21 +0000
commit3fe927c19c9a49ee5fec05135d9bcf726d05c2cc (patch)
tree468ef2474fcc9c2bf78fe1f05c0b1003819dcc3a /core/busybox-initscripts
parentccdfcb03aa148b0f479fe14e6e654d34696b208f (diff)
downloadaports-3fe927c19c9a49ee5fec05135d9bcf726d05c2cc.tar.bz2
aports-3fe927c19c9a49ee5fec05135d9bcf726d05c2cc.tar.xz
core/busybox-initscripts: new aport
We move many scripts from alpine-baselayout to this package.
Diffstat (limited to 'core/busybox-initscripts')
-rw-r--r--core/busybox-initscripts/APKBUILD42
-rw-r--r--core/busybox-initscripts/cron.confd3
-rw-r--r--core/busybox-initscripts/cron.initd14
-rw-r--r--core/busybox-initscripts/dnsd.initd17
-rw-r--r--core/busybox-initscripts/httpd.initd20
-rw-r--r--core/busybox-initscripts/inetd.initd18
-rw-r--r--core/busybox-initscripts/mdev-mount.initd56
-rw-r--r--core/busybox-initscripts/mdev.initd33
-rw-r--r--core/busybox-initscripts/rdate.confd2
-rw-r--r--core/busybox-initscripts/rdate.initd12
-rw-r--r--core/busybox-initscripts/syslog.confd2
-rw-r--r--core/busybox-initscripts/syslog.initd20
-rw-r--r--core/busybox-initscripts/watchdog.confd3
-rw-r--r--core/busybox-initscripts/watchdog.initd25
14 files changed, 267 insertions, 0 deletions
diff --git a/core/busybox-initscripts/APKBUILD b/core/busybox-initscripts/APKBUILD
new file mode 100644
index 000000000..2d8557ba4
--- /dev/null
+++ b/core/busybox-initscripts/APKBUILD
@@ -0,0 +1,42 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=busybox-initscripts
+pkgver=2.0
+pkgrel=0
+pkgdesc="Init scripts for busybox daemons"
+url="http://git.alpinelinux.org/cgit/aports/tree/core/busybox-initscripts"
+license="GPL-2"
+depends="busybox"
+makedepends=
+install=
+subpackages=
+source="cron.initd dnsd.initd httpd.initd inetd.initd mdev-mount.initd
+ mdev.initd rdate.initd syslog.initd watchdog.initd
+ cron.confd rdate.confd syslog.confd watchdog.confd"
+
+build() {
+ local i
+ cd "$srcdir"
+
+ mkdir -p "$pkgdir"/etc/conf.d "$pkgdir"/etc/init.d
+ for i in *.initd; do
+ install -m755 "$srcdir"/$i "$pkgdir"/etc/init.d/${i%.*} || return 1
+ done
+ for i in *.confd; do
+ install -m644 "$srcdir"/$i "$pkgdir"/etc/conf.d/${i%.*} || return 1
+ done
+}
+
+md5sums="45b4ca78fad54f56018b9a2e9358dc68 cron.initd
+3af526f4de1a607f7932a15f7c8e8eb1 dnsd.initd
+f7daf05f9984aa398fdbd3fe02e82678 httpd.initd
+dad8e381142dfb42483de324aff4cf28 inetd.initd
+823308d5691bd6ece04a040b23925d40 mdev-mount.initd
+ef3e93fe17964dd600364b1340654b5b mdev.initd
+533288e7df1fdfc029b1048b8e6c770f rdate.initd
+b1bd58e5580d6d2bd88bd6cfb0ae8876 syslog.initd
+254186e513ff9fb9ede6a2e92257b247 watchdog.initd
+8ddb8d040c9c7a32c63039a2c80ff496 cron.confd
+22adbf155ffc4595206ded6daad07812 rdate.confd
+69d83e8af870c419847b81bee1ccd2d9 syslog.confd
+0bb55dde32f5e119111fa4938daaef3d watchdog.confd"
diff --git a/core/busybox-initscripts/cron.confd b/core/busybox-initscripts/cron.confd
new file mode 100644
index 000000000..2f2eb7bb7
--- /dev/null
+++ b/core/busybox-initscripts/cron.confd
@@ -0,0 +1,3 @@
+# enter the cron options
+CRON_OPTS="-c /etc/crontabs"
+
diff --git a/core/busybox-initscripts/cron.initd b/core/busybox-initscripts/cron.initd
new file mode 100644
index 000000000..ffae38b80
--- /dev/null
+++ b/core/busybox-initscripts/cron.initd
@@ -0,0 +1,14 @@
+#!/sbin/runscript
+
+start() {
+ ebegin "Starting busybox cron"
+ start-stop-daemon --start --exec /usr/sbin/crond -- $CRON_OPTS
+ eend $?
+}
+
+stop () {
+ ebegin "Stopping busybox cron"
+ start-stop-daemon --stop --exec crond
+ eend $?
+}
+
diff --git a/core/busybox-initscripts/dnsd.initd b/core/busybox-initscripts/dnsd.initd
new file mode 100644
index 000000000..8d625f9e5
--- /dev/null
+++ b/core/busybox-initscripts/dnsd.initd
@@ -0,0 +1,17 @@
+#!/sbin/runscript
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting dnsd"
+ start-stop-daemon --start --exec /usr/sbin/dnsd -- -d $DNSD_OPTS
+ eend $?
+}
+
+stop () {
+ ebegin "Stopping dnsd"
+ start-stop-daemon --stop --exec /usr/sbin/dnsd
+ eend $?
+}
diff --git a/core/busybox-initscripts/httpd.initd b/core/busybox-initscripts/httpd.initd
new file mode 100644
index 000000000..7f114e650
--- /dev/null
+++ b/core/busybox-initscripts/httpd.initd
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+
+DAEMON=/usr/sbin/httpd
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting busybox httpd"
+ start-stop-daemon --start --exec $DAEMON -- $HTTPD_OPTS
+ eend $?
+}
+
+stop () {
+ ebegin "Stopping busybox httpd"
+ start-stop-daemon --stop --exec $DAEMON
+ eend $?
+}
+
diff --git a/core/busybox-initscripts/inetd.initd b/core/busybox-initscripts/inetd.initd
new file mode 100644
index 000000000..b5cf9d7d3
--- /dev/null
+++ b/core/busybox-initscripts/inetd.initd
@@ -0,0 +1,18 @@
+#!/sbin/runscript
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting busybox inetd"
+ start-stop-daemon --start --exec /usr/sbin/inetd -- $INETD_OPTS
+ eend $?
+}
+
+stop () {
+ ebegin "Stopping busybox inetd"
+ start-stop-daemon --stop --exec /usr/sbin/inetd
+ eend $?
+}
+
diff --git a/core/busybox-initscripts/mdev-mount.initd b/core/busybox-initscripts/mdev-mount.initd
new file mode 100644
index 000000000..48964451f
--- /dev/null
+++ b/core/busybox-initscripts/mdev-mount.initd
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Largely based on Gentoo's udev-mount
+#
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
+
+description="Mount tmpfs on /dev"
+
+mount_dev_directory()
+{
+ # No options are processed here as they should all be in /etc/fstab
+ ebegin "Mounting /dev"
+ mkdir -p /dev
+ if fstabinfo --quiet /dev; then
+ mount -n /dev
+ else
+ # Some devices require exec, Bug #92921
+ mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" mdev /dev
+ fi
+ eend $?
+}
+
+seed_dev()
+{
+ # Seed /dev with some things that we know we need
+
+ # creating /dev/console, /dev/tty and /dev/tty1 to be able to write
+ # to $CONSOLE with/without bootsplash before udevd creates it
+ [ -c /dev/console ] || mknod -m 600 /dev/console c 5 1
+ [ -c /dev/tty1 ] || mknod -m 620 /dev/tty1 c 4 1
+ [ -c /dev/tty ] || mknod -m 666 /dev/tty c 5 0
+
+ # udevd will dup its stdin/stdout/stderr to /dev/null
+ # and we do not want a file which gets buffered in ram
+ [ -c /dev/null ] || mknod -m 666 /dev/null c 1 3
+
+ # so udev can add its start-message to dmesg
+ [ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
+
+ # Not provided by sysfs but needed
+ ln -snf /proc/self/fd /dev/fd
+ ln -snf fd/0 /dev/stdin
+ ln -snf fd/1 /dev/stdout
+ ln -snf fd/2 /dev/stderr
+ [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
+
+ # Create problematic directories
+ mkdir -p /dev/pts /dev/shm
+ return 0
+}
+
+start() {
+ mount_dev_directory || return 1
+ seed_dev
+}
diff --git a/core/busybox-initscripts/mdev.initd b/core/busybox-initscripts/mdev.initd
new file mode 100644
index 000000000..e9309c700
--- /dev/null
+++ b/core/busybox-initscripts/mdev.initd
@@ -0,0 +1,33 @@
+#!/sbin/runscript
+
+depend() {
+ provide dev
+ need sysfs mdev-mount
+ before checkfs fsck
+ keyword novserver
+}
+
+start() {
+ # check if udev is specified on cmd line
+ if get_bootparam "udev"; then
+ ewarn "Skipping mdev as udev requested in kernel cmdline"
+ return 0
+ fi
+
+ ebegin "Starting busybox mdev"
+ mkdir -p /dev
+
+ # use mdev for hotplug
+ echo "/sbin/mdev" > /proc/sys/kernel/hotplug
+
+ # create devices
+ mdev -s
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping busybox mdev"
+ echo "" > /proc/sys/kernel/hotplug
+ eend
+}
+
diff --git a/core/busybox-initscripts/rdate.confd b/core/busybox-initscripts/rdate.confd
new file mode 100644
index 000000000..93c678616
--- /dev/null
+++ b/core/busybox-initscripts/rdate.confd
@@ -0,0 +1,2 @@
+# Set the ntp server here
+NTP_HOST=pool.net.org
diff --git a/core/busybox-initscripts/rdate.initd b/core/busybox-initscripts/rdate.initd
new file mode 100644
index 000000000..3e6c6582c
--- /dev/null
+++ b/core/busybox-initscripts/rdate.initd
@@ -0,0 +1,12 @@
+#!/sbin/runscript
+
+start() {
+ if [ -z "$NTP_HOST" ] ; then
+ eerror "Please set NTP_HOST in /etc/conf.d/rdate"
+ return 1
+ fi
+ ebegin "Running busybox rdate"
+ rdate "$NTP_HOST"
+ eend $?
+}
+
diff --git a/core/busybox-initscripts/syslog.confd b/core/busybox-initscripts/syslog.confd
new file mode 100644
index 000000000..14c39c769
--- /dev/null
+++ b/core/busybox-initscripts/syslog.confd
@@ -0,0 +1,2 @@
+SYSLOGD_OPTS=""
+KLOGD_OPTS=""
diff --git a/core/busybox-initscripts/syslog.initd b/core/busybox-initscripts/syslog.initd
new file mode 100644
index 000000000..63ef5fc69
--- /dev/null
+++ b/core/busybox-initscripts/syslog.initd
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+
+depend() {
+ provide logger
+}
+
+start() {
+ ebegin "Starting busybox system logging"
+ start-stop-daemon --start --exec /usr/sbin/klogd -- ${KLOGD_OPTS}
+ start-stop-daemon --start --exec /usr/sbin/syslogd -- ${SYSLOGD_OPTS}
+ eend $?
+}
+
+stop () {
+ ebegin "Stopping busybox system logging"
+ start-stop-daemon --stop --exec /usr/sbin/klogd
+ start-stop-daemon --stop --exec /usr/sbin/syslogd
+ eend $?
+}
+
diff --git a/core/busybox-initscripts/watchdog.confd b/core/busybox-initscripts/watchdog.confd
new file mode 100644
index 000000000..5cfd2c2cc
--- /dev/null
+++ b/core/busybox-initscripts/watchdog.confd
@@ -0,0 +1,3 @@
+#WATCHDOG_OPTS="-t 30"
+WATCHDOG_DEV=""
+
diff --git a/core/busybox-initscripts/watchdog.initd b/core/busybox-initscripts/watchdog.initd
new file mode 100644
index 000000000..7363bb755
--- /dev/null
+++ b/core/busybox-initscripts/watchdog.initd
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+
+depend() {
+ need dev
+ after hwdrivers
+}
+
+start() {
+ if ! [ -n "$WATCHDOG_DEV" ]; then
+ eerror "WATCHDOG_DEV is not set"
+ return 1
+ fi
+
+ ebegin "Starting busybox watchdog"
+ start-stop-daemon --start --exec /sbin/watchdog \
+ -- $WATCHDOG_OPTS $WATCHDOG_DEV
+ eend $?
+}
+
+stop () {
+ ebegin "Stopping busybox watchdog"
+ start-stop-daemon --stop --exec /sbin/watchdog
+ eend $?
+}
+