Developers should read README.developers.
+Installation (supported platforms)
+==================================
-Installation
-============
+If you are upgrading from an earlier version, see README.upgrades.
+
+For Debian and Ubuntu, you are best of using .deb files, either download from
+www.greenend.org.uk or built locally with 'fakeroot debian/rules binary'. They
+will do the majority of the setup for you, using a debconf interface to collect
+details about your system.
+
+For FreeBSD, see README.freebsd (in conjunction with the notes below) and use
+scripts/setup.
+
+For Mac OS X, see README.mac (in conjunction with the notes below) and use
+scripts/setup.
+
+
+Installation (generic)
+======================
"This place'd be a paradise tomorrow, if every department had a supervisor
with a machine-gun"
IMPORTANT: If you are upgrading from an earlier version, see README.upgrades.
-On a Debian or Ubuntu system, if you install from .deb files then you should be
-able to skip steps 1 to 6 and configure it via debconf. This is strongly
-recommended!
-
1. Build the software. Do something like this:
./configure --sysconfdir=/etc --localstatedir=/var
The server builds on FreeBSD, using the ports system to supply many of
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!
+has been tested.
+
+You must use gmake to build DisOrder.
+
+After installation you can use scripts/setup to install the server
+(creating a 'jukebox' user, etc).
-Use gmake to build DisOrder, not BSD make:
./configure
gmake
sudo gmake install
-
-Then to set up:
sudo scripts/setup
+ sudo disorder setup-guest [--no-online-registration]
+
+Please report successes and failures!
================
The server builds on OS X, using Fink to supply many of its
-dependencies. It is not well tested in this environment. Please
-report successes and failures!
+dependencies. It is not well tested in this environment.
-There is an EXPERIMENTAL script in scripts/setup which asks a few
-questions, sets up a basic installation and starts the server. To use
-it, after having done 'sudo make install', just do 'sudo
-scripts/setup' and follow the prompts.
+After installation you can use scripts/setup to install the server
+(creating a 'jukebox' user, etc).
-Its current main deficiences are:
- - it uses the 'daemon' user/group instead of creating a 'jukebox'
- identity.
- - the launchd configuration does not have the server started at
- boot time. You must start it manually. This may be changed in a
- future version.
+ ./configure
+ make
+ sudo make install
+ sudo scripts/setup
+ sudo disorder setup-guest [--no-online-registration]
+
+Please report successes and failures!
</array>
<key>WorkingDirectory</key>
<string>pkgstatedir</string>
-<!-- <key>RunAtLoad</key> -->
-<!-- <true/> -->
+ <key>RunAtLoad</key>
+ <true/>
</dict>
</plist>
Darwin )
echo "Mac OS X detected"
os=Mac
- # TODO we should use jukebox and create it if necessary; see below
- user=daemon
- group=daemon
+ user=jukebox
+ group=jukebox
;;
FreeBSD )
echo "FreeBSD detected"
touch pkgconfdir/options.user
fi
+# pick ID1 ID2 ... IDn
+# Echoes an ID matching none of ID1..IDn
+pick() {
+ local n
+ n=250 # better not choose 0!
+ while :; do
+ ok=true
+ for k in "$@"; do
+ if [ $n = $k ]; then
+ ok=false
+ break
+ fi
+ done
+ if $ok; then
+ echo $n
+ return
+ fi
+ n=$((1+$n))
+ done
+}
+
case $os in
Mac )
- # TODO niutil?
+ # Apple don't seem to believe in creating a user as a discrete operation
+ if dscl / -read /Groups/$group >/dev/null 2>&1; then
+ echo "$group group already exists"
+ else
+ echo "Creating $group group"
+ gids=$(dscl / -list /Groups PrimaryGroupID|awk '{print $2}')
+ gid=$(pick $gids)
+ echo "(picked gid $gid)"
+ dscl / -create /Groups/$group
+ dscl / -create /Groups/$group PrimaryGroupID $gid
+ dscl / -create /Groups/$group Password \*
+ fi
+ if dscl / -read /Users/$user >/dev/null 2>&1; then
+ echo "$user user already exists"
+ else
+ echo "Creating $user user"
+ uids=$(dscl / -list /Users UniqueID|awk '{print $2}')
+ uid=$(pick $uids)
+ echo "(picked uid $uid)"
+ gid=$(dscl / -read /Groups/$group PrimaryGroupID | awk '{print $2}')
+ dscl / -create /Users/$user
+ dscl / -create /Users/$user UniqueID $uid
+ dscl / -create /Users/$user UserShell /usr/bin/false
+ dscl / -create /Users/$user RealName 'DisOrder server'
+ dscl / -create /Users/$user NFSHomeDirectory pkgstatedir
+ dscl / -create /Users/$user PrimaryGroupID $gid
+ dscl / -create /Users/$user Password \*
+ fi
;;
FreeBSD )
+ # FreeBSD has a simple well-documented interface
if pw groupshow $group >/dev/null 2>&1; then
echo "$group group already exists"
else
rm -rf pkgstatedir
rm -rf pkgconfdir
echo "* removing user and group"
- pw groupdel jukebox || true
pw userdel jukebox || true
+ pw groupdel jukebox || true
;;
Darwin )
echo "* stopping server"
rm -f /Library/LaunchDaemons/uk.org.greenend.rjk.disorder.plist
rm -rf pkgstatedir
rm -rf pkgconfdir
+ echo "* removing user and group"
+ dscl / -delete /Users/jukebox || true
+ dscl / -delete /Groups/jukebox || true
;;
* )
echo Unknown operating system >&2