Make service for an executable program ubuntu

Hello,
i got an executable program in the /usr/sbin directory. I want to facilitate the start process by making it into service to start, stop or restart. ps still beginner.

Thanks, Varoon

Depends on your OS. Ubuntu you can use systemd.

Linode has a good tutorial on creating systemd services. I’ve done this in the past to autostart a nodejs server on boot.

Your unit file will look something like this (at the bare minimum)…

[Unit]
Description=Example systemd service.

[Service]
Type=simple
ExecStart=/bin/bash /usr/sbin/myBinary

[Install]
WantedBy=multi-user.target

There are a bunch of directives you can add to your .service file, which you can find here. Good luck!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.