Bug 236840 - textproc/elasticsearch6: Elasticsearch 6 service doesn't start at boot time with clear_tmp_enable="YES" in /etc/rc.conf
Summary: textproc/elasticsearch6: Elasticsearch 6 service doesn't start at boot time w...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Mark Felder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-27 22:44 UTC by Nemesis11
Modified: 2019-03-27 22:45 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (feld)


Attachments
Images showing the bug (98.80 KB, application/x-zip-compressed)
2019-03-27 22:44 UTC, Nemesis11
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nemesis11 2019-03-27 22:44:50 UTC
Created attachment 203199 [details]
Images showing the bug

I created a machine with FreeBSD 12.0 and the Elasticsearch 6 and, when we have the option "Clean the /tmp filesystem on system startup" (clear_tmp_enable="YES" in /etc/rc.conf) on, the Elasticsearch 6 service doesn’t start at boot time.
"Clean the /tmp filesystem on system startup" is a security option at install time, that can be enabled/disabled.
The problem happens because the Elasticsearch service starts soon after the Clean /tmp service. The java process tries to write on /tmp at the same time the clean /tmp service is deleting everything in /tmp.

Most of the time, there is no error on the console, at boot, and nothing is written in the logs. But one of the time, i saw the java process giving the error that it couldn't open file /tmp/elasticsearch.xxxxxxxx/gc.log in the console, at boot.

-------------------------------------------------------
Clearing /tmp.
OpenJDK 64-Bit Server VM Warning: Cannot open file /tmp/elasticsearch.wzc6rYAS/gc.log
Updating motd:
-------------------------------------------------------

Even when there is no error in the boot console, the Elasticsearch 6 service doesn't start at boot time with clear_tmp_enable="YES" in /etc/rc.conf.
After the boot sequence, i looked the status of the service, and the Elasticsearch 6 service was not running.

-------------------------------------------------------
felix@elasticforum2:~ % doas service elasticsearch status
elasticsearch is not running.
-------------------------------------------------------

After boot, i started the Elasticsearch 6 service manually, with "service elasticsearch start", it starts with no problem.
If, in /etc/rc.conf, if i comment the Clean /tmp service ( with #clear_tmp_enable="YES" ), the Elasticsearch 6 service starts at boot without problem.

-------------------------------------------------------
felix@elasticforum2:~ % doas service elasticsearch status
elasticsearch is running as pid 16306.
-------------------------------------------------------

I run the "rcorder /etc/rc.d/* /usr/local/etc/rc.d/*" command and it looks like the problem is that the Elasticsearch 6 service starts before the Clean /tmp service, but I’m not absolutely sure.

-------------------------------------------------------
/etc/rc.d/SERVERS
/usr/local/etc/rc.d/elasticsearch
/etc/rc.d/zfsd
/etc/rc.d/ntpdate
/etc/rc.d/rpcbind
/etc/rc.d/nisdomain
/etc/rc.d/ypserv
/etc/rc.d/ypxfrd
/etc/rc.d/ypupdated
/etc/rc.d/ypbind
/etc/rc.d/ypset
/etc/rc.d/yppasswdd
/etc/rc.d/ypldap
/etc/rc.d/wpa_supplicant
/etc/rc.d/virecover
/etc/rc.d/accounting
/etc/rc.d/nfsclient
/etc/rc.d/amd
/etc/rc.d/auditd
/etc/rc.d/auditdistd
/etc/rc.d/automountd
/etc/rc.d/automount
/etc/rc.d/autounmountd
/etc/rc.d/tmp
/etc/rc.d/cleartmp
-------------------------------------------------------

Thank you very much.