chiark / gitweb /
New examples/disorder.rc is an /etc/rc.d script for FreeBSD. Finish
authorRichard Kettlewell <richard@heceptor.anjou.terraraq.org.uk>
Tue, 15 Jan 2008 19:17:48 +0000 (19:17 +0000)
committerRichard Kettlewell <richard@heceptor.anjou.terraraq.org.uk>
Tue, 15 Jan 2008 19:17:48 +0000 (19:17 +0000)
FreeBSD parts of scripts/setup.

There is also scripts/teardown to undo scripts/setup, but that is
intended for debugging scripts/setup, not for production use, so we
don't advertize it anywhere.

.bzrignore
README.freebsd
examples/Makefile.am
examples/disorder.rc.in [new file with mode: 0755]
scripts/Makefile.am
scripts/setup.in
scripts/teardown.in [new file with mode: 0755]

index cccfd7572e55427690ed46c64cd01f1b089cb624..9fda4fa59ccf2243a39f9c8ec56734bbb3c0292c 100644 (file)
@@ -143,3 +143,5 @@ tests/disorder-udplog
 lib/version-string
 lib/version.h
 scripts/setup
 lib/version-string
 lib/version.h
 scripts/setup
+examples/disorder.rc
+scripts/teardown
index a9a28de90a11e9b3d1eb239dcf17b36e5281fbec..3a7bc7b4885d015dd609f6b24a8e2ec41b9f1350 100644 (file)
@@ -6,17 +6,10 @@ its dependencies.  It is not well tested in this environment.  In
 particular, since my FreeBSD VM lacks sound support, only network play
 has been tested.  Please report successes and failures!
 
 particular, since my FreeBSD VM lacks sound support, only network play
 has been tested.  Please report successes and failures!
 
-Use gmake to build DisOrder, not BSD make.
+Use gmake to build DisOrder, not BSD make:
+  ./configure
+  gmake
+  sudo gmake install
 
 
-
-Things you will need to do:
-
-* Create the jukebox user and group
-
-  sudo pw groupadd -n jukebox
-  sudo pw useradd -n jukebox
-  sudo pw groupmod jukebox -m jukebox
-
-* Arrange for the server to start at boot time
-
-* Start the server
+Then to set up:
+  sudo scripts/setup
index 529fde0622e6d933e67d347640487d227ae218c0..6265895b0eb2a53e2f00b1990bea48238a45dab5 100644 (file)
@@ -1,6 +1,6 @@
 #
 # This file is part of DisOrder.
 #
 # This file is part of DisOrder.
-# Copyright (C) 2004, 2005 Richard Kettlewell
+# Copyright (C) 2004, 2005, 2008 Richard Kettlewell
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # USA
 #
 
 # USA
 #
 
-noinst_SCRIPTS=disorder.init
+noinst_SCRIPTS=disorder.init disorder.rc
 noinst_DATA=config.sample
 
 noinst_DATA=config.sample
 
-SEDFILES=disorder.init config.sample
+SEDFILES=disorder.init config.sample disorder.rc
 
 include ${top_srcdir}/scripts/sedfiles.make
 
 
 include ${top_srcdir}/scripts/sedfiles.make
 
-EXTRA_DIST=disorder.init.in config.sample.in disorder-log
+EXTRA_DIST=disorder.init.in config.sample.in disorder-log disorder.rc.in
 
 CLEANFILES=$(SEDFILES)
 
 CLEANFILES=$(SEDFILES)
diff --git a/examples/disorder.rc.in b/examples/disorder.rc.in
new file mode 100755 (executable)
index 0000000..e3bb90f
--- /dev/null
@@ -0,0 +1,34 @@
+#! /bin/sh
+#
+# This file is part of DisOrder.
+# Copyright (C) 2008 Richard Kettlewell
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+
+# PROVIDE: disorder
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name=disorder
+pidfile=/var/run/disorderd.pid
+procname=disorderd
+command=sbindir/disorderd
+command_args="--pidfile $pidfile"
+
+load_rc_config $name
+run_rc_command "$1"
+
index d79d8d2f614e49fd6a641e85262855fab211f24a..620c8f49dab121f1576ed2ace234040a72df8905 100644 (file)
 #
 
 dist_pkgdata_DATA=completion.bash
 #
 
 dist_pkgdata_DATA=completion.bash
-noinst_SCRIPTS=setup
+noinst_SCRIPTS=setup teardown
 
 
-SEDFILES=setup
+SEDFILES=setup teardown
 
 include ${top_srcdir}/scripts/sedfiles.make
 
 EXTRA_DIST=htmlman sedfiles.make text2c oggrename make-unidata \
 
 include ${top_srcdir}/scripts/sedfiles.make
 
 EXTRA_DIST=htmlman sedfiles.make text2c oggrename make-unidata \
-       format-gcov-report make-version-string setup.in
+       format-gcov-report make-version-string setup.in teardown.in
 
 CLEANFILES=$(SEDFILES)
 
 CLEANFILES=$(SEDFILES)
index 8348724c8b25293b9ef737b87cb987d10792b85e..991b060a04a6eaa7be1e4d3012577226a9eb3904 100755 (executable)
@@ -240,12 +240,44 @@ Mac )
   launchctl start uk.org.greenend.rjk.disorder
   echo "Installing CGI"
   install -m 555 server/disorder.cgi /Library/WebServer/CGI-Executables/disorder
   launchctl start uk.org.greenend.rjk.disorder
   echo "Installing CGI"
   install -m 555 server/disorder.cgi /Library/WebServer/CGI-Executables/disorder
-  echo "Setting up link to CGI;'s dependencies"
+  echo "Setting up link to CGI's dependencies"
   rm -f /Library/WebServer/Documents/disorder
   ln -s pkgdatadir/static /Library/WebServer/Documents/disorder
   echo
   echo "You must sudo disorder setup-guest [--no-online-registration] next."
   ;;
   rm -f /Library/WebServer/Documents/disorder
   ln -s pkgdatadir/static /Library/WebServer/Documents/disorder
   echo
   echo "You must sudo disorder setup-guest [--no-online-registration] next."
   ;;
+FreeBSD )
+  echo "Installing startup script into /etc/rc.d"
+  install -m 555 examples/disorder.rc /etc/rc.d/disorder
+  echo "Starting DisOrder server"
+  /etc/rc.d/disorder start
+  echo "Identifying web server"
+  set /usr/local/www/*
+  case $# in
+  0 )
+    echo
+    echo "Could not find a web server"
+    exit 1
+    ;;
+  1 )
+    ;;
+  * )
+    echo
+    echo "Yikes!  There seems to be more than one web server here."
+    echo "Guessing that you want $1."
+    echo
+    ;;
+  esac
+  web=$1
+  echo "Found $web"
+  echo "Installing CGI"
+  install -m 555 server/disorder.cgi $web/cgi-bin/disorder
+  echo "Setting up link to CGI's dependencies"
+  rm -f $web/data/disorder
+  ln -s pkgdatadir/static $web/data/disorder
+  echo
+  echo "You must sudo disorder setup-guest [--no-online-registration] next."
+  ;;
 * )
   echo "Sorry, I don't know how to install the server on this platform."
   echo "You will have to do that by hand."
 * )
   echo "Sorry, I don't know how to install the server on this platform."
   echo "You will have to do that by hand."
diff --git a/scripts/teardown.in b/scripts/teardown.in
new file mode 100755 (executable)
index 0000000..b9361b9
--- /dev/null
@@ -0,0 +1,41 @@
+#! /bin/bash
+#
+# This file is part of DisOrder
+# Copyright (C) 2008 Richard Kettlewell
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+#
+set -e
+
+case $(uname -s) in
+FreeBSD )
+  APACHE=apache22
+  echo "* killing disorderd processes"
+  killall disorderd || true
+  echo "* removing files"
+  rm -f /usr/local/www/$APACHE/cgi-bin/disorder
+  rm -f /usr/local/www/$APACHE/data/disorder
+  rm -f /etc/rc.d/disorder
+  rm -rf pkgstatedir
+  rm -rf pkgconfdir
+  echo "* removing user and group"
+  pw groupdel jukebox || true
+  pw userdel jukebox || true
+  ;;
+* )
+  echo Unknown operating system >&2
+  exit 1
+esac