If you want to run Daisy as part of your operational environment, you might prefer to run the different Daisy components as services, which you can easily start, stop and restart, and which ideally run under a specific user (perhaps with restricted privileges). We recommend using "wrapper" for this, a fine open source project from Tanuki Software. If you use wrapper and are happy with it, consider making a donation to its developers.
Tanuki wrapper can be used both on Unix and Windows platforms. As of Daisy 2.0, the wrapper scripts are integrated into the daisy binary distribution. The following sections explain the implementation details and how to make use of these scripts.
Installing the scripts
(starting from Daisy 2.0.1)
Run the following command
<daisy.home>/install/daisy-service-install -r <repo-data-dir> -w <wiki-data-dir>
You can choose to give only the -r or -w option, as desired. To see all available options, specify the -h (help) option.
The service scripts will then be installed in the service subdirectory of the repository and wiki data directories.
Implementation details
What this command does is copying some template flies from the DAISY_HOME/wrapper directory, and adjusting some paths in the conf files.
Using the wrapper scripts
Detailed instructions on the usage of the wrapper scripts have been created for the following platforms:
Using a custom jetty-daisywiki.xml
If you have a custom jetty-daisywiki.xml in your wiki data directory, you will need to edit the following file:
<wiki data dir>/service/daisy-wiki-service.conf
Instructions are in the file itself.
Relocating the data directories or changing the location of daisy home
If you would like to relocate either your daisy data directory or your daisy wiki data directory, or if you want to move your daisy home directory, you have to either manually adapt the settings inside the wrapper configuration files, or run daisy-service-install again. What follows are instructions for manual adjustment.
The repository startup script is configured via the file <DAISY_DATADIR>\service\daisy-repository-server-service.conf, at the very beginning of that file, you will find the following section:
# Environment variables set.default.DAISY_HOME=/path/to/your/daisy/home set.DAISY_DATADIR=/path/to/your/daisy/datadir set.MERLIN_HOME=%DAISY_HOME%/repository-server/merlin set.WRAPPER_HOME=%DAISY_HOME%/wrapper
Simply replace the path for DAISY_HOME and/or DAISY_DATADIR, and you are done.
In case of the daisy wiki startup script, configuration takes place via <DAISYWIKI_DATADIR>\service\daisy-wiki-service.conf. At the very beginning of that file, you will find the following section:
# Environment variables set.default.DAISY_HOME=/path/to/your/daisy/home set.default.DAISYWIKI_DATADIR=/path/to/your/daisywiki/datadir set.JETTY_HOME=%DAISY_HOME%/daisywiki/jetty set.WRAPPER_HOME=%DAISY_HOME%/wrapper
Simply replace the path for DAISY_HOME and/or DAISYWIKI_DATADIR, and you will be able to use the script again.
Usage of the wrapper scripts on other platforms
Precompiled binaries of the wrapper scripts binaries and libraries are shipped together with the daisy binary distribution, so that you can run the wrapper on scripts on other operating systems besides Linux and Windows, too (e.g. on MacOS, Solaris, AIX and HP-UX). Running the wrapper scripts on these platforms is quite easy: in the directory $DAISY_HOME\wrapper\bin of your daisy installation you will find the wrapper binaries for several operating systems.
- Identify the binary needed on your platform (e.g. wrapper-solaris-sparc-32).
- Copy that file in the service directory of both your daisy data directory and your daisywiki data directory.
- In both directories, replace the existing binary file wrapper (which is the binary for the Linux x86 platform, 32 bit) with the binary you just copied over there.
That's it already. You now hopefully will be able to start up the services by using the startup files in the service directory of your daisy data directory or your daisywiki data directory, respectively.
Hope these instructions helps as a quick primer on how to use wrapper with Daisy. Wrapper's documentation is quite good, so please review it before asking questions.
Wrapper also monitors the JVM processes by "pinging" them regularly, and will even restart the processes if a VM gets stuck - which, under normal circumstances, shouldn't happen.