samer@7: #!/usr/local/bin/swipl samer@7: samer@7: /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - samer@7: ClioPatria is prepared to be combined with the SWI-Prolog library samer@7: library(http/http_unix_daemon). ClioPatria is started as a deamon samer@7: using samer@7: samer@7: % ./daemon.pl --port=Port [option ...] samer@7: samer@7: Options are briefly described by running the daemon with --help: samer@7: samer@7: % ./daemon.pl --help samer@7: samer@7: See library(http/http_unix_daemon) for details. The SWI-Prolog samer@7: distribution contains a file debian-init-script, which can be samer@7: used as a skeleton for managing the server from /etc/init.d. To samer@7: do so, follow these steps: samer@7: samer@7: 1. copy debian-init-script to /etc/init.d/. This samer@7: script is in the directory doc/packages/examples/http of samer@7: your Prolog installation. samer@7: 2. Edit /etc/init.d/, setting DIR to the working samer@7: directory of the ClioPatria server. samer@7: 3. Edit the remainder of the configuration section to suit samer@7: your needs. samer@7: 4. Run samer@7: % update-rc.d defaults samer@7: % /etc/init.d/ start samer@7: samer@7: Permissions samer@7: samer@7: Ideally, the ClioPatria directory is owned by another user than the user samer@7: used by the daemon. If the user of the daemon has no write access, it samer@7: acts as a read-only service. Write access may be given by changing the samer@7: group of certain files to the group of the daemon and allowing group samer@7: write. You may want to add write access to samer@7: samer@7: - The RDF-store directory to allow adding persistent triples (otherwise samer@7: tiples may be added, but will not persist). samer@7: - The file settings.db to allow changing settings through the API. samer@7: - The file users.db to allow modifying the user database throuh th API samer@7: - The '.' directory to allow creating httpd.log. samer@7: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ samer@7: samer@7: :- set_prolog_flag(verbose, silent). samer@7: :- use_module(library(http/http_unix_daemon)). samer@7: :- [run].