summaryrefslogtreecommitdiffstats
path: root/extras/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'extras/init.d')
-rw-r--r--extras/init.d/Makefile.am8
-rw-r--r--extras/init.d/glusterd-FreeBSD.in24
2 files changed, 28 insertions, 4 deletions
diff --git a/extras/init.d/Makefile.am b/extras/init.d/Makefile.am
index 38898fddd2e..61dde2d396e 100644
--- a/extras/init.d/Makefile.am
+++ b/extras/init.d/Makefile.am
@@ -1,13 +1,13 @@
-EXTRA_DIST = glusterd-Debian glusterd-Redhat glusterd-SuSE glusterd.plist rhel5-load-fuse.modules
+EXTRA_DIST = glusterd-Debian glusterd-FreeBSD glusterd-Redhat glusterd-SuSE glusterd.plist rhel5-load-fuse.modules
-CLEANFILES =
+CLEANFILES =
INIT_DIR = @initdir@
SYSTEMD_DIR = @systemddir@
LAUNCHD_DIR = @launchddir@
-$(GF_DISTRIBUTION):
+$(GF_DISTRIBUTION):
@if [ ! -d $(SYSTEMD_DIR) ]; then \
$(mkdir_p) $(DESTDIR)$(INIT_DIR); \
$(INSTALL_PROGRAM) glusterd-$(GF_DISTRIBUTION) $(DESTDIR)$(INIT_DIR)/glusterd; \
@@ -15,7 +15,7 @@ $(GF_DISTRIBUTION):
install-exec-local: $(GF_DISTRIBUTION)
-install-data-local:
+install-data-local:
if GF_DARWIN_HOST_OS
$(mkdir_p) $(DESTDIR)$(LAUNCHD_DIR)
$(INSTALL_PROGRAM) glusterd.plist $(DESTDIR)$(LAUNCHD_DIR)/com.gluster.glusterd.plist
diff --git a/extras/init.d/glusterd-FreeBSD.in b/extras/init.d/glusterd-FreeBSD.in
new file mode 100644
index 00000000000..5eed6360a89
--- /dev/null
+++ b/extras/init.d/glusterd-FreeBSD.in
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: glusterd
+
+. /etc/rc.subr
+
+name="glusterd"
+rcvar=`set_rcvar`
+command=@prefix@/sbin/${name}
+pidfile="/var/run/${name}.pid"
+glusterd_flags="-p /var/run/${name}.pid"
+start_precmd="glusterd_prestart"
+
+glusterd_prestart()
+{
+ mkdir -p /var/lib/glusterd /var/log/glusterfs
+ return 0
+}
+
+load_rc_config $name
+run_rc_command "$1"