Skip to content

Instantly share code, notes, and snippets.

@kwilczynski
Last active February 17, 2021 05:10
Show Gist options
  • Save kwilczynski/6c6645dfdc8de4cd9ed1 to your computer and use it in GitHub Desktop.
Save kwilczynski/6c6645dfdc8de4cd9ed1 to your computer and use it in GitHub Desktop.
kafka.service for systemd
[Unit]
Description=Apache Kafka server (broker)
Documentation=http://kafka.apache.org/documentation.html
Requires=network.target remote-fs.target syslog.target
After=network.target remote-fs.target syslog.target
ConditionPathExists=/etc/kafka/server.properties
ConditionPathExists=/var/lib/kafka
[Service]
Type=simple
PIDFile=/var/run/kafka.pid
User=kafka
Group=kafka
WorkingDirectory=/var/lib/kafka
EnvironmentFile=/etc/sysconfig/kafka
ExecStart=
ExecStop=
Restart=on-failure
SyslogIdentifier=kafka
[Install]
WantedBy=multi-user.target
@kwilczynski
Copy link
Author

@vide why you can't leverage EnvironmentFile? It should expose anything you put there to ExecStart for you to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment