Use systemd's RequiresMountsFor

User might be interested in separating data
in ephemeral and persistent state, especially
in cloud environments, e.g. data_dir on
another disk.
This commit is contained in:
Frank Fischer 2019-01-14 15:53:01 +01:00
parent 9823a3fc54
commit fd8ea77fa4

View file

@ -3,6 +3,8 @@ Description=Elasticsearch-{{es_instance_name}}
Documentation=http://www.elastic.co
Wants=network-online.target
After=network-online.target
{# Directive 'WorkingDirectory' creates an implicit dependecy for {{es_home}}, so it can be omitted here #}
RequiresMountsFor={{ data_dirs | array_to_str(separator=' ') }} {{log_dir}} {{pid_dir}} {{conf_dir}}
[Service]
Environment=ES_HOME={{es_home}}