aboutsummaryrefslogtreecommitdiff
path: root/init.d.BSD
diff options
context:
space:
mode:
Diffstat (limited to 'init.d.BSD')
-rw-r--r--init.d.BSD/hostid12
-rw-r--r--init.d.BSD/mixer15
-rw-r--r--init.d.BSD/moused8
-rw-r--r--init.d.BSD/newsyslog6
-rw-r--r--init.d.BSD/powerd6
-rw-r--r--init.d.BSD/rarpd3
-rw-r--r--init.d.BSD/rc-enabled9
-rw-r--r--init.d.BSD/rpcbind6
-rwxr-xr-xinit.d.BSD/savecore6
-rw-r--r--init.d.BSD/sysctl6
-rw-r--r--init.d.BSD/syslogd3
11 files changed, 52 insertions, 28 deletions
diff --git a/init.d.BSD/hostid b/init.d.BSD/hostid
index 598ded31..f97609a0 100644
--- a/init.d.BSD/hostid
+++ b/init.d.BSD/hostid
@@ -5,12 +5,14 @@
extra_commands="reset"
hostid_file=${hostid_file:-/etc/hostid}
-depend() {
+depend()
+{
need checkroot
before devd net
}
-_set() {
+_set()
+{
local id=0
if [ -n "$1" ]; then
@@ -33,7 +35,8 @@ _set() {
# First we check to see if there is a system UUID
# If so then we use that and erase the hostid file,
# otherwise we generate a random UUID.
-reset() {
+reset()
+{
local uuid=$(kenv smbios.system.uuid 2>/dev/null)
local x="[0-9a-f]"
local y="${x}${x}${x}${x}"
@@ -68,6 +71,7 @@ start()
fi
}
-stop() {
+stop()
+{
_set
}
diff --git a/init.d.BSD/mixer b/init.d.BSD/mixer
index 3156ca64..c491e7db 100644
--- a/init.d.BSD/mixer
+++ b/init.d.BSD/mixer
@@ -4,29 +4,34 @@
extra_commands="restore"
-depend() {
+depend()
+{
need localmount
}
-restore() {
+restore()
+{
local mixer= retval=0
ebegin "Restoring mixer settings"
eindent
for mixer in /dev/mixer*; do
if [ -r "/var/db/${mixer#/dev/}-state" ]; then
vebegin "${mixer}"
- mixer -f "${mixer}" $(cat "/var/db/${mixer#/dev/}-state") >/dev/null
+ mixer -f "${mixer}" \
+ $(cat "/var/db/${mixer#/dev/}-state") >/dev/null
veend $?
: $((retval += $?))
fi
done
}
-start() {
+start()
+{
restore
}
-stop() {
+stop()
+{
local mixer= retval=0
ebegin "Saving mixer settings"
eindent
diff --git a/init.d.BSD/moused b/init.d.BSD/moused
index 14f2f6d1..bf9623fe 100644
--- a/init.d.BSD/moused
+++ b/init.d.BSD/moused
@@ -12,12 +12,14 @@ fi
name="Console Mouse Daemon"
[ -n "${moused_device}" ] && name="${name} (${moused_device})"
-depend() {
+depend()
+{
need localmount
after bootmisc
}
-start() {
+start()
+{
ebegin "Starting ${name}"
if [ -z "${moused_device}" ]; then
@@ -57,5 +59,3 @@ start() {
eend ${retval} "Failed to start moused"
}
-
-# vim: set ts=4 :
diff --git a/init.d.BSD/newsyslog b/init.d.BSD/newsyslog
index 2e9a0cdf..dc3616ba 100644
--- a/init.d.BSD/newsyslog
+++ b/init.d.BSD/newsyslog
@@ -4,11 +4,13 @@
required_files="/etc/newsyslog.conf"
-depend() {
+depend()
+{
need localmount
}
-start() {
+start()
+{
ebegin "Creating and/or trimming log files"
newsyslog ${newsyslog_args}
eend $?
diff --git a/init.d.BSD/powerd b/init.d.BSD/powerd
index 6baaa9cc..50efd9a3 100644
--- a/init.d.BSD/powerd
+++ b/init.d.BSD/powerd
@@ -7,13 +7,15 @@ command_args=${powerd_args}
pidfile=/var/run/powerd.pid
name="Power Control Daemon"
-depend() {
+depend()
+{
need localmount
use logger
after bootmisc
}
-start_pre() {
+start_pre()
+{
if [ -n "${powerd_battery_mode}" ]; then
command_args="${command_args} -b ${powerd_battery_mode}"
fi
diff --git a/init.d.BSD/rarpd b/init.d.BSD/rarpd
index 2740e382..a373d025 100644
--- a/init.d.BSD/rarpd
+++ b/init.d.BSD/rarpd
@@ -15,7 +15,8 @@ else
fi
command_background="YES"
-depend() {
+depend()
+{
need localmount
after bootmisc
diff --git a/init.d.BSD/rc-enabled b/init.d.BSD/rc-enabled
index 43c8e08e..9c8d7588 100644
--- a/init.d.BSD/rc-enabled
+++ b/init.d.BSD/rc-enabled
@@ -2,13 +2,15 @@
# Copyright 2007-2008 Roy Marples
# All rights reserved
-depend() {
+depend()
+{
need localmount net
after *
before local
}
-start() {
+start()
+{
ebegin "Starting local rc services"
local svc= enabled= retval=0 service=
for svc in $(rcorder /etc/rc.d/* /usr/local/etc/rc.d/* 2>/dev/null); do
@@ -37,7 +39,8 @@ start() {
return 0
}
-stop() {
+stop()
+{
ebegin "Stopping local rc services"
local svc= retval=0
for svc in $(rcorder $(service_get_value started) 2>/dev/null | sort -r); do
diff --git a/init.d.BSD/rpcbind b/init.d.BSD/rpcbind
index faa12adf..d4ff5114 100644
--- a/init.d.BSD/rpcbind
+++ b/init.d.BSD/rpcbind
@@ -6,14 +6,16 @@ command=/usr/sbin/rpcbind
command_args=${rpcbind_args}
name="RPC program number mapper"
-depend() {
+depend()
+{
provide rpc
need localmount
use net logger dns
before inetd xinetd ntpd ntp-client
}
-stop_post() {
+stop_post()
+{
# rpcbind returns too fast, so sleep for a second
sleep 1
}
diff --git a/init.d.BSD/savecore b/init.d.BSD/savecore
index 1ddb0216..4f840564 100755
--- a/init.d.BSD/savecore
+++ b/init.d.BSD/savecore
@@ -4,12 +4,14 @@
description="Saves a kernel dump."
-depend() {
+depend()
+{
need checkfs
before swap
}
-start() {
+start()
+{
local dump_dir=${dump_dir:-/var/crash}
if ! [ -d "${dump_dir}" ]; then
mkdir -p "${dump_dir}"
diff --git a/init.d.BSD/sysctl b/init.d.BSD/sysctl
index 4112c8f7..704915f0 100644
--- a/init.d.BSD/sysctl
+++ b/init.d.BSD/sysctl
@@ -2,12 +2,14 @@
# Copyright 2007-2008 Roy Marples
# All rights reserved
-depend() {
+depend()
+{
use hostname
before bootmisc logger
}
-start() {
+start()
+{
[ -e /etc/sysctl.conf ] || return 0
ebegin "Configuring kernel parameters"
diff --git a/init.d.BSD/syslogd b/init.d.BSD/syslogd
index 209d6c55..d230f5ad 100644
--- a/init.d.BSD/syslogd
+++ b/init.d.BSD/syslogd
@@ -7,7 +7,8 @@ command_args=${syslogd_args}
pidfile=/var/run/syslog.pid
name="System Logger Daemon"
-depend() {
+depend()
+{
provide logger
use net
need localmount