0

I have a systemd service define on rhel8

[Unit]
Description=Apache Kafka - ZooKeeper
Documentation=http://docs.confluent.io/
After=network.target

[Service]
Type=simple
EnvironmentFile=/app/bin/confluent/etc/kafka/zookenv.properties
User=kafka
Group=kafka
ExecStart=/app/bin/confluent/bin/zookeeper-server-start /app/bin/confluent/etc/kafka/zookeeper.properties
TimeoutStopSec=180
Restart=no

[Install]
WantedBy=multi-user.target

when i start this service i get the below error in journalctl

Jul 09 12:00:51 10.204.142.111 systemd[1]: confluent-zookeeper.service: Failed to load environment files: No such file or directory
Jul 09 12:00:51 10.204.142.111 systemd[1]: confluent-zookeeper.service: Failed to run 'start' task: No such file or directory
Jul 09 12:00:51 10.204.142.111 systemd[1]: confluent-zookeeper.service: Failed with result 'resources'.

the environment file exists in the path and so does the start script and properties files.

this is on RHEL8 aws and trying this for the first time.

the component starts up fine when i run the start script manually from command line.

md1980
  • 319
  • 1
  • 8
  • 21

2 Answers2

0

Check that the path and file for

EnvironmentFile=/app/bin/confluent/etc/kafka/zookenv.properties

are correct

Lars Nordin
  • 2,785
  • 1
  • 22
  • 25
0

In my case, I had my service file like this

ExecStart=/app/bin/confluent/bin/zookeeper-server-start
EnvironmentFile=/app/bin/confluent/etc/kafka/zookenv.properties

I changed it to

EnvironmentFile=/app/bin/confluent/etc/kafka/zookenv.properties
ExecStart=/app/bin/confluent/bin/zookeeper-server-start

Then I run,

systemctl daemon-reload &&
systemctl restart service-name.service`

Initially, I was using `systemctl start service-name.service` and I guess that didn't make systemd read the environment files properly
Ercross
  • 519
  • 6
  • 17