Permission denied mkdir /home/consul

I’m running consult agent on node1 and service checks show this message:

consul   19003     1  0 18:40 ?        00:00:26 /usr/bin/consul agent -data-dir=/opt/consul -config-dir=/etc/consul.d
Warning: Could not access file: EACCES: permission denied, mkdir '/home/consul'

Error: Could not open history file.
REPL session history will not be persisted.
e[1Ge[0J e[1G1

Why is consul trying to create a directory in /home? I clearly have defined the data-dir and consul user:group is correct for /opt/consul

I cannot find any references to /home/consul in the documentation, nor even in the github repo codebase.

Additional config:

[root@mongo-60-rs-0-0 ~]# cat /etc/consul.d/consul.hcl
bind_addr = "0.0.0.0"
      client_addr = "0.0.0.0"
      data_dir = "/opt/consul"
      enable_local_script_checks = true
      node_name="mongo-60-rs-0-0"
      retry_join = ["pmm-server", "sysbench", "proxysql"]
      server = false

Usually, creating the home directory is related to the user running the daemon rather than the process configuration. Your warning seems to indicate that it’s trying to read from a history file for a REPL, and is unable to do so. You could change the consul user homedir to another directory than the one inside of your passwd file, but I don’t know if it’s a good idea to use the /opt/consul directory for this purpose.

I have no experience using a REPL for consul, so I do not know whether it’s useful, but I do have a home directory for consul that is created during the package installation. Mine has a few default files in it, but no history file, so I guess I haven’t been doing anything that would get the consul REPL to want to write anything there yet.