# Autogenerated by Puppet from zookeeper/templates/zookeeper.service.erb
# Do not edit

[Unit]
Description=Apache ZooKeeper
<%if ! [nil, :undefined, :undef].include?(scope.lookupvar("zookeeper::systemd_unit_want")) -%>
Wants=<%= scope.lookupvar("zookeeper::systemd_unit_want")%>
<% end -%>
<%if ! [nil, :undefined, :undef].include?(scope.lookupvar("zookeeper::systemd_unit_after")) -%>
After=<%= scope.lookupvar("zookeeper::systemd_unit_after") %>
<% end -%>

[Service]
ExecStart=/bin/bash -c 'set -x; \
  . <%= scope.lookupvar("zookeeper::cfg_dir") %>/<%= scope.lookupvar("zookeeper::environment_file") %>; \
  CLASSPATH="<%= @_zoo_dir %>/zookeeper<% if scope.lookupvar('zookeeper::install_method') == 'archive' -%>-<%= scope.lookupvar("zookeeper::archive_version") %><% end -%>.jar:<%= @_zoo_dir %>/lib/*:$CLASSPATH"; \
  CLASSPATH="$([ -r <%= scope.lookupvar("zookeeper::service::_zoo_dir") %>/bin/zkEnv.sh ] && . <%= scope.lookupvar("zookeeper::service::_zoo_dir") %>/bin/zkEnv.sh ; echo $CLASSPATH)"; \
  mkdir -p <%= scope.lookupvar("zookeeper::log_dir") %>; \
  $JAVA "-Dzookeeper.log.dir=<%= scope.lookupvar("zookeeper::log_dir") %>" "-Dzookeeper.root.logger=$ZOO_LOG4J_PROP" -cp "$CLASSPATH" $JAVA_OPTS "$ZOOMAIN" "$ZOOCFG"'
Restart=always
RemainAfterExit=no
SyslogIdentifier=zookeeper
User=<%= scope.lookupvar("zookeeper::user") %>
Group=<%= scope.lookupvar("zookeeper::group") %>

[Install]
WantedBy=multi-user.target
