I am with CentOS 7, and I want to start Kafka standalone producer (File Connector) as a service. The command is:
/opt/kafka/bin/connect-standalone.sh /opt/kafka/config/connect-standalone.properties /opt/kafka/config/connect-file-source.properties
And, obviously, it has no stop command. Normally, I just Ctrl+C to stop it as a foreground process.
But when I test, I found very tedious to open several terminal console session to run several processes (Zookeeper, Kafka server, Kafka producer, Storm jar, etc.) so I change Zookeeper and Kafka server as service, which have their
stop script. But in this case, no.
systemctl start kafka-producer and
systemctl stop kafka-producer, but the service entered
failed status, and is not stopped. I had to delete the service, reload the daemon, and switch to manual again.
[Unit] Description=Kafka Producer After=network.target [Service] Type=simple ExecStart=/opt/kafka/bin/connect-standalone.sh /opt/kafka/config/connect-standalone.properties /opt/kafka/config/connect-file-source.properties Restart=on-abort [Install] WantedBy=default.target
Anyway to manipulate a service without