contrib/rc/freebsd: Add FreeBSD start script from Douglas Carmichael
authorJon Trulson <jon@radscan.com>
Sun, 24 Aug 2014 22:48:07 +0000 (16:48 -0600)
committerJon Trulson <jon@radscan.com>
Sun, 24 Aug 2014 22:48:07 +0000 (16:48 -0600)
cde/contrib/rc/freebsd/README [new file with mode: 0644]
cde/contrib/rc/freebsd/dtlogin [new file with mode: 0755]

diff --git a/cde/contrib/rc/freebsd/README b/cde/contrib/rc/freebsd/README
new file mode 100644 (file)
index 0000000..999bccd
--- /dev/null
@@ -0,0 +1,8 @@
+This is a startup script to run dtlogin upon booting a FreeBSD system.
+Author: Douglas Carmichael <dcarmich@dcarmichael.net>
+
+Instructions:
+
+Put the dtlogin script in /usr/local/etc/rc.d (owned and executable by root.)
+Add dtlogin_enable="YES" in /etc/rc.conf to enable dtlogin startup.
+
diff --git a/cde/contrib/rc/freebsd/dtlogin b/cde/contrib/rc/freebsd/dtlogin
new file mode 100755 (executable)
index 0000000..3f79913
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Script to start dtlogin upon system boot for FreeBSD
+# Instructions: 
+# Put this script in /usr/local/etc/rc.d (owned and read/execute by root.)
+# Use dtlogin_enable="YES" in /etc/rc.conf to enable dtlogin startup.
+#
+# Author: Douglas Carmichael <dcarmich@dcarmichael.net>
+#
+# Define the services that dtlogin requires to start.
+#
+# PROVIDE: dtlogin
+# REQUIRE: DAEMON moused rpcbind hald polkitd
+
+. /etc/rc.subr
+
+name=dtlogin
+rcvar=dtlogin_enable
+
+command="/usr/dt/bin/dtlogin"
+command_args="&"
+
+dtlogin_prestart()
+{
+    if ! checkyesno dtlogin_enable ; then
+       return 0
+    fi
+    echo "Starting ${name}."
+
+}
+
+load_rc_config $name
+run_rc_command "$1"
+
+