Skip to content

[mirror] Utilities to interact with systemd sockets in Go

License

Notifications You must be signed in to change notification settings

albertito/systemd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blitiri.com.ar/go/systemd

GoDoc Build Status

systemd is a Go package implementing a way to get network listeners from systemd, similar to C's sd_listen_fds() and sd_listen_fds_with_names() (man).

Supports named file descriptors, which is useful if your daemon needs to be able to tell the different ports apart (e.g. http vs https).

It is used by daemons such as chasquid to listen on privileged ports without needing to run as root.

Example

listeners, err := systemd.Listeners()
for _, l := range listeners["service.socket"] {
	go serve(l)
}

Status

The API should be considered stable, and no backwards-incompatible changes are expected.

Contact

If you have any questions, comments or patches please send them to albertito@blitiri.com.ar.

About

[mirror] Utilities to interact with systemd sockets in Go

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages