Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master imp-data-simpleinit by Arjan Bouter (738a645ddc622e68727cdb26a165dc061349f804)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Arjan Bouter <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master imp-data-simpleinit by Arjan Bouter (738a645ddc622e68727cdb26a165dc061349f804)
  • Date: Thu, 16 Jun 2011 01:49:26 -0500

GIT changes to master imp-data-simpleinit by Arjan Bouter
<abouter AT sourcemage.org>:

scripts/acct/accounting | 19
scripts/acpi-support/acpi-support | 2
scripts/acpi-support/vbesave | 2
scripts/acpid/acpid | 5
scripts/acpid/acpid.conf | 3
scripts/alsa-lib/alsa | 2
scripts/anubis/anubis | 2
scripts/apache1/apache | 54 ++
scripts/apache22/apache | 4
scripts/apmd/apmd | 2
scripts/asterisk/asterisk | 18
scripts/audit/auditd | 7
scripts/avahi/avahi-daemon | 2
scripts/bluez/bluetooth | 4
scripts/cachefilesd/cachefilesd | 8
scripts/canna/canna | 2
scripts/clamfs/clamfs | 7
scripts/clamsmtp/clamsmtpd | 9
scripts/connman/connman | 8
scripts/courier-authlib/courier_authlib | 25 +
scripts/courier-imap/courier-imap | 2
scripts/courier-imap/courier-imap-ssl | 2
scripts/courier-imap/courier-pop | 2
scripts/courier-imap/courier-pop-ssl | 2
scripts/courier/courier | 26 +
scripts/courier/courier_esmtp | 25 +
scripts/courier/courier_esmtp_ssl | 25 +
scripts/courier/courier_imap | 25 +
scripts/courier/courier_imap_ssl | 25 +
scripts/courier/courier_pop | 25 +
scripts/courier/courier_pop_ssl | 25 +
scripts/cpqarrayd/cpqarray | 2
scripts/cronie/crond | 10
scripts/cronie/cronie.conf | 3
scripts/dbus/smgl-messagebus | 31 -
scripts/dcron/crond | 3
scripts/dcron/dcron.conf | 3
scripts/dhcdbd/dhcdbd | 2
scripts/dovecot/smgl-dovecot | 1
scripts/drbd/drbd | 171 +++++++
scripts/dspam/dspam | 22
scripts/elsa/elsa | 9
scripts/exim/exim | 10
scripts/ferm/ferm | 2
scripts/firebird/firebird2 | 6
scripts/firebird25/firebird2 | 45 +
scripts/flow-tools/flow-capture | 11
scripts/flow-tools/flow-capture.conf | 3
scripts/flowd/flowd | 9
scripts/freewnn/jserver | 2
scripts/fuse/fuse | 48 ++
scripts/gdm/gdm.sh | 2
scripts/gkrellm2/gkrellmd | 2
scripts/glibc/nscd | 32 +
scripts/glibc/nscd.conf | 5
scripts/gnump3d/gnump3d | 2
scripts/halevt/halevt | 7
scripts/hibernate-script/hibernate-cleanup | 2
scripts/hotplug/hotplug | 2
scripts/icecream/icecream | 8
scripts/icecream/icecream-scheduler | 8
scripts/ifupdown/network | 1
scripts/init.d/devices | 84 +++
scripts/init.d/devices.conf | 2
scripts/init.d/mountall.sh | 9
scripts/init.d/mountroot.sh | 4
scripts/inoclam/inoclam | 8
scripts/iplog/iplog | 2
scripts/iplog/iplog.sh | 2
scripts/ircd-ratbox/ratbox | 8
scripts/kbd/keymap.sh | 30 -
scripts/kdebase-workspace4/kdm4 | 2
scripts/kdebase/kdm | 2
scripts/knock/knock.conf | 3
scripts/knock/knockd | 10
scripts/laptop-mode-tools/laptop-mode | 2
scripts/libvirt/libvirtd | 4
scripts/libvirt/libvirtd.conf | 2
scripts/lshwd/lshwd | 2
scripts/lxdm/lxdm | 8
scripts/maradns/deadwood | 24 +
scripts/mariadb/mariadb | 186 +++++++
scripts/mcelog/mcelog | 9
scripts/mdadm/mdadm-monitor | 8
scripts/mediatomb/mediatomb | 12
scripts/mediatomb/mediatomb.conf | 5
scripts/memcached/memcached | 10
scripts/memcached/memcached.conf | 3
scripts/micron/micron | 2
scripts/mongodb/mongodb | 21
scripts/mongodb/mongodb.conf | 3
scripts/mpd/mpd | 5
scripts/mpd/mpd.conf | 470
+++++++++++++-------
scripts/mysql/mysql | 2
scripts/nas/nasd | 6
scripts/nessus-core/smgl-nessusd | 2
scripts/net-snmp/snmpd | 11
scripts/net-snmp/snmpd.conf | 3
scripts/network-manager/NetworkManager | 9
scripts/nfs-utils/nfs | 152 +++++-
scripts/nfs-utils/nfsidmap | 44 +
scripts/nfs-utils/nfslock | 2
scripts/nginx/nginx | 20
scripts/niced/niced | 15
scripts/niced/niced.conf | 4
scripts/nsd/nsd | 4
scripts/nss-pam-ldapd/nslcd | 8
scripts/ntop/ntop | 9
scripts/ntop/ntop.conf | 12
scripts/nylon/nylon | 9
scripts/nylon/nylon.conf | 34 +
scripts/ocfs2-tools/ocfs2 | 96 ++++
scripts/ocfs2-tools/ocfs2.conf | 3
scripts/openldap/slapd | 2
scripts/openmosix-tools/openmosix | 2
scripts/openmosixview/mosstatd.sh | 2
scripts/openmosixview/openmosixcollector | 2
scripts/openssh/sshd | 2
scripts/openwbem/owcimomd | 7
scripts/pglogd/pglogd.sh | 2
scripts/pikt/piktsvc | 2
scripts/pks/pks | 2
scripts/popfile/popfile | 2
scripts/postgresql/postgresql | 8
scripts/postgresql/postgresql.conf | 2
scripts/postgrey/postgrey | 11
scripts/postgrey/postgrey.conf | 3
scripts/preload/preload | 7
scripts/privoxy/junkbuster | 5
scripts/prosody/smgl-prosody | 30 +
scripts/queue/queue | 2
scripts/ratbox-services/rserv | 8
scripts/rpcbind/rpcbind | 7
scripts/rsyslog/rsyslog | 6
scripts/rsyslog/rsyslog.conf | 6
scripts/samba/samba | 2
scripts/samba/samba.conf | 8
scripts/scanlogd/scanlogd | 2
scripts/scim/scim | 2
scripts/shorewall6-lite/shorewall6 | 47 ++
scripts/shorewall6-lite/shorewall6.conf | 5
scripts/slim/slim | 2
scripts/smartmontools/smartd | 2
scripts/softflowd/softflowd | 11
scripts/softflowd/softflowd.conf | 3
scripts/splashy/splashy | 2
scripts/splashy/splashy1 | 2
scripts/splashy/splashy2 | 2
scripts/splashy/splashy3 | 2
scripts/splashy/splashy4 | 2
scripts/splashy/splashy5 | 2
scripts/subversion/subversion | 21
scripts/subversion/subversion.conf | 20
scripts/system-tools-backends/system-tools-backends | 2
scripts/tinyproxy/tinyproxy | 9
scripts/tor/tor | 11
scripts/tor/tor.conf | 3
scripts/udev/copy-persistent-rules | 2
scripts/unbound/unbound | 7
scripts/watchdog/watchdog | 5
scripts/webcleaner/webcleaner | 2
scripts/webmin/webmin | 2
scripts/wicd/wicd | 43 +
scripts/wifi-radar/wifi-radar | 2
scripts/zfs-fuse/zfs-fuse | 8
165 files changed, 2217 insertions(+), 356 deletions(-)

New commits:
commit 738a645ddc622e68727cdb26a165dc061349f804
Author: Arjan Bouter <abouter AT sourcemage.org>
Commit: Arjan Bouter <abouter AT sourcemage.org>

imp-data-simpleinit: automated sync with grimoire init scripts

diff --git a/scripts/acct/accounting b/scripts/acct/accounting
new file mode 100755
index 0000000..f10a87f
--- /dev/null
+++ b/scripts/acct/accounting
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+PROGRAM=/usr/sbin/accton
+RUNLEVEL=3
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ touch /var/account/pacct &&
+ $PROGRAM on
+ evaluate_retval
+}
+
+stop()
+{
+ $PROGRAM off
+ evaluate_retval
+}
diff --git a/scripts/acpi-support/acpi-support
b/scripts/acpi-support/acpi-support
index dc0686c..9d9a198 100755
--- a/scripts/acpi-support/acpi-support
+++ b/scripts/acpi-support/acpi-support
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# INIT script to check whether we're on batteries, and so start with laptop
# mode etc enabled.

diff --git a/scripts/acpi-support/vbesave b/scripts/acpi-support/vbesave
index 8da543f..1567e9e 100755
--- a/scripts/acpi-support/vbesave
+++ b/scripts/acpi-support/vbesave
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

### BEGIN INIT INFO
# Provides: vbesave
diff --git a/scripts/acpid/acpid b/scripts/acpid/acpid
index 2fb3e14..6b03ea7 100644
--- a/scripts/acpid/acpid
+++ b/scripts/acpid/acpid
@@ -1,6 +1,9 @@
-#!/bin/sh
+#!/bin/bash
+
+. /etc/sysconfig/acpid

PROGRAM=/usr/sbin/acpid
+ARGS="$ACPID_ARGS"
RUNLEVEL=S
NEEDS="+local_fs"

diff --git a/scripts/acpid/acpid.conf b/scripts/acpid/acpid.conf
new file mode 100644
index 0000000..b42508d
--- /dev/null
+++ b/scripts/acpid/acpid.conf
@@ -0,0 +1,3 @@
+# For the arguments and description see acpid(8)
+
+ACPID_ARGS="-l"
diff --git a/scripts/alsa-lib/alsa b/scripts/alsa-lib/alsa
index 7d2770a..bc1e841 100755
--- a/scripts/alsa-lib/alsa
+++ b/scripts/alsa-lib/alsa
@@ -20,7 +20,7 @@ probe_module() {
# $1 -- inclusion pattern
# $2 -- exclusion pattern (optional)
remove_module_pattern() {
- local __LIST=$(/sbin/lsmod | grep -E "$1")
+ local __LIST=$(/bin/lsmod | grep -E "$1")
[[ -z "$__LIST" ]] && return

if [[ -n "$2" ]]; then
diff --git a/scripts/anubis/anubis b/scripts/anubis/anubis
index 2a04bae..4dabd6a 100755
--- a/scripts/anubis/anubis
+++ b/scripts/anubis/anubis
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/sbin/anubis
PROGRAM_FLAGS="-m auth"
diff --git a/scripts/apache1/apache b/scripts/apache1/apache
new file mode 100755
index 0000000..a6e87a1
--- /dev/null
+++ b/scripts/apache1/apache
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="+network +remote_fs"
+PIDFILE=/var/run/httpd/httpd.pid
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ [ ! -d /var/run/httpd ] && mkdir /var/run/httpd
+ echo "Starting Apache web server..."
+ /usr/sbin/apachectl start
+ evaluate_retval
+}
+
+restart()
+{
+ echo "Restarting Apache web server..."
+ if [ -f $PIDFILE ]; then
+ /usr/sbin/apachectl restart
+ evaluate_retval
+ else
+ run_func start
+ fi
+}
+
+stop()
+{
+ echo "Stopping Apache web server..."
+ /usr/sbin/apachectl stop
+ evaluate_retval
+}
+
+status()
+{
+ getpids httpd
+ if [ -n "$pidlist" ]; then
+ echo "Apache is running with Process ID(s) $pidlist"
+ else
+ if [ -f $PIDFILE ]; then
+ echo "Apache is not running but $PIDFILE exists"
+ return 1
+ else
+ echo "Apache is not running"
+ fi
+ fi
+}
+
+reload()
+{
+ run_func restart
+}
diff --git a/scripts/apache22/apache b/scripts/apache22/apache
index 3cabf23..df0f0c4 100755
--- a/scripts/apache22/apache
+++ b/scripts/apache22/apache
@@ -49,5 +49,7 @@ status()

reload()
{
- run_func restart
+ echo "Gracefully reloading Apache web server..."
+ /usr/sbin/apachectl graceful
+ evaluate_retval
}
diff --git a/scripts/apmd/apmd b/scripts/apmd/apmd
index 917c183..09bb00b 100755
--- a/scripts/apmd/apmd
+++ b/scripts/apmd/apmd
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/sbin/apmd
ARGS="-P /etc/apmd_proxy"
diff --git a/scripts/asterisk/asterisk b/scripts/asterisk/asterisk
index 6778090..563361d 100755
--- a/scripts/asterisk/asterisk
+++ b/scripts/asterisk/asterisk
@@ -1,27 +1,21 @@
#!/bin/bash

-PROGRAM=/bin/false
+PROGRAM=/usr/sbin/asterisk
RUNLEVEL=3

. /etc/init.d/smgl_init

-required_executable /usr/sbin/asterisk
-
start()
{
echo "Starting Asterisk"
/usr/sbin/asterisk
- evaluate_retval
- x=$?
- [ ${x} -eq 0 ] && touch /var/lock/subsys/asterisk
+ evaluate_retval && touch /var/lock/asterisk
}

stop()
{
echo "Shutting down Asterisk"
- killproc asterisk
- x=$?
- [ ${x} -eq 0 ] && rm -f /var/lock/subsys/asterisk
+ killproc asterisk && rm -f /var/lock/asterisk
}

restart()
@@ -33,14 +27,14 @@ restart()
reload()
{
echo "reloading Asterisk"
- /usr/sbin/asterisk -rx 'reload' > /dev/null 2> /dev/null
+ /usr/sbin/asterisk -rx 'reload' > /dev/null 2>&1
evaluate_retval
}

status()
{
- if [[ -f /var/lock/subsys/asterisk ]]; then
- statusproc asterisk
+ if [[ -f /var/lock/asterisk ]]; then
+ statusproc asterisk
else
echo "Asterisk is not loaded"
fi
diff --git a/scripts/audit/auditd b/scripts/audit/auditd
new file mode 100755
index 0000000..b2a0a46
--- /dev/null
+++ b/scripts/audit/auditd
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+PROGRAM=/sbin/auditd
+RUNLEVEL=S
+NEEDS=+root_fs
+
+. /etc/init.d/smgl_init
diff --git a/scripts/avahi/avahi-daemon b/scripts/avahi/avahi-daemon
index 6f12c23..5345b3b 100644
--- a/scripts/avahi/avahi-daemon
+++ b/scripts/avahi/avahi-daemon
@@ -3,7 +3,7 @@
PIDFILE=/var/run/avahi-daemon/pid
PROGRAM=/usr/sbin/avahi-daemon
RUNLEVEL=3
-NEEDS="+network"
+NEEDS="+network smgl-messagebus"
ARGS="-D"

. /etc/init.d/smgl_init
diff --git a/scripts/bluez/bluetooth b/scripts/bluez/bluetooth
index 6edbbdc..e01f9b9 100755
--- a/scripts/bluez/bluetooth
+++ b/scripts/bluez/bluetooth
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/sbin/bluetoothd
RUNLEVEL=3
-NEEDS="+local_fs"
+NEEDS="+local_fs smgl-messagebus"
UART_CONF="/etc/bluetooth/uart"

. /etc/init.d/smgl_init
diff --git a/scripts/cachefilesd/cachefilesd b/scripts/cachefilesd/cachefilesd
new file mode 100755
index 0000000..a9704b0
--- /dev/null
+++ b/scripts/cachefilesd/cachefilesd
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+PROGRAM=/sbin/cachefilesd
+RUNLEVEL=3
+NEEDS="+network"
+
+. /etc/init.d/smgl_init
+
diff --git a/scripts/canna/canna b/scripts/canna/canna
index e96b154..1966d06 100755
--- a/scripts/canna/canna
+++ b/scripts/canna/canna
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM="/usr/bin/cannaserver"
ARGS="-syslog"
diff --git a/scripts/clamfs/clamfs b/scripts/clamfs/clamfs
new file mode 100644
index 0000000..c8c5d08
--- /dev/null
+++ b/scripts/clamfs/clamfs
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+PROGRAM="/usr/bin/clamfs"
+RUNLEVEL=3
+ARGS="/etc/clamfs.xml"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/clamsmtp/clamsmtpd b/scripts/clamsmtp/clamsmtpd
new file mode 100755
index 0000000..619ff2f
--- /dev/null
+++ b/scripts/clamsmtp/clamsmtpd
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+PROGRAM=/usr/sbin/clamsmtpd
+PIDFILE=/var/run/clamsmtp/clamsmtpd.pid
+ARGS="-p $PIDFILE"
+RUNLEVEL=3
+NEEDS="+network"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/connman/connman b/scripts/connman/connman
new file mode 100755
index 0000000..26da04d
--- /dev/null
+++ b/scripts/connman/connman
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+PROGRAM=/usr/sbin/connmand
+ARGS=""
+RUNLEVEL=3
+NEEDS=""
+
+. /etc/init.d/smgl_init
diff --git a/scripts/courier-authlib/courier_authlib
b/scripts/courier-authlib/courier_authlib
new file mode 100755
index 0000000..01923c3
--- /dev/null
+++ b/scripts/courier-authlib/courier_authlib
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="+network +remote_fs"
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ /usr/sbin/authdaemond start
+ evaluate_retval
+}
+
+stop()
+{
+ /usr/sbin/authdaemond stop
+ evaluate_retval
+}
+
+restart()
+{
+ /usr/sbin/authdaemond restart
+ evaluate_retval
+}
diff --git a/scripts/courier-imap/courier-imap
b/scripts/courier-imap/courier-imap
index 7850607..0c50189 100755
--- a/scripts/courier-imap/courier-imap
+++ b/scripts/courier-imap/courier-imap
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
# $Id: imapd.rc.in,v 1.22 2002/12/24 02:31:40 mrsam Exp $
#
# Copyright 1998 - 2002 Double Precision, Inc.
diff --git a/scripts/courier-imap/courier-imap-ssl
b/scripts/courier-imap/courier-imap-ssl
index 6c73d87..fcedb7a 100755
--- a/scripts/courier-imap/courier-imap-ssl
+++ b/scripts/courier-imap/courier-imap-ssl
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
# $Id: imapd-ssl.rc.in,v 1.14 2002/12/24 02:31:40 mrsam Exp $
#
# Copyright 1998 - 2002 Double Precision, Inc.
diff --git a/scripts/courier-imap/courier-pop
b/scripts/courier-imap/courier-pop
index 3128a24..38fa026 100755
--- a/scripts/courier-imap/courier-pop
+++ b/scripts/courier-imap/courier-pop
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
# $Id: pop3d.rc.in,v 1.8 2002/10/25 12:15:17 mrsam Exp $
#
# Copyright 1998 - 2002 Double Precision, Inc.
diff --git a/scripts/courier-imap/courier-pop-ssl
b/scripts/courier-imap/courier-pop-ssl
index 3433409..877a296 100755
--- a/scripts/courier-imap/courier-pop-ssl
+++ b/scripts/courier-imap/courier-pop-ssl
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
# $Id: pop3d-ssl.rc.in,v 1.7 2002/10/25 12:15:17 mrsam Exp $
#
# Copyright 1998 - 2002 Double Precision, Inc.
diff --git a/scripts/courier/courier b/scripts/courier/courier
new file mode 100755
index 0000000..bd75f91
--- /dev/null
+++ b/scripts/courier/courier
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+PROVIDES="mta"
+NEEDS="+network +remote_fs courier_authlib"
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ /usr/sbin/courier start
+ evaluate_retval
+}
+
+stop()
+{
+ /usr/sbin/courier stop
+ evaluate_retval
+}
+
+restart()
+{
+ /usr/sbin/courier restart
+ evaluate_retval
+}
diff --git a/scripts/courier/courier_esmtp b/scripts/courier/courier_esmtp
new file mode 100755
index 0000000..b400522
--- /dev/null
+++ b/scripts/courier/courier_esmtp
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="courier"
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ /usr/sbin/esmtpd start
+ evaluate_retval
+}
+
+stop()
+{
+ /usr/sbin/esmtpd stop
+ evaluate_retval
+}
+
+restart()
+{
+ /usr/sbin/esmtpd restart
+ evaluate_retval
+}
diff --git a/scripts/courier/courier_esmtp_ssl
b/scripts/courier/courier_esmtp_ssl
new file mode 100755
index 0000000..ac26b2c
--- /dev/null
+++ b/scripts/courier/courier_esmtp_ssl
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="courier"
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ /usr/sbin/esmtpd-ssl start
+ evaluate_retval
+}
+
+stop()
+{
+ /usr/sbin/esmtpd-ssl stop
+ evaluate_retval
+}
+
+restart()
+{
+ /usr/sbin/esmtpd-ssl restart
+ evaluate_retval
+}
diff --git a/scripts/courier/courier_imap b/scripts/courier/courier_imap
new file mode 100755
index 0000000..5d05be9
--- /dev/null
+++ b/scripts/courier/courier_imap
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="courier"
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ /usr/sbin/imapd start
+ evaluate_retval
+}
+
+stop()
+{
+ /usr/sbin/imapd stop
+ evaluate_retval
+}
+
+restart()
+{
+ /usr/sbin/imapd restart
+ evaluate_retval
+}
diff --git a/scripts/courier/courier_imap_ssl
b/scripts/courier/courier_imap_ssl
new file mode 100755
index 0000000..6893b51
--- /dev/null
+++ b/scripts/courier/courier_imap_ssl
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="courier"
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ /usr/sbin/imapd-ssl start
+ evaluate_retval
+}
+
+stop()
+{
+ /usr/sbin/imapd-ssl stop
+ evaluate_retval
+}
+
+restart()
+{
+ /usr/sbin/imapd-ssl restart
+ evaluate_retval
+}
diff --git a/scripts/courier/courier_pop b/scripts/courier/courier_pop
new file mode 100755
index 0000000..664dfa5
--- /dev/null
+++ b/scripts/courier/courier_pop
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="courier"
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ /usr/sbin/pop3d start
+ evaluate_retval
+}
+
+stop()
+{
+ /usr/sbin/pop3d stop
+ evaluate_retval
+}
+
+restart()
+{
+ /usr/sbin/pop3d restart
+ evaluate_retval
+}
diff --git a/scripts/courier/courier_pop_ssl b/scripts/courier/courier_pop_ssl
new file mode 100755
index 0000000..cdafe96
--- /dev/null
+++ b/scripts/courier/courier_pop_ssl
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="courier"
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ /usr/sbin/pop3d-ssl start
+ evaluate_retval
+}
+
+stop()
+{
+ /usr/sbin/pop3d-ssl stop
+ evaluate_retval
+}
+
+restart()
+{
+ /usr/sbin/pop3d-ssl restart
+ evaluate_retval
+}
diff --git a/scripts/cpqarrayd/cpqarray b/scripts/cpqarrayd/cpqarray
index 8b0c9f2..16ccff7 100755
--- a/scripts/cpqarrayd/cpqarray
+++ b/scripts/cpqarrayd/cpqarray
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/sbin/cpqarrayd
RUNLEVEL=2
diff --git a/scripts/cronie/crond b/scripts/cronie/crond
new file mode 100755
index 0000000..201f609
--- /dev/null
+++ b/scripts/cronie/crond
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+. /etc/sysconfig/cronie
+
+PROGRAM=/usr/sbin/crond
+ARGS="$CRONIE_ARGS"
+RUNLEVEL=3
+PIDFILE=/var/run/crond.pid
+
+. /etc/init.d/smgl_init
diff --git a/scripts/cronie/cronie.conf b/scripts/cronie/cronie.conf
new file mode 100644
index 0000000..540dc4b
--- /dev/null
+++ b/scripts/cronie/cronie.conf
@@ -0,0 +1,3 @@
+# For the arguments and description see cron(8)
+
+CRONIE_ARGS=""
diff --git a/scripts/dbus/smgl-messagebus b/scripts/dbus/smgl-messagebus
index 073f159..8fa7b36 100755
--- a/scripts/dbus/smgl-messagebus
+++ b/scripts/dbus/smgl-messagebus
@@ -3,24 +3,33 @@
PROGRAM=/usr/bin/dbus-daemon
ARGS="--system"
RUNLEVEL=3
+NEEDS="+remote_fs"
PIDFILE=/var/run/dbus/pid

. /etc/init.d/smgl_init

start() {
echo "Starting system message bus..."
- mkdir -p /var/run/dbus
- if test ! -f $PIDFILE; then
- # don't use loadproc here, as that fails if some user is running
- # a session bus
- $PROGRAM $ARGS
- evaluate_retval
- echo "Creating dbus machine uuid..."
- /usr/bin/dbus-uuidgen --ensure
- evaluate_retval
- else
- print_status warning "$PIDFILE exists, messagebus is running or has
crashed"
+ mkdir -p $(dirname $PIDFILE)
+ # make sure there is actually a process there...
+ if [ -f $PIDFILE ]; then
+ echo "Found $PIDFILE doing extra checks..."
+ if ! ps ax | grep "dbus-daemon" | grep -q $(cat $PIDFILE) ; then
+ print_status warning "$PIDFILE exists, but messagebus is not running
under this PID"
+ echo "Attempting cleanup and new startup..."
+ rm -f $PIDFILE
+ else
+ echo "Seems to be running..."
+ return 0
+ fi
fi
+ # don't use loadproc here, as that fails if some user is running
+ # a session bus
+ $PROGRAM $ARGS
+ evaluate_retval
+ echo "Creating dbus machine uuid..."
+ /usr/bin/dbus-uuidgen --ensure
+ evaluate_retval
}

stop() {
diff --git a/scripts/dcron/crond b/scripts/dcron/crond
index bb6d439..fbc0a32 100644
--- a/scripts/dcron/crond
+++ b/scripts/dcron/crond
@@ -1,6 +1,9 @@
#!/bin/bash

+. /etc/sysconfig/dcron
+
PROGRAM=/usr/sbin/crond
+ARGS="$DCRON_ARGS"
RUNLEVEL=3

. /etc/init.d/smgl_init
diff --git a/scripts/dcron/dcron.conf b/scripts/dcron/dcron.conf
new file mode 100644
index 0000000..3599b41
--- /dev/null
+++ b/scripts/dcron/dcron.conf
@@ -0,0 +1,3 @@
+# For the arguments and description see crond(8)
+
+DCRON_ARGS=""
diff --git a/scripts/dhcdbd/dhcdbd b/scripts/dhcdbd/dhcdbd
index d5b9108..e21c237 100644
--- a/scripts/dhcdbd/dhcdbd
+++ b/scripts/dhcdbd/dhcdbd
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Modified from dhcdbd's RedHat/dhcdbd.init file
#
diff --git a/scripts/dovecot/smgl-dovecot b/scripts/dovecot/smgl-dovecot
index 7287ab7..ae8c2ee 100644
--- a/scripts/dovecot/smgl-dovecot
+++ b/scripts/dovecot/smgl-dovecot
@@ -1,7 +1,6 @@
#!/bin/bash

PROGRAM=/usr/sbin/dovecot
-ARGS="-c /etc/dovecot.conf"
RUNLEVEL=3
NEEDS="+remote_fs +network"

diff --git a/scripts/drbd/drbd b/scripts/drbd/drbd
new file mode 100755
index 0000000..f8395c7
--- /dev/null
+++ b/scripts/drbd/drbd
@@ -0,0 +1,171 @@
+#!/bin/bash
+
+# Distributed under the terms of the GNU General Public License v2
+#
+# Copyright 2001-2010 LINBIT Information Technologies
+# Philipp Reisner, Lars Ellenberg
+#
+# Copyright 2010-2011 Source Mage Team
+# Vlad Glagolev
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="+local_fs +network"
+
+. /etc/init.d/smgl_init
+
+DRBDADM="/sbin/drbdadm"
+DRBDSETUP="/sbin/drbdsetup"
+PROC_DRBD="/proc/drbd"
+MODPROBE="/sbin/modprobe"
+RMMOD="/sbin/rmmod"
+UDEV_TIMEOUT=10
+ADD_MOD_PARAM=""
+
+function assure_module_is_loaded {
+ [ -e "$PROC_DRBD" ] && return
+ echo "Loading drbd module..."
+
+ $MODPROBE -s drbd `$DRBDADM sh-mod-parms` $ADD_MOD_PARAM || return 1
+
+ return 0
+}
+
+function adjust_with_progress {
+ local IFS_O=$IFS
+ local IFS=$'\n'
+ local res out
+
+ COMMANDS=`$DRBDADM -d -n res adjust all` || return 1
+
+ echo -n "[ "
+
+ for CMD in $COMMANDS; do
+ IFS=$IFS_O
+
+ case "$CMD" in
+ res=*)
+ eval "$CMD"
+ ;;
+ *\ disk\ *)
+ # Check for offline resize. If using internal meta data,
+ # we may need to move it first to its expected location.
+ out=$($DRBDADM check-resize "$res" 2>&1)
+ [[ -z $out ]] ||
+ printf "\n%s\n%s\n" "$res" "$out"
+ echo -n "d($res) "
+ ;;
+ *\ syncer\ *)
+ echo -n "s($res) "
+ ;;
+ *\ net\ *)
+ echo -n "n($res) "
+ ;;
+ *)
+ echo ".. "
+ ;;
+ esac
+
+ if ! eval "$CMD"; then
+ printf "[%s] cmd %s failed - continuing!\n" "$res" "$CMD"
+ fi
+ done
+
+ echo -n "]"
+
+ return 0
+}
+
+start() {
+ # Just in case drbdadm want to display any errors in the configuration
+ # file, or we need to ask the user about registering this installation
+ # at http://usage.drbd.org, we call drbdadm here without any IO
+ # redirection.
+ $DRBDADM sh-nop
+
+ assure_module_is_loaded
+ evaluate_retval
+
+ echo "Starting DRBD resources:"
+
+ adjust_with_progress
+ evaluate_retval
+
+ # make sure udev has time to create the device files
+ echo "Waiting for udev device creation..."
+
+ for RESOURCE in `$DRBDADM sh-resources`; do
+ for DEVICE in `$DRBDADM sh-dev $RESOURCE`; do
+ UDEV_TIMEOUT_LOCAL=$UDEV_TIMEOUT
+ while [[ ! -e $DEVICE ]] && [[ $UDEV_TIMEOUT_LOCAL -gt 0 ]]; do
+ sleep 1
+ UDEV_TIMEOUT_LOCAL=$(( $UDEV_TIMEOUT_LOCAL-1 ))
+ done
+ done
+ done
+
+ echo "Waiting for connection "
+ $DRBDADM wait-con-int # User interruptible version of wait-connect all
+ $DRBDADM sh-b-pri all # Become primary if configured
+
+ evaluate_retval
+}
+
+stop() {
+ $DRBDADM sh-nop
+ echo "Stopping all DRBD resources..."
+
+ if [ -e $PROC_DRBD ]; then
+ # bypass drbdadm and drbd config file and everything,
+ # to avoid leaving devices around that are not referenced by
+ # the current config file, or in case the current config file
+ # does not parse for some reason.
+ for d in /dev/drbd* ; do
+ [ -L "$d" ] && continue
+ [ -b "$d" ] || continue
+
+ M=$(umount "$d" 2>&1)
+
+ case $M in
+ *" not mounted")
+ :
+ ;;
+ *)
+ echo "$M" >&2
+ ;;
+ esac
+
+ $DRBDSETUP "$d" down
+ done
+
+ $RMMOD drbd
+ fi
+
+ evaluate_retval
+}
+
+status() {
+ if [ -e $PROC_DRBD ]; then
+ echo "device status:"
+ cat $PROC_DRBD
+ else
+ echo "drbd module not loaded"
+ return 1
+ fi
+}
+
+restart() {
+ echo "Restarting all DRBD resources..."
+
+ stop
+ sleep 1
+ start
+}
+
+reload() {
+ $DRBDADM sh-nop
+ echo "Reloading DRBD configuration..."
+ $DRBDADM adjust all
+
+ evaluate_retval
+}
diff --git a/scripts/dspam/dspam b/scripts/dspam/dspam
index 31fbeed..4a48b32 100755
--- a/scripts/dspam/dspam
+++ b/scripts/dspam/dspam
@@ -1,24 +1,16 @@
#!/bin/bash

-PROGRAM="/bin/true"
-NAME="dspam"
+PROGRAM="/usr/bin/dspam"
+ARGS="--daemon > /dev/null 2>&1 &"
RUNLEVEL=3
+PIDFILE="/var/run/dspam/dspam.pid"
NEEDS="+remote_fs +network"
-PIDFILE=/var/run/dspam.pid

. /etc/init.d/smgl_init

-start()
-{
- echo "Starting dspam..."
- /usr/bin/dspam --daemon &
- ps -C dspam > /dev/null
- evaluate_retval
-}
+start() {
+ echo "Starting $NAME..."

-stop()
-{
- echo "stopping dspam..."
- kill $(cat ${PIDFILE})
- evaluate_retval
+ su root -c "$PROGRAM $ARGS"
+ evaluate_retval
}
diff --git a/scripts/elsa/elsa b/scripts/elsa/elsa
new file mode 100755
index 0000000..58007ea
--- /dev/null
+++ b/scripts/elsa/elsa
@@ -0,0 +1,9 @@
+#!/bin/bash
+#
+
+PROGRAM=/usr/sbin/elsa
+ARGS="-d"
+RUNLEVEL=5
+PROVIDES=display_manager
+
+. /etc/init.d/smgl_init
diff --git a/scripts/exim/exim b/scripts/exim/exim
index 3bcb41b..386dc48 100644
--- a/scripts/exim/exim
+++ b/scripts/exim/exim
@@ -1,12 +1,14 @@
#!/bin/bash
-PROGRAM=/usr/sbin/exim
-RUNLEVEL=3
-NEEDS="+network"

#
# /etc/sysconfig/exim needs to be sourced before ARGS
#
. /etc/sysconfig/exim
-. /etc/init.d/smgl_init

+PROGRAM=/usr/sbin/exim
ARGS="-bd -q${QUEUE_DELAY}"
+PIDFILE="/var/run/exim.pid"
+RUNLEVEL=3
+NEEDS="+network"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/ferm/ferm b/scripts/ferm/ferm
index 0a99fd1..415acf8 100755
--- a/scripts/ferm/ferm
+++ b/scripts/ferm/ferm
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/sbin/ferm
RUNLEVEL=3
diff --git a/scripts/firebird/firebird2 b/scripts/firebird/firebird2
index d097fe3..e68436e 100755
--- a/scripts/firebird/firebird2
+++ b/scripts/firebird/firebird2
@@ -8,6 +8,10 @@

FB_DIR=/opt/firebird/bin
FB=fbserver
+if [[ ! -f $FB_DIR/$FB ]];then
+# 2.5 has a combined classic-super server using libfbembed.so
+ FB=fb_smp_server
+fi
# as of rc2, preferred method of stopping is to kill the process

source /etc/init.d/smgl_functions
@@ -24,7 +28,7 @@ case $1 in
;;
stop)
echo "Stopping Firebird server"
- kill `ps -u firebird`
+ pkill $FB
evaluate_retval
;;

diff --git a/scripts/firebird25/firebird2 b/scripts/firebird25/firebird2
new file mode 100755
index 0000000..e68436e
--- /dev/null
+++ b/scripts/firebird25/firebird2
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# description: Start/Stop firebird2 database server
+#
+# This file belongs in /etc/init.d where it will be run
+# on system startup and shutdown to start the background
+# Firebird2 database Super server daemon
+
+FB_DIR=/opt/firebird/bin
+FB=fbserver
+if [[ ! -f $FB_DIR/$FB ]];then
+# 2.5 has a combined classic-super server using libfbembed.so
+ FB=fb_smp_server
+fi
+# as of rc2, preferred method of stopping is to kill the process
+
+source /etc/init.d/smgl_functions
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="+network +remote_fs"
+
+case $1 in
+ start)
+ echo "Starting Firebird Super Server"
+ su -s "/bin/sh" -m -c "$FB_DIR/$FB" -l "firebird" &
+ evaluate_retval
+ ;;
+ stop)
+ echo "Stopping Firebird server"
+ pkill $FB
+ evaluate_retval
+ ;;
+
+ restart)
+ echo "Restarting Firebird server"
+ $0 stop
+ $0 start
+ evaluate_retval
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
+esac
diff --git a/scripts/flow-tools/flow-capture b/scripts/flow-tools/flow-capture
new file mode 100755
index 0000000..47784f5
--- /dev/null
+++ b/scripts/flow-tools/flow-capture
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+. /etc/sysconfig/flow-capture
+
+PROGRAM=/usr/bin/flow-capture
+PIDFILE=/var/run/flow-capture.pid
+ARGS="-p $PIDFILE $FLOW_CAPTURE_ARGS"
+RUNLEVEL=3
+NEEDS="+network"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/flow-tools/flow-capture.conf
b/scripts/flow-tools/flow-capture.conf
new file mode 100644
index 0000000..e02c824
--- /dev/null
+++ b/scripts/flow-tools/flow-capture.conf
@@ -0,0 +1,3 @@
+# For the arguments and description see flow-capture(1)
+
+FLOW_CAPTURE_ARGS="127.0.0.1"
diff --git a/scripts/flowd/flowd b/scripts/flowd/flowd
new file mode 100755
index 0000000..7b7fee4
--- /dev/null
+++ b/scripts/flowd/flowd
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+PROGRAM=/usr/sbin/flowd
+ARGS="-f /etc/flowd.conf"
+RUNLEVEL=3
+PIDFILE=/var/run/flowd.pid
+NEEDS="+network"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/freewnn/jserver b/scripts/freewnn/jserver
index bc1a58d..6837313 100755
--- a/scripts/freewnn/jserver
+++ b/scripts/freewnn/jserver
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM="/usr/bin/Wnn4/jserver"
RUNLEVEL=3
diff --git a/scripts/fuse/fuse b/scripts/fuse/fuse
new file mode 100644
index 0000000..26c2c00
--- /dev/null
+++ b/scripts/fuse/fuse
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+MOUNTPOINT="/sys/fs/fuse/connections"
+
+. /etc/init.d/smgl_init
+
+start() {
+ echo "Loading fuse module"
+ if ! grep -qw fuse /proc/filesystems; then
+ /sbin/modprobe fuse >/dev/null 2>&1
+ fi
+ evaluate_retval
+
+ echo "Mounting fuse control filesystem"
+ if grep -qw fusectl /proc/filesystems && ! grep -qw $MOUNTPOINT
/proc/mounts; then
+ /bin/mount -t fusectl fusectl $MOUNTPOINT >/dev/null 2>&1
+ fi
+ evaluate_retval
+}
+
+stop() {
+ echo "Unmounting fuse control filesystem"
+ if grep -qw $MOUNTPOINT /proc/mounts; then
+ /bin/umount $MOUNTPOINT >/dev/null 2>&1
+ fi
+ evaluate_retval
+
+ echo "Unloading fuse module"
+ if grep -qw "^fuse" /proc/modules; then
+ /sbin/rmmod fuse >/dev/null 2>&1
+ fi
+ evaluate_retval
+}
+
+reload() {
+ exit 3
+}
+
+status() {
+ echo -n "fuse filesystem is "
+ if ! grep -qw fuse /proc/filesystems; then
+ echo "not available."
+ else
+ echo "available."
+ fi
+}
diff --git a/scripts/gdm/gdm.sh b/scripts/gdm/gdm.sh
index 3ad20b3..3202fc6 100755
--- a/scripts/gdm/gdm.sh
+++ b/scripts/gdm/gdm.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# gdm.sh Load the GDM login manager at boot
#
diff --git a/scripts/gkrellm2/gkrellmd b/scripts/gkrellm2/gkrellmd
index 652f65e..7d3a011 100755
--- a/scripts/gkrellm2/gkrellmd
+++ b/scripts/gkrellm2/gkrellmd
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/bin/gkrellmd
ARGS="-d"
diff --git a/scripts/glibc/nscd b/scripts/glibc/nscd
new file mode 100755
index 0000000..02b6eab
--- /dev/null
+++ b/scripts/glibc/nscd
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+[[ -f /etc/sysconfig/nscd ]] && . /etc/sysconfig/nscd
+
+PROGRAM=/usr/sbin/nscd
+ARGS="--config-file=/etc/nscd.conf --nthreads=${NTHREADS:=4}"
+RUNLEVEL=3
+NEEDS="+network +remote_fs"
+RECOMMENDED=yes
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ [[ -d /var/run/nscd ]] || mkdir -p /var/run/nscd
+ [[ -d /var/db/nscd ]] || mkdir -p /var/db/nscd
+ echo "Starting Name Service Cache Daemon..."
+ $PROGRAM $ARGS
+ evaluate_retval
+}
+
+stop()
+{
+ echo "Stopping Name Service Cache Daemon..."
+ $PROGRAM --shutdown
+ evaluate_retval
+}
+
+status()
+{
+ $PROGRAM --statistics
+}
diff --git a/scripts/glibc/nscd.conf b/scripts/glibc/nscd.conf
new file mode 100644
index 0000000..69f37af
--- /dev/null
+++ b/scripts/glibc/nscd.conf
@@ -0,0 +1,5 @@
+#
+# Start "n" number of threads
+# (Default "4")
+#
+NTHREADS="4"
diff --git a/scripts/gnump3d/gnump3d b/scripts/gnump3d/gnump3d
index 8391752..3ac7387 100755
--- a/scripts/gnump3d/gnump3d
+++ b/scripts/gnump3d/gnump3d
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#

PROGRAM=/usr/bin/gnump3d
diff --git a/scripts/halevt/halevt b/scripts/halevt/halevt
new file mode 100644
index 0000000..bdb2e4d
--- /dev/null
+++ b/scripts/halevt/halevt
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+PROGRAM=/usr/bin/halevt
+RUNLEVEL=3
+NEEDS="hald"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/hibernate-script/hibernate-cleanup
b/scripts/hibernate-script/hibernate-cleanup
index 6c05fd4..fddf888 100644
--- a/scripts/hibernate-script/hibernate-cleanup
+++ b/scripts/hibernate-script/hibernate-cleanup
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/sbin/hibernate
RUNLEVEL=S
diff --git a/scripts/hotplug/hotplug b/scripts/hotplug/hotplug
index c81a02b..3d608f1 100755
--- a/scripts/hotplug/hotplug
+++ b/scripts/hotplug/hotplug
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# hotplug This scripts starts hotpluggable subsystems.
#
diff --git a/scripts/icecream/icecream b/scripts/icecream/icecream
new file mode 100644
index 0000000..370c921
--- /dev/null
+++ b/scripts/icecream/icecream
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+PROGRAM=/opt/icecream/sbin/iceccd
+ARGS="--daemonize"
+RUNLEVEL=3
+NEEDS="+network +remote_fs"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/icecream/icecream-scheduler
b/scripts/icecream/icecream-scheduler
new file mode 100644
index 0000000..512828f
--- /dev/null
+++ b/scripts/icecream/icecream-scheduler
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+PROGRAM=/opt/icecream/sbin/scheduler
+ARGS="--daemonize"
+RUNLEVEL=3
+NEEDS="+network +remote_fs"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/ifupdown/network b/scripts/ifupdown/network
index b1dbe48..6424812 100755
--- a/scripts/ifupdown/network
+++ b/scripts/ifupdown/network
@@ -3,6 +3,7 @@
PROGRAM=/bin/false # To get auto_init functionality
RUNLEVEL=3
PROVIDES=network
+RECOMMENDED=yes

[ "$USE_SYSLOG" = "yes" ] && NEEDS="+syslog"

diff --git a/scripts/init.d/devices b/scripts/init.d/devices
index 8fb142b..dde9a1b 100755
--- a/scripts/init.d/devices
+++ b/scripts/init.d/devices
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/bin/false
RUNLEVEL=DEV
@@ -26,21 +26,31 @@ start_devfs()
fi
}

-start_udev()
-{ (
- . /etc/udev/udev.conf
- # mount sysfs
- echo "Mounting sysfs at /sys"
- mount -n -t sysfs none /sys
- echo "Mounting ramfs at $udev_root"
- mount -n -t ramfs none $udev_root
- # create some needed stuff
- ln -s /proc/self/fd $udev_root/fd
+udev_mknodes()
+{
+ if [ ! -d $udev_root/fd ]; then
+ ln -fs /proc/self/fd $udev_root/fd
+ fi
ln -s /dev/fd/0 $udev_root/stdin
ln -s /dev/fd/1 $udev_root/stdout
ln -s /dev/fd/2 $udev_root/stderr
mkdir $udev_root/shm
mkdir $udev_root/pts
+}
+
+start_udev()
+{ (
+ . /etc/udev/udev.conf
+ echo "Checking if devtmpfs or ramfs is used for $udev_root ..."
+ if findmnt devtmpfs > /dev/null 2>&1; then
+ echo "devtmpfs is used for $udev_root"
+ else
+ echo "ramfs is used for $udev_root"
+ echo "Mounting ramfs at $udev_root"
+ mount -n -t ramfs none $udev_root
+ fi
+ # create some needed stuff
+ udev_mknodes

# strip out kernel sublevel and patchlevel so we can check against them
# since we don't support 1.x linux kernels then we don't have to check that
@@ -84,6 +94,52 @@ start_udev()
kill -USR1 1
) }

+start_static_udev()
+{ (
+ . /etc/udev/udev.conf
+ # create some needed stuff - and insist on it
+ udev_mknodes
+
+ # strip out kernel sublevel and patchlevel so we can check against them
+ # since we don't support 1.x linux kernels then we don't have to check that
+ PATCHLEVEL=$(uname -r | cut -d. -f2)
+ SUBLEVEL=$(uname -r | cut -d. -f3)
+ tmp=$(uname -r | cut -d. -f3 | sed 's/^[0-9]*//g')
+ SUBLEVEL=${SUBLEVEL/$tmp/}
+
+ # kernel 2.6.15-rc1 and higher don't use hotplug
+ if [ $SUBLEVEL -ge 15 -a $PATCHLEVEL -ge 6 ]; then
+ echo "don't need hotplug for this kernel"
+ builtin echo > /proc/sys/kernel/hotplug
+ else
+ # Now uses udevsend as the hotplug multiplexer
+ echo "Setting udevsend as hotplug agent"
+ sysctl -w kernel.hotplug="/sbin/udevsend" > /dev/null 2>&1
+ echo "Creating initial udev device nodes"
+ /sbin/udevstart
+ fi
+
+ if [ -f /etc/udev/udev.missing ]; then
+ echo "Processing /etc/udev/udev.missing"
+ cd /dev
+ while read line; do
+ if [ "${line:0:1}" == "#" ]; then continue; fi
+ for ((i=0; i<7; i++)); do
+ val[$i]=${line%%:*}
+ line=${line#*:}
+ done
+ if [ "${val[1]}" == "d" ]; then
+ mkdir -p ${val[0]}
+ else
+ mknod ${val[0]} ${val[1]} ${val[2]} ${val[3]}
+ fi
+ chmod ${val[4]} ${val[0]}
+ chown ${val[5]}:${val[6]} ${val[0]}
+ done < /etc/udev/udev.missing
+ cd /
+ fi
+) }
+
start_static()
{
exit 0
@@ -94,6 +150,12 @@ start()
# mount proc
echo "Mounting /proc"
mount -n -t proc proc /proc
+ # mount sys
+ echo "Mounting /sys"
+ mount -n -t sysfs sysfs /sys
+ # mount run
+ echo "Mounting /run"
+ mount -n -t tmpfs tmpfs /run
eval "start_$DEVICES"
}

diff --git a/scripts/init.d/devices.conf b/scripts/init.d/devices.conf
index 287f0cc..aefd80b 100644
--- a/scripts/init.d/devices.conf
+++ b/scripts/init.d/devices.conf
@@ -1,2 +1,2 @@
-# type of device management, "static", "devfs" or "udev"
+# type of device management, "static", "devfs", "udev" or "static_udev"
DEVICES=devfs
diff --git a/scripts/init.d/mountall.sh b/scripts/init.d/mountall.sh
index eead8c3..95954c3 100755
--- a/scripts/init.d/mountall.sh
+++ b/scripts/init.d/mountall.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# vim:set ts=2 sw=2 et:

PROGRAM=/bin/false
@@ -26,7 +26,10 @@ function recursive_rm() {

checkfs()
{
- [ -e /fastboot ] && return
+ if [ -e /fastboot ]; then
+ rm -f /fastboot;
+ return;
+ fi
[ -e /forcefsck ] && FORCE="-f"
[ "$NOSOFTFIX" != yes ] && FIX="-a"
[ "$FSCKFIX" = yes ] && FIX="-y"
@@ -48,7 +51,7 @@ checkfs()
/sbin/reboot -f
fi

- rm -f /fastboot /forcefsck
+ rm -f /forcefsck
}

scanlvm()
diff --git a/scripts/init.d/mountroot.sh b/scripts/init.d/mountroot.sh
index a3883bb..12ca2f7 100755
--- a/scripts/init.d/mountroot.sh
+++ b/scripts/init.d/mountroot.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# vim:set ts=2 sw=2 et:

PROGRAM=/bin/false
@@ -61,7 +61,7 @@ start()
#
if [ -f /etc/mdadm.conf ] ; then
mdadm --assemble --scan
- mdadm --follow --scan --delay=120 --daemonise >
/var/run/mdadm.pid
+ mdadm --follow --scan --delay=120 --daemonise
elif [ -f /etc/raidtab ] ; then
raidstart --all
fi
diff --git a/scripts/inoclam/inoclam b/scripts/inoclam/inoclam
new file mode 100755
index 0000000..500860a
--- /dev/null
+++ b/scripts/inoclam/inoclam
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+PROGRAM=/usr/sbin/inoclam
+RUNLEVEL=3
+NEEDS="clamd"
+PIDFILE=/var/run/inoclam.pid
+
+. /etc/init.d/smgl_init
diff --git a/scripts/iplog/iplog b/scripts/iplog/iplog
index f9b4415..979830f 100644
--- a/scripts/iplog/iplog
+++ b/scripts/iplog/iplog
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Source Mage init.d install information
# SMGL-START:2 3 4 5:S40
diff --git a/scripts/iplog/iplog.sh b/scripts/iplog/iplog.sh
index f9b4415..979830f 100644
--- a/scripts/iplog/iplog.sh
+++ b/scripts/iplog/iplog.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Source Mage init.d install information
# SMGL-START:2 3 4 5:S40
diff --git a/scripts/ircd-ratbox/ratbox b/scripts/ircd-ratbox/ratbox
new file mode 100755
index 0000000..7e19fa4
--- /dev/null
+++ b/scripts/ircd-ratbox/ratbox
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+PROGRAM=/usr/bin/ircd
+PIDFILE=/var/run/ircd/ircd.pid
+RUNLEVEL=3
+NEEDS="+network"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/kbd/keymap.sh b/scripts/kbd/keymap.sh
index 79342c6..6b5808f 100755
--- a/scripts/kbd/keymap.sh
+++ b/scripts/kbd/keymap.sh
@@ -1,6 +1,6 @@
#!/bin/bash

-PROGRAM=/usr/bin/loadkeys
+PROGRAM=/bin/loadkeys
RUNLEVEL=S
NEEDS="+local_fs"
RECOMMENDED=yes
@@ -14,12 +14,12 @@ dropfile=/var/tmp/keymap.drop
start()
{
[[ "$TTY_NUMS" ]] && [[ "$SETFONT_ARGS" ]] &&
- required_executable /usr/bin/setfont
+ required_executable /bin/setfont
[[ "$KEYMAP$INCLUDEMAPS" ]] &&
- required_executable /usr/bin/loadkeys
+ required_executable /bin/loadkeys

if [[ "$KEYMAP" ]]; then
- echo "$(/usr/bin/loadkeys $KEYMAP 2>&1)"
+ echo "$(/bin/loadkeys $KEYMAP 2>&1)"
evaluate_retval
fi

@@ -27,16 +27,16 @@ start()
[[ $(find /usr/share/kbd/keymaps/ -type f -name "$a.inc*" 2>/dev/null)
]] &&
[[ ! $(find /usr/share/kbd/keymaps/ -type f -name "$a.map*" 2>/dev/null)
]] &&
a="$a.inc"
- echo "$(/usr/bin/loadkeys $a 2>&1)"
+ echo "$(/bin/loadkeys $a 2>&1)"
evaluate_retval
done

[[ "$DEVICES" == "devfs" ]] && DEV_TTY="vc/" || DEV_TTY="tty"

if [[ "$UNICODE_START" ]]; then
- required_executable /usr/bin/unicode_start
- /usr/bin/kbd_mode -u
- /usr/bin/dumpkeys | /usr/bin/loadkeys --unicode
+ required_executable /bin/unicode_start
+ /bin/kbd_mode -u
+ /bin/dumpkeys | /bin/loadkeys --unicode
fi

if [[ "$TTY_NUMS" == '*' ]]; then
@@ -50,7 +50,7 @@ start()
echo "Loading settings for $DEV_TTY$n..."
[[ "$UNICODE_START" ]] && /bin/echo -ne "\033%G" > /dev/$DEV_TTY$n
if [[ "$SETFONT_ARGS" ]]; then
- /usr/bin/setfont $SETFONT_ARGS -C /dev/$DEV_TTY$n
+ /bin/setfont $SETFONT_ARGS -C /dev/$DEV_TTY$n
evaluate_retval
fi
done
@@ -65,23 +65,23 @@ start()
stop()
{
[[ "$TTY_NUMS" ]] && [[ "$SETFONT_ARGS" ]] &&
- required_executable /usr/bin/setfont
+ required_executable /bin/setfont

[[ -f $dropfile ]] && . $dropfile && rm $dropfile

[[ "$KEYMAP$INCLUDEMAPS" ]] &&
- required_executable /usr/bin/loadkeys &&
- echo "$(/usr/bin/loadkeys defkeymap 2>&1)"
+ required_executable /bin/loadkeys &&
+ echo "$(/bin/loadkeys defkeymap 2>&1)"

[[ "$UNICODE_START" ]] &&
- required_executable /usr/bin/unicode_stop &&
- /usr/bin/kbd_mode -a
+ required_executable /bin/unicode_stop &&
+ /bin/kbd_mode -a

for n in $TTY_NUMS; do
echo "Unloading settings for $DEV_TTY$n..."
[[ "$UNICODE_START" ]] && /bin/echo -ne '\033%@' > /dev/$DEV_TTY$n
if [[ "$SETFONT_ARGS" ]]; then
- /usr/bin/setfont default8x16 -C /dev/$DEV_TTY$n
+ /bin/setfont default8x16 -C /dev/$DEV_TTY$n
evaluate_retval
fi
done
diff --git a/scripts/kdebase-workspace4/kdm4 b/scripts/kdebase-workspace4/kdm4
index d60e7b1..0fea853 100755
--- a/scripts/kdebase-workspace4/kdm4
+++ b/scripts/kdebase-workspace4/kdm4
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/opt/kde4/bin/kdm
RUNLEVEL=5
diff --git a/scripts/kdebase/kdm b/scripts/kdebase/kdm
index aaa5fd6..742a559 100755
--- a/scripts/kdebase/kdm
+++ b/scripts/kdebase/kdm
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/bin/kdm
RUNLEVEL=5
diff --git a/scripts/knock/knock.conf b/scripts/knock/knock.conf
new file mode 100644
index 0000000..2924313
--- /dev/null
+++ b/scripts/knock/knock.conf
@@ -0,0 +1,3 @@
+# For the arguments and description see knockd(8)
+
+KNOCKD_ARGS=""
diff --git a/scripts/knock/knockd b/scripts/knock/knockd
new file mode 100755
index 0000000..bed9872
--- /dev/null
+++ b/scripts/knock/knockd
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+. /etc/sysconfig/knock
+
+PROGRAM=/usr/sbin/knockd
+ARGS="-d $KNOCKD_ARGS"
+RUNLEVEL=3
+PIDFILE=/var/run/knockd.pid
+
+. /etc/init.d/smgl_init
diff --git a/scripts/laptop-mode-tools/laptop-mode
b/scripts/laptop-mode-tools/laptop-mode
index b177ca5..b0964a3 100755
--- a/scripts/laptop-mode-tools/laptop-mode
+++ b/scripts/laptop-mode-tools/laptop-mode
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# chkconfig: - 20 90
# description: Starts and stops "laptop-mode" - tweaks system behavior
diff --git a/scripts/libvirt/libvirtd b/scripts/libvirt/libvirtd
index 979dc9b..907b95f 100644
--- a/scripts/libvirt/libvirtd
+++ b/scripts/libvirt/libvirtd
@@ -1,8 +1,10 @@
#!/bin/bash

+. /etc/sysconfig/libvirtd
+
PIDFILE=/var/run/libvirtd.pid
PROGRAM=/usr/sbin/libvirtd
-ARGS="-d"
+ARGS="-d $LISTEN"
RUNLEVEL=3

[[ ! -d /var/run/libvirt ]] && mkdir -p /var/run/libvirt
diff --git a/scripts/libvirt/libvirtd.conf b/scripts/libvirt/libvirtd.conf
new file mode 100644
index 0000000..5d948da
--- /dev/null
+++ b/scripts/libvirt/libvirtd.conf
@@ -0,0 +1,2 @@
+# Flag listening for secure TLS connections on the public TCP/IP port.
+LISTEN="--listen"
diff --git a/scripts/lshwd/lshwd b/scripts/lshwd/lshwd
index 4e0af39..56842ec 100755
--- a/scripts/lshwd/lshwd
+++ b/scripts/lshwd/lshwd
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/bin/true
RUNLEVEL=S
diff --git a/scripts/lxdm/lxdm b/scripts/lxdm/lxdm
new file mode 100755
index 0000000..2bd2167
--- /dev/null
+++ b/scripts/lxdm/lxdm
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+PROGRAM=/usr/sbin/lxdm-binary
+ARGS=-d
+RUNLEVEL=5
+PROVIDES=display_manager
+
+. /etc/init.d/smgl_init
diff --git a/scripts/maradns/deadwood b/scripts/maradns/deadwood
new file mode 100644
index 0000000..9db9d0a
--- /dev/null
+++ b/scripts/maradns/deadwood
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+PROGRAM="/usr/sbin/Deadwood"
+RUNLEVEL=3
+NEEDS="+remote_fs +network"
+
+. /etc/init.d/smgl_init
+required_executable /usr/sbin/Deadwood
+required_executable /usr/bin/duende
+
+function start()
+{
+ echo "Starting maradns..."
+ /usr/bin/duende Deadwood
+ evaluate_retval
+}
+
+function stop()
+{
+ echo "Stoping maradns..."
+ pkill Deadwood
+ evaluate_retval
+}
+
diff --git a/scripts/mariadb/mariadb b/scripts/mariadb/mariadb
new file mode 100644
index 0000000..2b5d8ee
--- /dev/null
+++ b/scripts/mariadb/mariadb
@@ -0,0 +1,186 @@
+#!/bin/bash
+# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
+# This file is public domain and comes with NO WARRANTY of any kind
+#
+# If you install MySQL on some other places than /usr, then you
+# have to do one of the following things for this script to work:
+#
+# - Run this script from within the MySQL installation directory
+# - Create a /etc/my.cnf file with the following information:
+# [mariadbd]
+# basedir=<path-to-mariadb-installation-directory>
+# - Add the above to any other configuration file (for example ~/.my.ini)
+# and copy my_print_defaults to /usr/bin
+# - Add the path to the mariadb-installation-directory to the basedir
variable
+# below.
+#
+# If you want to affect other MySQL variables, you should make your changes
+# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
+#
+# SMGL-script-version=20030723
+# SMGL-START:3 4 5:S90
+# SMGL-STOP:0 1 2 6:K10
+
+PROGRAM=
+RUNLEVEL=3
+NEEDS="+remote_fs"
+
+. /etc/init.d/smgl_init
+. /etc/sysconfig/mariadb
+
+[[ ! -d ${DATA_DIR} ]] && mkdir -p ${DATA_DIR}
+
+basedir=
+
+# The following variables are only set for letting mariadb.server find
things.
+
+# Set some defaults
+datadir=${DATA_DIR}
+pid_file=
+if test -z "$basedir"
+then
+ basedir=/usr
+ bindir=/usr/bin
+else
+ bindir="$basedir/bin"
+fi
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin
+export PATH
+
+if test -z "$pid_file"
+then
+ pid_file=$datadir/`/bin/hostname`.pid
+else
+ case "$pid_file" in
+ /* ) ;;
+ * ) pid_file="$datadir/$pid_file" ;;
+ esac
+fi
+
+mode=$1 # start or stop
+
+parse_arguments() {
+ for arg do
+ case "$arg" in
+ --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+ --datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+ --pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+ esac
+ done
+}
+
+# Get arguments from the my.cnf file,
+# groups [mariadbd] [mariadb_server] and [mariadb.server]
+if test -x ./bin/my_print_defaults
+then
+ print_defaults="./bin/my_print_defaults"
+elif test -x $bindir/my_print_defaults
+then
+ print_defaults="$bindir/my_print_defaults"
+elif test -x $bindir/mariadb_print_defaults
+then
+ print_defaults="$bindir/mariadb_print_defaults"
+else
+ # Try to find basedir in /etc/my.cnf
+ conf=/etc/my.cnf
+ print_defaults=
+ if test -r $conf
+ then
+ subpat='^[^=]*basedir[^=]*=\(.*\)$'
+ dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
+ for d in $dirs
+ do
+ d=`echo $d | sed -e 's/[ ]//g'`
+ if test -x "$d/bin/my_print_defaults"
+ then
+ print_defaults="$d/bin/my_print_defaults"
+ break
+ fi
+ if test -x "$d/bin/mariadb_print_defaults"
+ then
+ print_defaults="$d/bin/mariadb_print_defaults"
+ break
+ fi
+ done
+ fi
+
+ # Hope it's in the PATH ... but I doubt it
+ test -z "$print_defaults" && print_defaults="my_print_defaults"
+fi
+
+parse_arguments `$print_defaults mariadbd mariadb_server mariadb.server`
+
+# Safeguard (relative paths, core dumps..)
+cd $basedir
+
+case "$mode" in
+ 'start')
+ # Start daemon
+
+ if test -x $bindir/mysqld_safe
+ then
+ # Give extra arguments to mariadbd with the my.cnf file. This script
may
+ # be overwritten at next upgrade.
+ echo "Starting mariadbd_safe..."
+ iter=0
+ ( unset -f echo
+ $bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file 2>&1 >
/dev/null ) &
+ while [ ! -e $pid_file ] && [ $((iter++)) -lt 10 ] ; do sleep 1; echo
-n . ; done
+ [ $((iter++)) -lt 11 ]
+ evaluate_retval
+ # Make lock for RedHat / SuSE
+ if test -w /var/lock/subsys
+ then
+ touch /var/lock/subsys/mariadb
+ fi
+ else
+ echo "Can't execute $bindir/mariadbd_safe from dir $basedir"
+ fi
+ evaluate_retval
+ ;;
+
+ 'stop')
+ # Stop daemon. We use a signal here to avoid having to know the
+ # root password.
+ if test -s "$pid_file"
+ then
+ mariadbd_pid=`cat $pid_file`
+ echo "Killing mariadbd with pid $mariadbd_pid"
+ kill $mariadbd_pid
+ # mariadbd should remove the pid_file when it exits, so wait for it.
+
+ sleep 1
+ while [ -s $pid_file -a "$flags" != aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
]
+ do
+ [ -z "$flags" ] && echo -n "Wait for mariadbd to exit" || echo -n "."
+ flags=a$flags
+ sleep 1
+ done
+ if [ -s $pid_file ]
+ then echo " gave up waiting!"
+ elif [ -n "$flags" ]
+ then echo " done"
+ fi
+ # delete lock for RedHat / SuSE
+ if test -f /var/lock/subsys/mariadb
+ then
+ rm /var/lock/subsys/mariadb
+ fi
+ else
+ echo "No mariadbd pid file found. Looked for $pid_file."
+ fi
+ evaluate_retval
+ ;;
+ 'restart')
+ echo "Restarting mariadb server"
+ $0 stop
+ $0 start
+ evaluate_retval
+ ;;
+ *)
+ # usage
+ echo "usage: $0 start|stop|restart"
+ exit 1
+ ;;
+esac
diff --git a/scripts/mcelog/mcelog b/scripts/mcelog/mcelog
new file mode 100755
index 0000000..6bee670
--- /dev/null
+++ b/scripts/mcelog/mcelog
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+PIDFILE=/var/run/mcelog.pid
+PROGRAM=/usr/sbin/mcelog
+ARGS="--daemon --pidfile /var/run/mcelog.pid"
+RUNLEVEL=3
+NEEDS="+syslog"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/mdadm/mdadm-monitor b/scripts/mdadm/mdadm-monitor
new file mode 100755
index 0000000..54b69c2
--- /dev/null
+++ b/scripts/mdadm/mdadm-monitor
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+PROGRAM=/sbin/mdadm
+ARGS="--monitor --scan --daemonize"
+RUNLEVEL=S
+NEEDS="+root_fs"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/mediatomb/mediatomb b/scripts/mediatomb/mediatomb
new file mode 100644
index 0000000..12f1b8b
--- /dev/null
+++ b/scripts/mediatomb/mediatomb
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+. /etc/sysconfig/mediatomb
+
+PIDFILE=/var/run/mediatomb.pid
+PROGRAM=/usr/bin/mediatomb
+ARGS="--daemon --user $MTUSER --group $MTGROUP --ip $MTIP --home $MTHOME
--logfile $MTLOG --pidfile /var/run/mediatomb.pid"
+RUNLEVEL=3
+NEEDS="+network +remote_fs"
+
+. /etc/init.d/smgl_init
+
diff --git a/scripts/mediatomb/mediatomb.conf
b/scripts/mediatomb/mediatomb.conf
new file mode 100644
index 0000000..2cd2046
--- /dev/null
+++ b/scripts/mediatomb/mediatomb.conf
@@ -0,0 +1,5 @@
+MTUSER=mediatomb
+MTGROUP=mediatomb
+MTIP=127.0.0.1
+MTHOME=/srv/mediatomb
+MTLOG=$MTHOME/mediatomb.log
diff --git a/scripts/memcached/memcached b/scripts/memcached/memcached
new file mode 100755
index 0000000..431e451
--- /dev/null
+++ b/scripts/memcached/memcached
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+. /etc/sysconfig/memcached
+
+PROGRAM=/usr/bin/memcached
+ARGS="-d -u memcached -P /var/run/memcached/memcached.pid $OPTIONS"
+RUNLEVEL=3
+PIDFILE=/var/run/memcached/memcached.pid
+
+. /etc/init.d/smgl_init
diff --git a/scripts/memcached/memcached.conf
b/scripts/memcached/memcached.conf
new file mode 100644
index 0000000..04c88df
--- /dev/null
+++ b/scripts/memcached/memcached.conf
@@ -0,0 +1,3 @@
+# Specify command-line options here, for more info read memcached(1)
+
+OPTIONS="-m 128"
diff --git a/scripts/micron/micron b/scripts/micron/micron
index 591ea6f..d763226 100755
--- a/scripts/micron/micron
+++ b/scripts/micron/micron
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/sbin/micrond
RUNLEVEL=3
diff --git a/scripts/mongodb/mongodb b/scripts/mongodb/mongodb
new file mode 100755
index 0000000..a4c4457
--- /dev/null
+++ b/scripts/mongodb/mongodb
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+. /etc/sysconfig/mongodb
+
+PROGRAM=/usr/bin/mongod
+PIDFILE=/var/run/mongod/mongod.pid
+ARGS="-f /etc/mongodb.conf --pidfilepath $PIDFILE --fork $MONGOD_ARGS"
+RUNLEVEL=3
+NEEDS="+network"
+
+start() {
+ echo "Starting $NAME..."
+
+ # needs C locale on startup
+ export LC_ALL="C"
+
+ su mongodb -s /bin/sh -c "$PROGRAM $ARGS"
+ evaluate_retval
+}
+
+. /etc/init.d/smgl_init
diff --git a/scripts/mongodb/mongodb.conf b/scripts/mongodb/mongodb.conf
new file mode 100644
index 0000000..b3a4479
--- /dev/null
+++ b/scripts/mongodb/mongodb.conf
@@ -0,0 +1,3 @@
+# For the arguments and description see ``mongod --help''
+
+MONGOD_ARGS=""
diff --git a/scripts/mpd/mpd b/scripts/mpd/mpd
index 55030b5..0589b2b 100644
--- a/scripts/mpd/mpd
+++ b/scripts/mpd/mpd
@@ -1,11 +1,8 @@
#!/bin/bash

PROGRAM=/usr/bin/mpd
-ARGS=""
+ARGS="/etc/sysconfig/mpd"
RUNLEVEL=3
NEEDS=""
-MPD_DB="$(grep music_directory /etc/sysconfig/mpd | cut -d \" -f 2)/mpd.db"
-
-[[ -z $MPD_DB ]] && ARGS="$ARGS --create-db"

. /etc/init.d/smgl_init
diff --git a/scripts/mpd/mpd.conf b/scripts/mpd/mpd.conf
index 2f6d22a..b14337c 100644
--- a/scripts/mpd/mpd.conf
+++ b/scripts/mpd/mpd.conf
@@ -1,245 +1,407 @@
# An example configuration file for MPD
# See the mpd.conf man page for a more detailed description of each
parameter.

-######################## REQUIRED PATHS ########################
-music_directory "/var/lib/mpd/music"
-playlist_directory "/var/lib/mpd/playlists"
-db_file "/var/lib/mpd/mpd.db"
-log_file "/var/log/mpd.log"
-error_file "/var/log/mpd.error"
-################################################################

+# Files and directories
#######################################################
+#
+# This setting controls the top directory which MPD will search to discover
the
+# available audio files and add them to the daemon's online database. This
+# setting defaults to the XDG directory, otherwise the music directory will
be
+# be disabled and audio files will only be accepted over ipc socket (using
+# file:// protocol) or streaming files over an accepted protocol.
+#
+#music_directory "~/music"
+#
+# This setting sets the MPD internal playlist directory. The purpose of this
+# directory is storage for playlists created by MPD. The server will use
+# playlist files not created by the server but only if they are in the MPD
+# format. This setting defaults to playlist saving being disabled.
+#
+#playlist_directory "~/.mpd/playlists"
+#
+# This setting sets the location of the MPD database. This file is used to
+# load the database at server start up and store the database while the
+# server is not up. This setting defaults to disabled which will allow
+# MPD to accept files over ipc socket (using file:// protocol) or streaming
+# files over an accepted protocol.
+#
+#db_file "~/.mpd/database"
+#
+# These settings are the locations for the daemon log files for the daemon.
+# These logs are great for troubleshooting, depending on your log_level
+# settings.
+#
+# The special value "syslog" makes MPD use the local syslog daemon. This
+# setting defaults to logging to syslog, otherwise logging is disabled.
+#
+#log_file "~/.mpd/log"
+#
+# This setting sets the location of the file which stores the process ID
+# for use of mpd --kill and some init scripts. This setting is disabled by
+# default and the pid file will not be stored.
+#
+#pid_file "~/.mpd/pid"
+#
+# This setting sets the location of the file which contains information about
+# most variables to get MPD back into the same general shape it was in before
+# it was brought down. This setting is disabled by default and the server
+# state will be reset on server start up.
+#
+#state_file "~/.mpd/state"
+#
+# The location of the sticker database. This is a database which
+# manages dynamic information attached to songs.
+#
+#sticker_file "~/.mpd/sticker.sql"
+#
+###############################################################################

-######################## OPTIONAL PATHS ########################
+
+# General music daemon options
################################################
+#
+# This setting specifies the user that MPD will run as. MPD should never run
as
+# root and you may use this setting to make MPD change its user ID after
+# initialization. This setting is disabled by default and MPD is run as the
+# current user.
#
-# If you wish to use mpd --kill to stop MPD, then you must
-# specify a file here in which to store MPD's process ID.
+#user "nobody"
#
-#pid_file "~/.mpd/mpd.pid"
+# This setting specifies the group that MPD will run as. If not specified
+# primary group of user specified with "user" setting will be used (if set).
+# This is useful if MPD needs to be a member of group such as "audio" to
+# have permission to use sound card.
#
-# If specified, MPD will save its current state (playlist,
-# current song, playing/paused, etc.) at exit. This will be
-# used to restore the session the next time it is run.
+#group "nogroup"
#
-#state_file "~/.mpd/mpdstate"
+# This setting sets the address for the daemon to listen on. Careful
attention
+# should be paid if this is assigned to anything other then the default, any.
+# This setting can deny access to control of the daemon.
#
-################################################################
+# For network
+#bind_to_address "any"
+#
+# And for Unix Socket
+#bind_to_address "~/.mpd/socket"
+#
+# This setting is the TCP port that is desired for the daemon to get assigned
+# to.
+#
+#port "6600"
+#
+# This setting controls the type of information which is logged. Available
+# setting arguments are "default", "secure" or "verbose". The "verbose"
setting
+# argument is recommended for troubleshooting, though can quickly stretch
+# available resources on limited hardware storage.
+#
+#log_level "default"
+#
+# If you have a problem with your MP3s ending abruptly it is recommended
that
+# you set this argument to "no" to attempt to fix the problem. If this solves
+# the problem, it is highly recommended to fix the MP3 files with vbrfix
+# (available from <http://www.willwap.co.uk/Programs/vbrfix.php>), at which
+# point gapless MP3 playback can be enabled.
+#
+#gapless_mp3_playback "yes"
+#
+# This setting enables MPD to create playlists in a format usable by other
+# music players.
+#
+#save_absolute_paths_in_playlists "no"
+#
+# This setting defines a list of tag types that will be extracted during the
+# audio file discovery process. Optionally, 'comment' can be added to this
+# list.
+#
+#metadata_to_use
"artist,album,title,track,name,genre,date,composer,performer,disc"
+#
+# This setting enables automatic update of MPD's database when files in
+# music_directory are changed.
+#
+#auto_update "yes"
+#
+# Limit the depth of the directories being watched, 0 means only watch
+# the music directory itself. There is no limit by default.
+#
+#auto_update_depth "3"
+#
+###############################################################################


-######################## DAEMON OPTIONS ########################
+# Symbolic link behavior
######################################################
+#
+# If this setting is set to "yes", MPD will discover audio files by
following
+# symbolic links outside of the configured music_directory.
#
-# If started as root, MPD will drop root privileges and run as
-# this user instead. Otherwise, MPD will run as the user it was
-# started by. If left unspecified, MPD will not drop root
-# privileges at all (not recommended).
+#follow_outside_symlinks "yes"
#
-user "musicdaemon"
+# If this setting is set to "yes", MPD will discover audio files by following
+# symbolic links inside of the configured music_directory.
#
-# The address and port to listen on.
+#follow_inside_symlinks "yes"
#
-bind_to_address "any"
-port "6600"
+###############################################################################
+
+
+# Zeroconf / Avahi Service Discovery
##########################################
+#
+# If this setting is set to "yes", service information will be published with
+# Zeroconf / Avahi.
#
-# Controls the amount of information that is logged. Can be
-# "default", "secure", or "verbose".
+#zeroconf_enabled "yes"
#
-log_level "default"
+# The argument to this setting will be the Zeroconf / Avahi unique name for
+# this MPD server on the network.
#
-################################################################
+#zeroconf_name "Music Player"
+#
+###############################################################################


-########################## PERMISSIONS #########################
+# Permissions
#################################################################
#
-# MPD can require that users specify a password before using it.
-# You may specify one ore more here, along with what users who
-# log in with that password are allowed to do.
+# If this setting is set, MPD will require password authorization. The
password
+# can setting can be specified multiple times for different password
profiles.
#
#password "password@read,add,control,admin"
#
-# Specifies what permissions a user who has not logged in with a
-# password has. By default, all users have full access to MPD
-# if no password is specified above, or no access if one or
-# more passwords are specified.
+# This setting specifies the permissions a user has who has not yet logged
in.
#
#default_permissions "read,add,control,admin"
#
-################################################################
+###############################################################################
+

+# Input
#######################################################################
+#
+
+input {
+ plugin "curl"
+# proxy "proxy.isp.com:8080"
+# proxy_user "user"
+# proxy_password "password"
+}
+
+#
+###############################################################################

-########################## AUDIO OUTPUT ########################
+# Audio Output
################################################################
#
-# MPD supports many audio output types, as well as playing
-# through multiple audio outputs at the same time. You can
-# specify one or more here. If you don't specify any, MPD will
-# automatically scan for a usable audio output.
+# MPD supports various audio output types, as well as playing through
multiple
+# audio outputs at the same time, through multiple audio_output settings
+# blocks. Setting this block is optional, though the server will only attempt
+# autodetection for one sound card.
#
-# See <http://mpd.wikia.com/wiki/Configuration#Audio_Outputs>
-# for examples of other audio outputs.
+# See <http://mpd.wikia.com/wiki/Configuration#Audio_Outputs> for examples
of
+# other audio outputs.
#
# An example of an ALSA output:
#
#audio_output {
-# type "alsa"
-# name "My ALSA Device"
-# device "hw:0,0" # optional
-# format "44100:16:2" # optional
+# type "alsa"
+# name "My ALSA Device"
+## device "hw:0,0" # optional
+## format "44100:16:2" # optional
+## mixer_type "hardware" # optional
+## mixer_device "default" # optional
+## mixer_control "PCM" # optional
+## mixer_index "0" # optional
#}
#
# An example of an OSS output:
#
#audio_output {
-# type "oss"
-# name "My OSS Device"
-# device "/dev/dsp" # optional
-# format "44100:16:2" # optional
+# type "oss"
+# name "My OSS Device"
+## device "/dev/dsp" # optional
+## format "44100:16:2" # optional
+## mixer_type "hardware" # optional
+## mixer_device "/dev/mixer" # optional
+## mixer_control "PCM" # optional
#}
#
# An example of a shout output (for streaming to Icecast):
#
#audio_output {
-# type "shout"
-# name "My Shout Stream"
-# host "localhost"
-# port "8000"
-# mount "/mpd.ogg"
-# password "hackme"
-# quality "5.0"
-# bitrate "128"
-# format "44100:16:1"
-# user "source" # optional
-# description "My Stream Description" # optional
-# genre "jazz" # optional
-# public "no" # optional
+# type "shout"
+# encoding "ogg" # optional
+# name "My Shout Stream"
+# host "localhost"
+# port "8000"
+# mount "/mpd.ogg"
+# password "hackme"
+# quality "5.0"
+# bitrate "128"
+# format "44100:16:1"
+## protocol "icecast2" # optional
+## user "source" # optional
+## description "My Stream Description" # optional
+## genre "jazz" # optional
+## public "no" # optional
+## timeout "2" # optional
+## mixer_type "software" # optional
#}
#
-# Force all decoded audio to be converted to this format before
-# being passed to the audio outputs.
+# An example of a recorder output:
#
-#audio_output_format "44100:16:2"
-#
-################################################################
-
-
-############################# MIXER ############################
-#
-# MPD needs to know what mixer settings to change when you
-# adjust the volume. If you don't specify one here, MPD will
-# pick one based on which ones it was compiled with support for.
-#
-# An example for controlling an ALSA mixer:
+#audio_output {
+# type "recorder"
+# name "My recorder"
+# encoder "vorbis" # optional, vorbis or lame
+# path "/var/lib/mpd/recorder/mpd.ogg"
+## quality "5.0" # do not define if bitrate is
defined
+# bitrate "128" # do not define if quality is
defined
+# format "44100:16:1"
+#}
#
-#mixer_type "alsa"
-#mixer_device "default"
-#mixer_control "PCM"
+# An example of a httpd output (built-in HTTP streaming server):
#
-# An example for controlling an OSS mixer:
+#audio_output {
+# type "httpd"
+# name "My HTTP Stream"
+# encoder "vorbis" # optional, vorbis or lame
+# port "8000"
+# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
+## quality "5.0" # do not define if bitrate is
defined
+# bitrate "128" # do not define if quality is
defined
+# format "44100:16:1"
+# max_clients "0" # optional 0=no limit
+#}
#
-#mixer_type "oss"
-#mixer_device "/dev/mixer"
-#mixer_control "PCM"
+# An example of a pulseaudio output (streaming to a remote pulseaudio server)
#
-# If you want MPD to adjust the volume of audio sent to the
-# audio outputs, you can tell it to use the software mixer:
+#audio_output {
+# type "pulse"
+# name "My Pulse Output"
+## server "remote_server" # optional
+## sink "remote_server_sink" # optional
+#}
#
-#mixer_type "software"
+## Example "pipe" output:
#
-################################################################
-
-
-######################### NORMALIZATION ########################
+#audio_output {
+# type "pipe"
+# name "my pipe"
+# command "aplay -f cd 2>/dev/null"
+## Or if you're want to use AudioCompress
+# command "AudioCompress -m | aplay -f cd 2>/dev/null"
+## Or to send raw PCM stream through PCM:
+# command "nc example.org 8765"
+# format "44100:16:2"
+#}
#
-# Specifies the type of ReplayGain to use. Can be "album" or
-# "track". ReplayGain will not be used if not specified. See
-# <http://www.replaygain.org> for more details.
+## An example of a null output (for no audio output):
#
-#replaygain "album"
+#audio_output {
+# type "null"
+# name "My Null Output"
+# mixer_type "none" # optional
+#}
#
-# Sets the pre-amp used for files that have ReplayGain tags.
+# This setting will change all decoded audio to be converted to the specified
+# format before being passed to the audio outputs. By default, this setting
is
+# disabled.
#
-#replaygain_preamp "0"
+#audio_output_format "44100:16:2"
#
-# Enable on the fly volume normalization. This will cause the
-# volume of all songs played to be adjusted so that they sound
-# as though they are of equal loudness.
+# If MPD has been compiled with libsamplerate support, this setting
specifies
+# the sample rate converter to use. Possible values can be found in the
+# mpd.conf man page or the libsamplerate documentation. By default, this is
+# setting is disabled.
#
-#volume_normalization "no"
+#samplerate_converter "Fastest Sinc Interpolator"
#
-################################################################
+###############################################################################


-########################### BUFFERING ##########################
+# Normalization automatic volume adjustments
##################################
#
-# The size of the buffer containing decoded audio. You probably
-# shouldn't change this.
+# This setting specifies the type of ReplayGain to use. This setting can have
+# the argument "off", "album" or "track". See <http://www.replaygain.org>
+# for more details. This setting is off by default.
#
-#audio_buffer_size "2048"
+#replaygain "album"
#
-# How much of the buffer to fill before beginning to play.
+# This setting sets the pre-amp used for files that have ReplayGain tags. By
+# default this setting is disabled.
#
-#buffer_before_play "0%"
+#replaygain_preamp "0"
#
-# Similar options for the HTTP stream buffer. If you hear
-# skipping while playing HTTP streams, you may wish to increase
-# these.
+# This setting enables on-the-fly normalization volume adjustment. This will
+# result in the volume of all playing audio to be adjusted so the output has
+# equal "loudness". This setting is disabled by default.
#
-#http_buffer_size "128"
-#http_prebuffer_size "25%"
+#volume_normalization "no"
#
-################################################################
+###############################################################################


-########################### HTTP PROXY #########################
+# MPD Internal Buffering
######################################################
#
-# Specifies the HTTP proxy to use for playing HTTP streams.
+# This setting adjusts the size of internal decoded audio buffering. Changing
+# this may have undesired effects. Don't change this if you don't know what
you
+# are doing.
#
-#http_proxy_host "proxy.isp.com"
-#http_proxy_port "8080"
-#http_proxy_user "user"
-#http_proxy_password "password"
+#audio_buffer_size "2048"
#
-################################################################
+# This setting controls the percentage of the buffer which is filled before
+# beginning to play. Increasing this reduces the chance of audio file
skipping,
+# at the cost of increased time prior to audio playback.
+#
+#buffer_before_play "10%"
+#
+###############################################################################


-############################# LIMITS ###########################
+# Resource Limitations
########################################################
#
-# These are various limits to prevent MPD from using too many
-# resources. You should only change them if they start
-# restricting your usage of MPD.
+# These settings are various limitations to prevent MPD from using too many
+# resources. Generally, these settings should be minimized to prevent
security
+# risks, depending on the operating resources.
#
-#connection_timeout "60"
-#max_connections "5"
-#max_playlist_length "16384"
-#max_command_list_size "2048"
-#max_output_buffer_size "8192"
+#connection_timeout "60"
+#max_connections "10"
+#max_playlist_length "16384"
+#max_command_list_size "2048"
+#max_output_buffer_size "8192"
#
-################################################################
+###############################################################################


-###################### CHARACTER ENCODINGS #####################
+# Character Encoding
##########################################################
#
-# If file or directory names do not display correctly, then you
-# may need to change this. In most cases it should be either
-# "ISO-8859-1" or "UTF-8". You must recreate your database
-# after changing this (use mpd --create-db).
+# If file or directory names do not display correctly for your locale then
you
+# may need to modify this setting.
#
-#filesystem_charset "ISO-8859-1"
+#filesystem_charset "UTF-8"
#
-# The encoding that ID3v1 tags should be converted from.
+# This setting controls the encoding that ID3v1 tags should be converted
from.
#
-#id3v1_encoding "ISO-8859-1"
+#id3v1_encoding "ISO-8859-1"
#
-################################################################
+###############################################################################


-######################### OTHER OPTIONS ########################
-#
-# The metadata types MPD will recognize.
-#
-#metadata_to_use
"artist,album,title,track,name,genre,date,composer,performer,disc"
-#
-# Enable this if you wish to use your MPD created playlists in
-# other music players.
-#
-#save_absolute_paths_in_playlists "no"
+# SIDPlay decoder
#############################################################
+#
+# songlength_database:
+# Location of your songlengths file, as distributed with the HVSC.
+# The sidplay plugin checks this for matching MD5 fingerprints.
+# See http://www.c64.org/HVSC/DOCUMENTS/Songlengths.faq
+#
+# default_songlength:
+# This is the default playing time in seconds for songs not in the
+# songlength database, or in case you're not using a database.
+# A value of 0 means play indefinitely.
+#
+# filter:
+# Turns the SID filter emulation on or off.
+#
+#decoder {
+# plugin "sidplay"
+# songlength_database "/media/C64Music/DOCUMENTS/Songlengths.txt"
+# default_songlength "120"
+# filter "true"
+#}
#
-################################################################
+###############################################################################
+
diff --git a/scripts/mysql/mysql b/scripts/mysql/mysql
index a04bede..3055426 100644
--- a/scripts/mysql/mysql
+++ b/scripts/mysql/mysql
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind
#
diff --git a/scripts/nas/nasd b/scripts/nas/nasd
index baee4b6..482c236 100755
--- a/scripts/nas/nasd
+++ b/scripts/nas/nasd
@@ -1,10 +1,6 @@
#!/bin/bash

-if [[ -x "/usr/bin/nasd" ]]; then
- PROGRAM="/usr/bin/nasd"
-elif [[ -x "/usr/X11R6/bin/nasd" ]]; then
- PROGRAM="/usr/X11R6/bin/nasd"
-fi
+PROGRAM="/usr/bin/nasd"
RUNLEVEL=3
NEEDS="+remote_fs alsa"

diff --git a/scripts/nessus-core/smgl-nessusd
b/scripts/nessus-core/smgl-nessusd
index 6f4c8a8..b29ff1d 100644
--- a/scripts/nessus-core/smgl-nessusd
+++ b/scripts/nessus-core/smgl-nessusd
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

NAME="Nessus Security Scanner"
PROGRAM=/usr/sbin/nessusd
diff --git a/scripts/net-snmp/snmpd b/scripts/net-snmp/snmpd
new file mode 100755
index 0000000..c490996
--- /dev/null
+++ b/scripts/net-snmp/snmpd
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+. /etc/sysconfig/snmpd
+
+PROGRAM=/usr/sbin/snmpd
+PIDFILE=/var/run/snmpd.pid
+ARGS="-p $PIDFILE $SNMPD_ARGS"
+RUNLEVEL=3
+NEEDS="+network"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/net-snmp/snmpd.conf b/scripts/net-snmp/snmpd.conf
new file mode 100644
index 0000000..e7e2df7
--- /dev/null
+++ b/scripts/net-snmp/snmpd.conf
@@ -0,0 +1,3 @@
+# For the arguments and description see snmpd(8)
+
+SNMPD_ARGS=""
diff --git a/scripts/network-manager/NetworkManager
b/scripts/network-manager/NetworkManager
new file mode 100755
index 0000000..2ee3504
--- /dev/null
+++ b/scripts/network-manager/NetworkManager
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+PROGRAM=/usr/sbin/NetworkManager
+RUNLEVEL=3
+NEEDS="smgl-messagebus hald"
+PROVIDES="network"
+
+. /etc/init.d/smgl_init
+
diff --git a/scripts/nfs-utils/nfs b/scripts/nfs-utils/nfs
index 4be5452..8dacdd2 100644
--- a/scripts/nfs-utils/nfs
+++ b/scripts/nfs-utils/nfs
@@ -2,18 +2,72 @@

PROGRAM=/bin/false
RUNLEVEL=3
-NEEDS="+remote_fs +network +portmap"
+NEEDS="+network +portmap"

. /etc/init.d/smgl_init
. /etc/sysconfig/nfs

-if [ ! -e /etc/exports ] ; then
+if [[ ! -e /etc/exports ]]; then
$FAILURE
echo "Please create an /etc/exports file. Exiting without starting nfs..."
$NORMAL
exit 1
fi

+if [[ -e /usr/sbin/rpc.idmapd ]]; then
+ HASNFS4=1
+fi
+
+# pseudo fs stuff
+mount_nfsd()
+{
+ if grep -q 'nfsd' /proc/filesystems; then
+ if ! grep -q 'nfsd' /etc/mtab; then
+ required_executable /bin/mount
+ echo "mounting nfsd"
+ mount -t nfsd nfsd /proc/fs/nfsd
+ evaluate_retval
+ fi
+ fi
+}
+umount_nfsd()
+{
+ if grep -q 'nfsd' /etc/mtab; then
+ required_executable /bin/umount
+ echo "unmounting nfsd"
+ umount /proc/fs/nfsd
+ evaluate_retval
+ fi
+}
+mount_pipefs()
+{
+ if grep -q 'rpc_pipefs' /proc/filesystems; then
+ if ! grep -q 'rpc_pipefs' /etc/mtab; then
+ required_executable /bin/mount
+ echo "mounting pipefs"
+ mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
+ evaluate_retval
+ fi
+ fi
+}
+umount_pipefs()
+{
+ if grep -q 'rpc_pipefs' /etc/mtab; then
+ required_executable /bin/umount
+ echo "unmounting pipefs"
+ umount /var/lib/nfs/rpc_pipefs
+ evaluate_retval
+ fi
+}
+
+# for making sure these exist
+mknfsdirs() {
+ local d
+ for d in /var/lib/nfs/{rpc_pipefs,v4recovery,v4root}; do
+ [[ ! -d "${d}" ]] && mkdir -p "${d}"
+ done
+}
+
# may be outsourced
get_kernel_pids()
{
@@ -30,51 +84,87 @@ get_kernel_pids()

start()
{
- echo "Starting full NFS services (server & locking)"
- # why do we reexport before the daemons are up?
- # doesn't seem to matter much
- required_executable /usr/sbin/exportfs
- echo -n "exportfs"
- /usr/sbin/exportfs -r
- evaluate_retval
+ local bins
+ echo "Starting NFS services (client & server)"
+
+ bins="statd nfsd mountd"
+ if [[ ! -z $HASNFS4 ]]; then
+ mknfsdirs
+ mount_nfsd
+ mount_pipefs
+ bins="${bins} idmapd"
+ fi
+
+ for b in $bins; do
+ required_executable /usr/sbin/rpc.$b
+ done

# nfs-howto says: these daemons in this order
# userspace does not bother about lockd since linux 2.2.18
- for d in mountd nfsd statd rquotad
- do
- required_executable /usr/sbin/rpc.$d
- local opts=
- if [[ $d == mountd ]]; then opts="$MOUNTDOPTS"
- if [[ ! -z "$MOUNTD_PORT" ]]; then opts="$opts -p $MOUNTD_PORT"
- fi
- elif [[ $d == nfsd ]]; then opts="$NUMSERVERS"
- elif [[ $d == statd && ! -z $STATD_PORT ]]; then opts="-p $STATD_PORT"
+ for d in ${bins} rquotad; do
+ if [[ -x /usr/sbin/rpc.$d ]]; then
+ local opts=
+
+ if [[ $d == 'mountd' ]]; then
+ opts="$MOUNTDOPTS"
+
+ if [[ ! -z "$MOUNTD_PORT" ]]; then
+ opts="$opts -p $MOUNTD_PORT"
+ fi
+ elif [[ $d == 'nfsd' ]]; then
+ opts="$NUMSERVERS"
+ elif [[ $d == 'statd' && ! -z $STATD_PORT ]]; then
+ opts="-p $STATD_PORT"
+ fi
+
+ echo -n $d
+ loadproc /usr/sbin/rpc.$d $opts
fi
- echo -n $d
- loadproc /usr/sbin/rpc.$d $opts
done
+
+ required_executable /usr/sbin/exportfs
+ echo -n "exportfs"
+ /usr/sbin/exportfs -r
+ evaluate_retval
}

stop()
{
- echo "Stopping NFS services"
+ local bins
+ echo "Stopping NFS services (client & server)"
echo -n "unexporting filesystems"
/usr/sbin/exportfs -au
evaluate_retval
+
+ bins="statd nfsd mountd"
+ if [[ ! -z $HASNFS4 ]]; then
+ umount pipefs
+ umount_nfsd
+ bins="${bins} idmapd"
+ fi
+
+ for b in $bins; do
+ required_executable /usr/sbin/rpc.$b
+ done

# all in one loop to simplify code, reversed order
# atm. only nfsd is really in-kernel (and lockd self-managed)
- for d in rquotad statd nfsd mountd
- do
- local kpid=$(get_kernel_pids $d)
- if [[ -z $kpid ]]; then
- echo -n "killing $d"
- killproc /usr/sbin/rpc.$d
- else
- echo "not killing kernel $d (PID $kpid)"
+ for d in ${bins} rquotad; do
+ if [[ -x /usr/sbin/rpc.$d ]]; then
+ local kpid=$(get_kernel_pids $d)
+
+ if [[ -z $kpid ]]; then
+ echo -n "killing $d"
+ killproc /usr/sbin/rpc.$d
+ else
+ if [[ $d == 'nfsd' ]]; then
+ echo "Removing kernel nfsd"
+ /usr/sbin/rpc.nfsd 0
+ else
+ echo "not killing kernel $d (PID=${kpid})"
+ fi
+ fi
fi
- echo "Removing kernel nfsd"
- /usr/sbin/rpc.nfsd 0
done
}

diff --git a/scripts/nfs-utils/nfsidmap b/scripts/nfs-utils/nfsidmap
new file mode 100644
index 0000000..35f67c1
--- /dev/null
+++ b/scripts/nfs-utils/nfsidmap
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+PROGRAM=/usr/sbin/rpc.idmapd
+RUNLEVEL=3
+NEEDS="+network +portmap"
+
+. /etc/init.d/smgl_init
+
+# pseudo fs stuff
+mount_pipefs()
+{
+ if grep -q rpc_pipefs /proc/filesystems; then
+ if ! grep -q rpc_pipefs /etc/mtab; then
+ required_executable /bin/mount
+ echo "mounting pipefs"
+ mkdir -p /var/lib/nfs/rpc_pipefs
+ mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
+ evaluate_retval
+ fi
+ fi
+}
+umount_pipefs()
+{
+ if grep -q rpc_pipefs /etc/mtab; then
+ required_executable /bin/umount
+ echo "unmounting pipefs pseudofs"
+ umount /var/lib/nfs/rpc_pipefs
+ evaluate_retval
+ fi
+}
+
+start()
+{
+ required_executable ${PROGRAM}
+ mount_pipefs
+ loadproc ${PROGRAM}
+}
+
+stop()
+{
+ required_executable ${PROGRAM}
+ killproc ${PROGRAM}
+ umount_pipefs
+}
diff --git a/scripts/nfs-utils/nfslock b/scripts/nfs-utils/nfslock
index 2f46cd1..81b125c 100644
--- a/scripts/nfs-utils/nfslock
+++ b/scripts/nfs-utils/nfslock
@@ -2,7 +2,7 @@

PROGRAM=/bin/false
RUNLEVEL=3
-NEEDS="+remote_fs +network +portmap"
+NEEDS="+network +portmap"

. /etc/init.d/smgl_init

diff --git a/scripts/nginx/nginx b/scripts/nginx/nginx
new file mode 100644
index 0000000..93ec2ac
--- /dev/null
+++ b/scripts/nginx/nginx
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+PIDFILE=/var/run/nginx.pid
+PROGRAM=/usr/sbin/nginx
+ARGS="-c /etc/nginx/nginx.conf"
+RUNLEVEL=3
+NEEDS="+network +remote_fs"
+
+reload() {
+ echo "Gracefully reloading Nginx web server..."
+
+ if [[ `nginx -v 2>&1 | cut -d. -f2` == 6 ]]; then
+ kill -HUP "$PIDFILE"
+ else
+ $PROGRAM -s reload
+ fi
+ evaluate_retval
+}
+
+. /etc/init.d/smgl_init
diff --git a/scripts/niced/niced b/scripts/niced/niced
new file mode 100755
index 0000000..b200bf0
--- /dev/null
+++ b/scripts/niced/niced
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+. /etc/sysconfig/niced
+
+PROGRAM=/usr/sbin/niced
+RUNLEVEL=S
+ARGS="$CONFIG"
+NEEDS="+local_fs"
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ $PROGRAM $ARGS &
+}
diff --git a/scripts/niced/niced.conf b/scripts/niced/niced.conf
new file mode 100644
index 0000000..75d9a59
--- /dev/null
+++ b/scripts/niced/niced.conf
@@ -0,0 +1,4 @@
+# This is the niced config file.
+#
+# Set the CONFIG variable to pass startup parameters needed by your nice
daemon.
+CONFIG="-d"
diff --git a/scripts/nsd/nsd b/scripts/nsd/nsd
index 6795229..62404a5 100755
--- a/scripts/nsd/nsd
+++ b/scripts/nsd/nsd
@@ -1,7 +1,7 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/sbin/nsd
-PIDFILE=/var/run/nsd.pid
+PIDFILE=/var/nsd/nsd.pid
RUNLEVEL=3
NEEDS="+network +remote_fs"

diff --git a/scripts/nss-pam-ldapd/nslcd b/scripts/nss-pam-ldapd/nslcd
new file mode 100644
index 0000000..dd8a111
--- /dev/null
+++ b/scripts/nss-pam-ldapd/nslcd
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+PIDFILE=/var/run/nslcd/nslcd.pid
+PROGRAM=/usr/sbin/nslcd
+RUNLEVEL=3
+NEEDS="+network +remote_fs"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/ntop/ntop b/scripts/ntop/ntop
index 4879f0a..aaaba9f 100644
--- a/scripts/ntop/ntop
+++ b/scripts/ntop/ntop
@@ -2,9 +2,8 @@

. /etc/sysconfig/ntop

-if [ -d /etc/sysconfig/network ] ; then
- for i in /etc/sysconfig/network/*.dev ; do
- i=$( basename ${i%.dev} )
+if [ -f /etc/network/interfaces ] ; then
+ for i in $(grep "^iface" /etc/network/interfaces | awk '{print $2}') ; do
[ "$i" = "lo" -a "$IGNORE_LO" = "yes" ] && continue
IFACES="${IFACES},$i"
done
@@ -13,8 +12,8 @@ fi

PROGRAM=/usr/bin/ntop
NAME="ntop (using following interfaces: ${IFACES}"
-ARGS="-d -u ntop -w $HTTP_PORT -W $HTTPS_PORT \
- --use-syslog=daemon -i ${IFACES} -M"
+ARGS="-d -u ntop -w $HTTP_PORT -W $HTTPS_PORT ${W3C} \
+ --use-syslog=daemon -i ${IFACES} ${INTERFACE_MERGE}"
RUNLEVEL=3
NEEDS="+network +remote_fs"

diff --git a/scripts/ntop/ntop.conf b/scripts/ntop/ntop.conf
index cf994df..65202c5 100644
--- a/scripts/ntop/ntop.conf
+++ b/scripts/ntop/ntop.conf
@@ -8,3 +8,15 @@ HTTP_PORT=0
# Which https port (SSL encrytion enabled) should ntop listen to? When set
to 0
# then the https server is disabled (default: 3000)
HTTPS_PORT=3000
+
+# This option instructs ntop not to merge network interfaces together.
+# This means that ntop will collect statistics for each interface
+# and report them separately.
+INTERFACE_MERGE='--no-interface-merge'
+
+# By default, ntop generates displayable but not great html. There are a
+# number of tags we do not generate because they cause problems with older
+# browsers which are still commonly used or are important to look good on
+# real-world browsers. This flag tells ntop to generate 'BETTER' (but not
+# perfect) w3c compliant html 4.01 output.
+#W3C='--w3c'
diff --git a/scripts/nylon/nylon b/scripts/nylon/nylon
new file mode 100755
index 0000000..e29f049
--- /dev/null
+++ b/scripts/nylon/nylon
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+PROGRAM=/usr/bin/nylon
+PIDFILE=/var/run/nylon.pid
+ARGS="-c /etc/sysconfig/nylon -P $PIDFILE"
+RUNLEVEL=3
+NEEDS="+network"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/nylon/nylon.conf b/scripts/nylon/nylon.conf
new file mode 100644
index 0000000..a65abec
--- /dev/null
+++ b/scripts/nylon/nylon.conf
@@ -0,0 +1,34 @@
+# general settings
+[General]
+
+# number of simultaneous connections allowed
+No-Simultaneous-Conn=10
+
+# log connections and other information to syslog? 1: on, 0: off
+Log=1
+
+# be verbose on the console? 1: on, 0: off
+Verbose=0
+
+# store pid file
+#PIDfile=/tmp/nylon.pid
+
+# server settings
+[Server]
+
+# interface to listen to connections
+#Binding-Interface=fxp1
+
+# interface to bind outgoing connections to
+#Connecting-Interface=fxp0
+
+# listening port to bind to
+Port=1080
+
+# allowed is processed first, then deny
+
+# allowable connect ips/ranges
+#Allow-IP=141.0.0.0/8 127.0.0.1 10.0.0.0/24
+Allow-IP=127.0.0.1/32
+# denied connect ips/ranges
+#Deny-IP=10.0.0.0/24
diff --git a/scripts/ocfs2-tools/ocfs2 b/scripts/ocfs2-tools/ocfs2
new file mode 100755
index 0000000..ff05e17
--- /dev/null
+++ b/scripts/ocfs2-tools/ocfs2
@@ -0,0 +1,96 @@
+#!/bin/bash
+
+# Copyright (c) 2005 Oracle
+# All rights reserved.
+#
+# Copyright (c) 2011 Source Mage Team
+# Vlad Glagolev
+
+. /etc/sysconfig/ocfs2
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="+local_fs +network"
+
+. /etc/init.d/smgl_init
+
+MOUNT="/bin/mount"
+UMOUNT="/bin/umount"
+O2CB_CTL="/sbin/o2cb_ctl"
+
+OCFS2_CLUSTER=$( sed -re 's/[[:space:]]+//g' $OCFS2_CONFIG | grep -A4
"cluster:" | grep 'name=' | cut -d= -f2 )
+
+function check_pseudofs() {
+ if [ -z "`$MOUNT -l -t configfs`" ] || [ -z "`$MOUNT -l -t ocfs2_dlmfs`"
]; then
+ echo "One or more pseudo-filesystems required for OCFS2 are not mounted."
+ echo "Make sure you have following lines in your /etc/fstab:"
+ echo "none /config configfs defaults 0 0"
+ echo "none /dlm ocfs2_dlmfs defaults 0 0"
+
+ return 1
+ fi
+}
+
+function ocfs2mounts() {
+ LC_ALL=C awk '$3 == "ocfs2" { print $2 }' /proc/mounts
+}
+
+function ocfs2fstab() {
+ LC_ALL=C awk '!/^#/ && $3 == "ocfs2" && $4 !~ /noauto/ { print $2 }'
/etc/fstab
+}
+
+start() {
+ check_pseudofs || exit 1
+
+ echo "Starting OCFS2 cluster..."
+
+ for cluster in ${OCFS2_CLUSTER}; do
+ $O2CB_CTL -H -n ${cluster} -t cluster -a online=yes >/dev/null 2>&1
+ evaluate_retval
+ done
+}
+
+stop() {
+ echo "Unmounting OCFS2 filesystems..."
+
+ remaining="`ocfs2mounts`"
+ retry=3
+
+ while [ -n "$remaining" -a "$retry" -gt 0 ]; do
+ $UMOUNT -a -t ocfs2 2>/dev/null
+ sleep 1
+
+ remaining="`ocfs2mounts`"
+
+ [ -z "$remaining" ] && break
+
+ retry=$(($retry - 1))
+ done
+
+ if [ ! -z "$remaining" ]; then
+ print_status failure
+ exit 1
+ fi
+
+ echo "Stopping OCFS2 cluster..."
+
+ for cluster in ${OCFS2_CLUSTER}; do
+ $O2CB_CTL -H -n ${cluster} -t cluster -a online=no >/dev/null 2>&1
+ evaluate_retval
+ done
+}
+
+restart() {
+ echo "Restarting OCFS2 cluster..."
+
+ stop
+ sleep 1
+ start
+}
+
+status() {
+ if [ -f /proc/mounts ]; then
+ [ -n "`ocfs2fstab`" ] && echo "Configured OCFS2 mountpoints: "
`ocfs2fstab`
+ [ -n "`ocfs2mounts`" ] && echo "Active OCFS2 mountpoints: " `ocfs2mounts`
+ fi
+}
diff --git a/scripts/ocfs2-tools/ocfs2.conf b/scripts/ocfs2-tools/ocfs2.conf
new file mode 100644
index 0000000..d8210aa
--- /dev/null
+++ b/scripts/ocfs2-tools/ocfs2.conf
@@ -0,0 +1,3 @@
+# Full path to OCFS2 cluster configuration file
+
+OCFS2_CONFIG="/etc/ocfs2/cluster.conf"
diff --git a/scripts/openldap/slapd b/scripts/openldap/slapd
index fd185ea..fad4850 100755
--- a/scripts/openldap/slapd
+++ b/scripts/openldap/slapd
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# SMGL-script-version=20030224
# SMGL-START:1 2 3 4 5:S35
diff --git a/scripts/openmosix-tools/openmosix
b/scripts/openmosix-tools/openmosix
index 63b1325..6d15706 100755
--- a/scripts/openmosix-tools/openmosix
+++ b/scripts/openmosix-tools/openmosix
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/bin/true
RUNLEVEL=3
diff --git a/scripts/openmosixview/mosstatd.sh
b/scripts/openmosixview/mosstatd.sh
index 1957f44..8d5d962 100644
--- a/scripts/openmosixview/mosstatd.sh
+++ b/scripts/openmosixview/mosstatd.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# mosstatd This shell script takes care of starting and stopping \
# the mosstatd daemon.

diff --git a/scripts/openmosixview/openmosixcollector
b/scripts/openmosixview/openmosixcollector
index f8f4558..4350ef0 100644
--- a/scripts/openmosixview/openmosixcollector
+++ b/scripts/openmosixview/openmosixcollector
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/bin/openmosixcollector
ARGS=""
diff --git a/scripts/openssh/sshd b/scripts/openssh/sshd
index c90f1e8..ef1d1e9 100755
--- a/scripts/openssh/sshd
+++ b/scripts/openssh/sshd
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/sbin/sshd
RUNLEVEL=3
diff --git a/scripts/openwbem/owcimomd b/scripts/openwbem/owcimomd
new file mode 100644
index 0000000..1a1ce4a
--- /dev/null
+++ b/scripts/openwbem/owcimomd
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+PROGRAM=/usr/sbin/owcimomd
+NEEDS="+network"
+RUNLEVEL=3
+
+. /etc/init.d/smgl_init
diff --git a/scripts/pglogd/pglogd.sh b/scripts/pglogd/pglogd.sh
index 33e7b80..e752d0f 100644
--- a/scripts/pglogd/pglogd.sh
+++ b/scripts/pglogd/pglogd.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Source Mage init.d install information
# SMGL-script-version=20030331
diff --git a/scripts/pikt/piktsvc b/scripts/pikt/piktsvc
index fe95df6..3a49ad4 100755
--- a/scripts/pikt/piktsvc
+++ b/scripts/pikt/piktsvc
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

RUNLEVEL=3
PROGRAM=/usr/bin/piktc_svc
diff --git a/scripts/pks/pks b/scripts/pks/pks
index 03865aa..4532b8b 100755
--- a/scripts/pks/pks
+++ b/scripts/pks/pks
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/sbin/pksd
RUNLEVEL=3
diff --git a/scripts/popfile/popfile b/scripts/popfile/popfile
index 34bfd56..b510c62 100755
--- a/scripts/popfile/popfile
+++ b/scripts/popfile/popfile
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Startup/shutdown script for popfile
#
diff --git a/scripts/postgresql/postgresql b/scripts/postgresql/postgresql
index 8b0021f..f9e9393 100644
--- a/scripts/postgresql/postgresql
+++ b/scripts/postgresql/postgresql
@@ -14,7 +14,7 @@ start()
if [[ ! -z "$PORT" ]]; then
PGPORT="-p $PORT"
fi &&
- if [[ $LOGFILE != syslog ]]; then
+ if [[ $LOGFILE ]]; then
PGLOG="-l $LOGFILE"
fi &&
su $USER -s /bin/sh -c "pg_ctl start -D $DBPATH $PGLOG -o '$PGPORT'"
@@ -32,7 +32,7 @@ stop()
reload()
{
echo "Reloading postmaster configuration..."
- cd "$DBPATH" &&
- su $USER -s /bin/sh -c "pg_ctl reload -D $DBPATH"
- evaluate_retval
+ cd "$DBPATH" &&
+ su $USER -s /bin/sh -c "pg_ctl reload -D $DBPATH"
+ evaluate_retval
}
diff --git a/scripts/postgresql/postgresql.conf
b/scripts/postgresql/postgresql.conf
index 09429f0..a32c85b 100644
--- a/scripts/postgresql/postgresql.conf
+++ b/scripts/postgresql/postgresql.conf
@@ -4,7 +4,7 @@ USER=postgres
# you initdb here
DBPATH=/var/lib/postgres/data

-# this is where the logs go. Use 'syslog' if you want to log to syslog.
+# this is where the logs go
LOGFILE=/var/log/postgres

# Network TCP port to listen on, default is 5432
diff --git a/scripts/postgrey/postgrey b/scripts/postgrey/postgrey
new file mode 100755
index 0000000..4af42aa
--- /dev/null
+++ b/scripts/postgrey/postgrey
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+. /etc/sysconfig/postgrey
+
+PROGRAM=/usr/libexec/postgrey
+PIDFILE=/var/run/postgrey.pid
+ARGS="-d --pidfile=$PIDFILE $POSTGREY_ARGS"
+RUNLEVEL=3
+NEEDS="+network"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/postgrey/postgrey.conf b/scripts/postgrey/postgrey.conf
new file mode 100644
index 0000000..b8861dc
--- /dev/null
+++ b/scripts/postgrey/postgrey.conf
@@ -0,0 +1,3 @@
+# For the arguments and description see ``postgrey --help''
+
+POSTGREY_ARGS="-i 2525"
diff --git a/scripts/preload/preload b/scripts/preload/preload
new file mode 100755
index 0000000..c62f1fa
--- /dev/null
+++ b/scripts/preload/preload
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+PROGRAM=/usr/sbin/preload
+RUNLEVEL=1
+NEEDS="+local_fs"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/privoxy/junkbuster b/scripts/privoxy/junkbuster
index 53dd1db..ce65499 100755
--- a/scripts/privoxy/junkbuster
+++ b/scripts/privoxy/junkbuster
@@ -1,10 +1,9 @@
#!/bin/bash

PROGRAM=/usr/sbin/privoxy
-ARGS="/etc/privoxy/config"
+PIDFILE=/var/run/privoxy.pid
+ARGS="--pidfile $PIDFILE --user nobody.nogroup /etc/privoxy/config"
RUNLEVEL=3
NEEDS="+remote_fs"

. /etc/init.d/smgl_init
-
-
diff --git a/scripts/prosody/smgl-prosody b/scripts/prosody/smgl-prosody
new file mode 100644
index 0000000..bb601a4
--- /dev/null
+++ b/scripts/prosody/smgl-prosody
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+PROGRAM="/usr/bin/prosody"
+ARGS="start"
+RUNLEVEL=3
+NEEDS="+remote_fs +network"
+
+. /etc/init.d/smgl_init
+
+start() {
+ echo -n "Starting Prosody..."
+ su -s /bin/bash -c "/usr/bin/prosodyctl start"
+ evaluate_retval
+}
+
+stop() {
+ echo -n "Stopping Prosody..."
+ su -s /bin/bash -c "/usr/bin/prosodyctl stop"
+ evaluate_retval
+}
+
+restart() {
+ echo -n "Restarting Prosody..."
+ su -s /bin/bash -c "/usr/bin/prosodyctl restart"
+ evaluate_retval
+}
+
+status() {
+ su -s /bin/bash -c "/usr/bin/prosodyctl status"
+}
diff --git a/scripts/queue/queue b/scripts/queue/queue
index 5a620bd..6ee024e 100644
--- a/scripts/queue/queue
+++ b/scripts/queue/queue
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

RUNLEVEL=3
PROGRAM=/usr/sbin/queued
diff --git a/scripts/ratbox-services/rserv b/scripts/ratbox-services/rserv
new file mode 100755
index 0000000..3134d94
--- /dev/null
+++ b/scripts/ratbox-services/rserv
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+PROGRAM=/usr/sbin/ratbox-services
+PIDFILE=/var/run/rserv/ratbox-services.pid
+RUNLEVEL=3
+NEEDS="+network"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/rpcbind/rpcbind b/scripts/rpcbind/rpcbind
new file mode 100644
index 0000000..ba9083d
--- /dev/null
+++ b/scripts/rpcbind/rpcbind
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+PROGRAM="/usr/bin/rpcbind"
+RUNLEVEL=3
+PROVIDES="portmap"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/rsyslog/rsyslog b/scripts/rsyslog/rsyslog
index 2900757..115ab0e 100644
--- a/scripts/rsyslog/rsyslog
+++ b/scripts/rsyslog/rsyslog
@@ -4,13 +4,11 @@

PIDFILE=/var/run/rsyslogd.pid
PROGRAM=/usr/sbin/rsyslogd
-ARGS="-c${COMPAT}"
+[ -n "${COMPAT}" ] && ARGS="-c${COMPAT}"
RUNLEVEL=S
NEEDS="+local_fs"
PROVIDES=syslog

-if ! [[ -z ${RSYSLOG_CONFIG} ]]; then
- ARGS="${ARGS} -f ${RSYSLOG_CONFIG}"
-fi
+[ -n "${RSYSLOG_CONFIG}" ] && ARGS="${ARGS} -f ${RSYSLOG_CONFIG}"

. /etc/init.d/smgl_init
diff --git a/scripts/rsyslog/rsyslog.conf b/scripts/rsyslog/rsyslog.conf
index b6e37de..8f0fd78 100644
--- a/scripts/rsyslog/rsyslog.conf
+++ b/scripts/rsyslog/rsyslog.conf
@@ -1,6 +1,6 @@
# Configuration compatibility
-VERSION=$(/usr/sbin/rsyslogd -v | head -n1 | gawk '{print $2}' | sed -e
's/,//')
-COMPAT=${VERSION:0:1}
+#COMPAT_VERSION=$(/usr/sbin/rsyslogd -v | head -n1 | gawk '{print $2}' | sed
-e 's/,//')
+#COMPAT=${COMPAT_VERSION:0:1}

# Full path to configuration file (and its filename)
-RSYSLOG_CONFIG="/etc/rsyslog.conf"
+#RSYSLOG_CONFIG="/etc/rsyslog.conf"
diff --git a/scripts/samba/samba b/scripts/samba/samba
index ca653d3..1db8804 100644
--- a/scripts/samba/samba
+++ b/scripts/samba/samba
@@ -9,6 +9,8 @@ ARGS="-D"

start()
{
+ . /etc/sysconfig/samba
+
if [ ! -e /var/run/samba ]; then
mkdir /var/run/samba
fi &&
diff --git a/scripts/samba/samba.conf b/scripts/samba/samba.conf
new file mode 100644
index 0000000..1391056
--- /dev/null
+++ b/scripts/samba/samba.conf
@@ -0,0 +1,8 @@
+# issue some commands before starting samba
+#
+# Example:
+#
+# export LDAPTLS_REQCERT=demand
+# export LDAPTLS_CERT="/etc/openldap/client.crt"
+# export LDAPTLS_KEY="/etc/openldap/client.key"
+# export LDAPTLS_CACERT="/etc/ssl/ca.crt"
diff --git a/scripts/scanlogd/scanlogd b/scripts/scanlogd/scanlogd
index 556d362..1dfb2f9 100755
--- a/scripts/scanlogd/scanlogd
+++ b/scripts/scanlogd/scanlogd
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

RUNLEVEL=3
NEEDS="+remote_fs"
diff --git a/scripts/scim/scim b/scripts/scim/scim
index 389e636..e3b2613 100755
--- a/scripts/scim/scim
+++ b/scripts/scim/scim
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM="/usr/bin/scim"
RUNLEVEL=3
diff --git a/scripts/shorewall6-lite/shorewall6
b/scripts/shorewall6-lite/shorewall6
new file mode 100644
index 0000000..1f2f194
--- /dev/null
+++ b/scripts/shorewall6-lite/shorewall6
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+RUNLEVEL=3
+PROGRAM=/sbin/shorewall6
+NEEDS="+network +remote_fs"
+
+. /etc/init.d/smgl_init
+. /etc/sysconfig/shorewall6
+
+start()
+{
+ # Shorewall needs /var/log/messages to exist
+ if [[ ! -f /var/log/messages ]]
+ then
+ touch /var/log/messages
+ fi &&
+ # Create shorewall log file if it doesn't exist
+ if [[ ! -f $SHOREWALL_LOG ]]
+ then
+ touch $SHOREWALL_LOG
+ fi &&
+ # Shorewall needs subsys
+ if [[ ! -d /var/lock/subsys/ ]]
+ then
+ mkdir -p /var/lock/subsys/
+ fi &&
+ echo Starting Shorewall... &&
+ ( unset -f echo; date "$DATE_FORMAT" >> $SHOREWALL_LOG 2>&1 ; ) &&
+ ( unset -f echo; ${PROGRAM} start >> $SHOREWALL_LOG 2>&1 ; )
+}
+
+stop()
+{
+ echo Stopping Shorewall... &&
+ ( unset -f echo; date "$DATE_FORMAT" >> $SHOREWALL_LOG 2>&1 ; ) &&
+ ( unset -f echo; ${PROGRAM} stop >> $SHOREWALL_LOG 2>&1 ; )
+}
+
+status()
+{
+ ( unset -f echo; ${PROGRAM} status ; )
+}
+
+reload()
+{
+ ( unset -f echo; ${PROGRAM} refresh ; )
+}
diff --git a/scripts/shorewall6-lite/shorewall6.conf
b/scripts/shorewall6-lite/shorewall6.conf
new file mode 100644
index 0000000..e1b712f
--- /dev/null
+++ b/scripts/shorewall6-lite/shorewall6.conf
@@ -0,0 +1,5 @@
+# Full path to the log file.
+SHOREWALL_LOG=/var/log/shorewall.log
+
+# As described in 'man date'. The value must begin with a + symbol.
+DATE_FORMAT="+%F %T"
diff --git a/scripts/slim/slim b/scripts/slim/slim
index 3bb6ae1..3af30cb 100755
--- a/scripts/slim/slim
+++ b/scripts/slim/slim
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#

PROGRAM=/usr/bin/slim
diff --git a/scripts/smartmontools/smartd b/scripts/smartmontools/smartd
index c356099..a60935b 100755
--- a/scripts/smartmontools/smartd
+++ b/scripts/smartmontools/smartd
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/sbin/smartd
PROGRAM_FLAGS="-p /var/run/smartd.pid"
diff --git a/scripts/softflowd/softflowd b/scripts/softflowd/softflowd
new file mode 100755
index 0000000..108a97d
--- /dev/null
+++ b/scripts/softflowd/softflowd
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+. /etc/sysconfig/softflowd
+
+PROGRAM=/usr/sbin/softflowd
+ARGS="$SOFTFLOWD_ARGS"
+RUNLEVEL=3
+PIDFILE=/var/run/softflowd.pid
+NEEDS="+network"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/softflowd/softflowd.conf
b/scripts/softflowd/softflowd.conf
new file mode 100644
index 0000000..622f6c4
--- /dev/null
+++ b/scripts/softflowd/softflowd.conf
@@ -0,0 +1,3 @@
+# For the arguments and description see softflowd(8)
+
+SOFTFLOWD_ARGS="-i eth0"
diff --git a/scripts/splashy/splashy b/scripts/splashy/splashy
index 23a5fbe..782e59b 100755
--- a/scripts/splashy/splashy
+++ b/scripts/splashy/splashy
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

#grep -q -e '[[:space:]]splash\([[:space:]]\|$\)' /proc/cmdline || exit 1

diff --git a/scripts/splashy/splashy1 b/scripts/splashy/splashy1
index dce8159..65b8f70 100755
--- a/scripts/splashy/splashy1
+++ b/scripts/splashy/splashy1
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/bin/false
RUNLEVEL=1
diff --git a/scripts/splashy/splashy2 b/scripts/splashy/splashy2
index 1e4aa30..40cdb9c 100755
--- a/scripts/splashy/splashy2
+++ b/scripts/splashy/splashy2
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/bin/false
RUNLEVEL=2
diff --git a/scripts/splashy/splashy3 b/scripts/splashy/splashy3
index ee5c6da..eb1fdbc 100755
--- a/scripts/splashy/splashy3
+++ b/scripts/splashy/splashy3
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/bin/false
RUNLEVEL=3
diff --git a/scripts/splashy/splashy4 b/scripts/splashy/splashy4
index 1ae6dc1..4257fb3 100755
--- a/scripts/splashy/splashy4
+++ b/scripts/splashy/splashy4
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/bin/false
RUNLEVEL=4
diff --git a/scripts/splashy/splashy5 b/scripts/splashy/splashy5
index ba446ca..6b97f6e 100755
--- a/scripts/splashy/splashy5
+++ b/scripts/splashy/splashy5
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/bin/false
RUNLEVEL=5
diff --git a/scripts/subversion/subversion b/scripts/subversion/subversion
new file mode 100755
index 0000000..13f437e
--- /dev/null
+++ b/scripts/subversion/subversion
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+. /etc/sysconfig/subversion
+
+PIDFILE=/var/run/subversion.pid
+PROGRAM=/usr/bin/svnserve
+RUNLEVEL=3
+NEEDS="+network +remote_fs"
+
+OPTS="-d --pid-file $PIDFILE -r $REPOSITORIES"
+[[ -n "$LISTEN_HOST" ]] && OPTS="$OPTS --listen-host=$LISTEN_HOST"
+[[ -n "$LISTEN_PORT" ]] && OPTS="$OPTS --listen-port=$LISTEN_PORT"
+[[ "$READ_ONLY" =~ "^[Yy].*$" ]] && OPTS="$OPTS -R"
+[[ "$THREADS" =~ "^[Yy].*$" ]] && OPTS="$OPTS -T"
+
+. /etc/init.d/smgl_init
+
+start()
+{
+ loadproc "${PROGRAM}" $OPTS
+}
diff --git a/scripts/subversion/subversion.conf
b/scripts/subversion/subversion.conf
new file mode 100644
index 0000000..f6f7206
--- /dev/null
+++ b/scripts/subversion/subversion.conf
@@ -0,0 +1,20 @@
+# Location of the SVN Repositories
+REPOSITORIES="/srv/svn/repositories"
+
+# Listening Host
+# Either a hostname or IP address that the server binds to
+# Defaults to 0.0.0.0 if unspecified
+LISTEN_HOST=""
+
+# Listening Port
+# Defaults to 3690 if unspecified
+LISTEN_PORT=""
+
+# Read Only
+# Controls whether the server is in read-only mode or not
+READ_ONLY="NO"
+
+# Threading
+# Controllers whether the server uses thread to handle request, as opposed to
+# forked processes
+THREADS="NO"
diff --git a/scripts/system-tools-backends/system-tools-backends
b/scripts/system-tools-backends/system-tools-backends
index 0c23dab..c6b33e0 100644
--- a/scripts/system-tools-backends/system-tools-backends
+++ b/scripts/system-tools-backends/system-tools-backends
@@ -1,6 +1,6 @@
#!/bin/bash

-PROGRAM="/usr/bin/system-tools-backends"
+PROGRAM="/usr/sbin/system-tools-backends"
RUNLEVEL=5
NEEDS="smgl-messagebus"

diff --git a/scripts/tinyproxy/tinyproxy b/scripts/tinyproxy/tinyproxy
new file mode 100755
index 0000000..1f5bf89
--- /dev/null
+++ b/scripts/tinyproxy/tinyproxy
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+PIDFILE=/var/run/tinyproxy/tinyproxy.pid
+PROGRAM=/usr/sbin/tinyproxy
+ARGS="-c /etc/tinyproxy.conf"
+RUNLEVEL=3
+NEEDS="+network +remote_fs"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/tor/tor b/scripts/tor/tor
new file mode 100755
index 0000000..bfb543d
--- /dev/null
+++ b/scripts/tor/tor
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+. /etc/sysconfig/tor
+
+PROGRAM=/usr/bin/tor
+PIDFILE=/var/run/tor/tor.pid
+ARGS="--runasdaemon 1 --pidfile $PIDFILE $TOR_ARGS"
+RUNLEVEL=3
+NEEDS="+network"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/tor/tor.conf b/scripts/tor/tor.conf
new file mode 100644
index 0000000..06ea1e5
--- /dev/null
+++ b/scripts/tor/tor.conf
@@ -0,0 +1,3 @@
+# For the arguments and description see tor(1)
+
+TOR_ARGS="--quiet --user tor --datadirectory /var/lib/tor"
diff --git a/scripts/udev/copy-persistent-rules
b/scripts/udev/copy-persistent-rules
index c55ba99..7357201 100755
--- a/scripts/udev/copy-persistent-rules
+++ b/scripts/udev/copy-persistent-rules
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/bin/false
RUNLEVEL=S
diff --git a/scripts/unbound/unbound b/scripts/unbound/unbound
new file mode 100644
index 0000000..45290d7
--- /dev/null
+++ b/scripts/unbound/unbound
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+PROGRAM=/usr/sbin/unbound
+RUNLEVEL=3
+NEEDS="+remote_fs +network"
+
+. /etc/init.d/smgl_init
diff --git a/scripts/watchdog/watchdog b/scripts/watchdog/watchdog
index e1de559..1e2b126 100644
--- a/scripts/watchdog/watchdog
+++ b/scripts/watchdog/watchdog
@@ -12,10 +12,7 @@ NEEDS="+remote_fs"
start()
{
echo "Starting watchdog..."
- if [ -e /dev/misc/watchdog ] || [ -e /dev/misc/temperature ]; then
- [ -e /dev/watchdog ] || ln -sf $DEVICES/misc/watchdog /dev/watchdog
- [ -e /dev/temperature ] || ln -sf $DEVICES/misc/temperature
/dev/temperature
- else
+ if ! [ -e /dev/watchdog ] ; then
echo "No watchdog support in the kernel!"
exit 5
fi
diff --git a/scripts/webcleaner/webcleaner b/scripts/webcleaner/webcleaner
index 75e1847..e6bba1b 100755
--- a/scripts/webcleaner/webcleaner
+++ b/scripts/webcleaner/webcleaner
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Startup/shutdown script for webcleaner
#
diff --git a/scripts/webmin/webmin b/scripts/webmin/webmin
index 72c8115..bd1570f 100755
--- a/scripts/webmin/webmin
+++ b/scripts/webmin/webmin
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/share/webmin/miniserv.pl
CONF=/etc/webmin/miniserv.conf
diff --git a/scripts/wicd/wicd b/scripts/wicd/wicd
new file mode 100644
index 0000000..27f102e
--- /dev/null
+++ b/scripts/wicd/wicd
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+PROGRAM="/usr/sbin/wicd"
+RUNLEVEL=3
+PIDFILE="/var/run/wicd/wicd.pid"
+NEEDS="+local_fs smgl-messagebus"
+PROVIDES=network
+
+. /etc/init.d/smgl_init
+
+start() {
+ echo "Starting wicd..."
+ mkdir -p $(dirname $PIDFILE)
+ # make sure there is actually a process there...
+ if [ -f $PIDFILE ]; then
+ echo "Found $PIDFILE doing extra checks..."
+ if [ "$(pgrep -f 'wicd-daemon')" != $(cat $PIDFILE) ]; then
+ print_status warning "$PIDFILE exists, but wicd is not running under
this PID"
+ echo "Attempting cleanup and new startup..."
+ rm -f $PIDFILE
+ else
+ $SET_WCOL
+ print_status warning running
+ return 0
+ fi
+ fi
+ # don't use loadproc here, as that fails if some user is running
+ # a session bus
+ $PROGRAM $ARGS
+ evaluate_retval
+}
+
+stop() {
+ echo "Stopping wicd..."
+ if [ -e $PIDFILE ]; then
+ kill $(cat $PIDFILE) 2>/dev/null
+ rm -f $PIDFILE 2>/dev/null
+ evaluate_retval
+ else
+ $SET_WCOL
+ print_status warning not_running
+ fi
+}
diff --git a/scripts/wifi-radar/wifi-radar b/scripts/wifi-radar/wifi-radar
index e74f7e3..cc2ab2d 100755
--- a/scripts/wifi-radar/wifi-radar
+++ b/scripts/wifi-radar/wifi-radar
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash

PROGRAM=/usr/sbin/wifi-radar
PROGRAM_FLAGS="--daemon"
diff --git a/scripts/zfs-fuse/zfs-fuse b/scripts/zfs-fuse/zfs-fuse
new file mode 100644
index 0000000..103db92
--- /dev/null
+++ b/scripts/zfs-fuse/zfs-fuse
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+PROGRAM="/usr/bin/zfs-fuse"
+PIDFILE="/var/run/zfs-fuse.pid"
+RUNLEVEL=3
+ARGS="-p $PIDFILE"
+
+. /etc/init.d/smgl_init



  • [SM-Commit] GIT changes to master imp-data-simpleinit by Arjan Bouter (738a645ddc622e68727cdb26a165dc061349f804), Arjan Bouter, 06/16/2011

Archive powered by MHonArc 2.6.24.

Top of Page