On Wed, 2022-02-09 at 16:15 +0000, Eliot Kimber wrote:
That’s what I figured—that it should start quickly and be immediately available, so if it’s not something must be wrong.
At the moment I’m just firing up basehttp using the built-in script, so no on-startup commands or job services (yet).
For what it's worth i have a crontab entry on fromoldbooks.org,
*/5 * * * * cd /home/liam/f/Search/ && /home/liam/packages/basex/basex/bin/basexserver -z -n127.0.0.1 > /dev/null 2>&1
The /dev/null is because if there are errors, they're likely Java exceptions which could fill the disk :) as well as an error message if the server is already running (which cron would email to me!) and i'll diagnose by running the server directly. You may want to use a logfile instead. The -z option suppresses BaseX's own logging.
The -n127.0.0.1 makes BaseX listen only on the local interface, because i connect to it with a separate front end predating RESTXQ :)
The */5 at the start says to run the command every 5 minutes; it's however much downtown is acceptable, or delay after a reboot.
/home/liam/packages/basex/basex is a symbolic link to the current version, in this case BaseX95, so i can switch easily.
An alternative would be to write a systemd service file for BaseX, to let it run as a system service, but i prefer to keep as much in user space as possible and not modify system files or directories, to make it easier to migrate to a different computer later.
Liam
Liam