summaryrefslogtreecommitdiff
path: root/init.d.BSD
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-11 12:13:46 +0000
committerRoy Marples <roy@marples.name>2008-01-11 12:13:46 +0000
commit3bf49a9bd19d5bbcf6976dd42b4f87f1b173e287 (patch)
tree8b4d6121f0d4b921566eeec2844c9bf76131de78 /init.d.BSD
parent1f4422c72f968405a0b8bf56d4f9c3b619b1b80d (diff)
downloadopenrc-3bf49a9bd19d5bbcf6976dd42b4f87f1b173e287.tar.gz
openrc-3bf49a9bd19d5bbcf6976dd42b4f87f1b173e287.tar.bz2
openrc-3bf49a9bd19d5bbcf6976dd42b4f87f1b173e287.tar.xz
Adopt a more C style for scripts and remove vim settings.
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 598ded3..f97609a 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 3156ca6..c491e7d 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 14f2f6d..bf9623f 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 2e9a0cd..dc3616b 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 6baaa9c..50efd9a 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 2740e38..a373d02 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 43c8e08..9c8d758 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 faa12ad..d4ff511 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 1ddb021..4f84056 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 4112c8f..704915f 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 209d6c5..d230f5a 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