Liam,

 

Thanks for that tip—I was looking this morning at making BaseX a service.

 

So if I understand your cron job, it just tries to start BaseX, which if it’s already started will have no effect (other than emitting the messages you send to /dev/null.

 

Cheers,

 

E.

 

_____________________________________________

Eliot Kimber

Sr Staff Content Engineer

O: 512 554 9368

M: 512 554 9368

servicenow.com

LinkedIn | Twitter | YouTube | Facebook

 

From: BaseX-Talk <basex-talk-bounces@mailman.uni-konstanz.de> on behalf of Liam R. E. Quin <liam@fromoldbooks.org>
Date: Wednesday, February 9, 2022 at 10:39 AM
To: basex-talk@mailman.uni-konstanz.de <basex-talk@mailman.uni-konstanz.de>
Subject: Re: [basex-talk] BaseX Doing Lots of Work on Startup: How to Diagnose?

[External Email]


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

--
Liam Quin, https://urldefense.com/v3/__https://www.delightfulcomputing.com/__;!!N4vogdjhuJM!Tesq4xndDV4_mhtYnkrrKIMq-aeflNLL8mcQG8oWM8r1ekswvo5L896fSOwD3h6Iesrfrg$
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  https://urldefense.com/v3/__http://www.fromoldbooks.org__;!!N4vogdjhuJM!Tesq4xndDV4_mhtYnkrrKIMq-aeflNLL8mcQG8oWM8r1ekswvo5L896fSOwD3h6G07tTig$