cbix / helloservice

Simple systemd socket-activated golang HTTP server example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple example of a systemd-socket activated HTTP server with an nginx reverse-proxy configuration.

I find systemd quite useful for quick but reliable service deployments and this is sort of a template for new services.

Please read the sysusers.d(5) and systemd.socket(5) man pages.

Building:
go build # needs golang >= 1.14

Installation paths:
/usr/local/bin/helloservice
/usr/local/lib/systemd/system/helloservice.service
/usr/local/lib/systemd/system/helloservice.socket
/usr/lib/sysusers.d/helloservice.conf
/etc/nginx/sites-available/helloservice.nginx.conf

Deploy:
systemd-sysusers
systemctl daemon-reload
systemctl enable helloservice.socket

Run:
systemctl start helloservice.socket

About

Simple systemd socket-activated golang HTTP server example

License:Do What The F*ck You Want To Public License


Languages

Language:Go 100.0%