5

I have downloaded and installed CMAK to manage a Apache Kafka server.

Installation requires the binaries to be downloaded to a folder and then to run:

bin/cmak

inside that folder.

This will bring cmak up manually when you run the command and will show you on the console the CMAK log.

I am connecting to the server with SSH and this way I need to keep the session open to have CMAK running. Is it possible somehow to have it run as a service? so that on server start it starts and I don't have to manually start it on request or to keep the SSH session open?

1 Answer 1

8

You need to create a systemd service. Create the file /lib/systemd/system/cmak.service with the following content:

[Unit]
Description=
After=network.target

[Service]
Type=simple
ExecStart=/bin/cmak

[Install]
WantedBy=multi-user.target

You can enable/start the service with systemctl enable cmak.service ; systemctl start cmak.service. This is just a very simple example and can/should be modified to suit your needs.

Along with the above, there are a few examples at the bottom of this documentation that will be helpful: https://www.freedesktop.org/software/systemd/man/systemd.service.html

1
  • it works! very good starting point. Thank you very much for your help! Commented Feb 9, 2021 at 17:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .