Run Golang Executable binary as Daemon Service

Sumit Bopche
Dec 28, 2021

--

Change directory

cd /etc/systemd/system/

Create a configuration for your project

vim yourservicename-service.service

Paste the following, change the binary path, and save

[Unit]Description=YourServiceName ServiceAfter=syslog.target[Service]User=rootWorkingDirectory=/apps/yourServiceName-serviceExecStart=/apps/yourServiceName-service/yourservicename-serviceRestart=always[Install]WantedBy=multi-user.target

Start the service

sudo systemctl start yourservicename-service

Check status

sudo systemctl status yourservicename-service

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Sumit Bopche
Sumit Bopche

No responses yet

Write a response