{"id":13481270,"url":"https://github.com/coreos/go-systemd","last_synced_at":"2026-01-28T03:29:03.469Z","repository":{"id":10604965,"uuid":"12821303","full_name":"coreos/go-systemd","owner":"coreos","description":"Go bindings to systemd socket activation, journal, D-Bus, and unit files","archived":false,"fork":false,"pushed_at":"2024-06-25T21:20:23.000Z","size":730,"stargazers_count":2518,"open_issues_count":72,"forks_count":315,"subscribers_count":51,"default_branch":"main","last_synced_at":"2025-05-08T20:55:45.592Z","etag":null,"topics":["dbus","go","journald","machined","systemd"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coreos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-09-13T23:13:51.000Z","updated_at":"2025-05-04T20:12:58.000Z","dependencies_parsed_at":"2023-01-13T16:02:23.641Z","dependency_job_id":"634e8b6d-5003-4462-b30f-b4e305fb0329","html_url":"https://github.com/coreos/go-systemd","commit_stats":{"total_commits":388,"total_committers":113,"mean_commits":3.433628318584071,"dds":0.8943298969072165,"last_synced_commit":"7d375ecc2b092916968b5601f74cca28a8de45dd"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreos%2Fgo-systemd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreos%2Fgo-systemd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreos%2Fgo-systemd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreos%2Fgo-systemd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coreos","download_url":"https://codeload.github.com/coreos/go-systemd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253156720,"owners_count":21862991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbus","go","journald","machined","systemd"],"created_at":"2024-07-31T17:00:50.338Z","updated_at":"2026-01-28T03:29:03.464Z","avatar_url":"https://github.com/coreos.png","language":"Go","readme":"# go-systemd\n\n[![godoc](https://img.shields.io/badge/godoc-reference-5272B4)](https://pkg.go.dev/mod/github.com/coreos/go-systemd/v22/?tab=packages)\n![minimum golang 1.23](https://img.shields.io/badge/golang-1.23%2B-orange.svg)\n\n\nGo bindings to systemd. The project has several packages:\n\n- `activation` - for writing and using socket activation from Go\n- `daemon` - for notifying systemd of service status changes\n- `dbus` - for starting/stopping/inspecting running services and units\n- `journal` - for writing to systemd's logging service, journald\n- `sdjournal` - for reading from journald by wrapping its C API\n- `login1` - for integration with the systemd logind API\n- `machine1` - for registering machines/containers with systemd\n- `unit` - for (de)serialization and comparison of unit files\n\n## Socket Activation\n\nAn example HTTP server using socket activation can be quickly set up by following this README on a Linux machine running systemd:\n\nhttps://github.com/coreos/go-systemd/tree/main/examples/activation/httpserver\n\n## systemd Service Notification\n\nThe `daemon` package is an implementation of the [sd_notify protocol](https://www.freedesktop.org/software/systemd/man/sd_notify.html#Description).\nIt can be used to inform systemd of service start-up completion, watchdog events, and other status changes.\n\n## D-Bus\n\nThe `dbus` package connects to the [systemd D-Bus API](http://www.freedesktop.org/wiki/Software/systemd/dbus/) and lets you start, stop and introspect systemd units.\n[API documentation][dbus-doc] is available online.\n\n[dbus-doc]: https://pkg.go.dev/github.com/coreos/go-systemd/v22/dbus?tab=doc\n\n### Debugging\n\nCreate `/etc/dbus-1/system-local.conf` that looks like this:\n\n```\n\u003c!DOCTYPE busconfig PUBLIC\n\"-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN\"\n\"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd\"\u003e\n\u003cbusconfig\u003e\n    \u003cpolicy user=\"root\"\u003e\n        \u003callow eavesdrop=\"true\"/\u003e\n        \u003callow eavesdrop=\"true\" send_destination=\"*\"/\u003e\n    \u003c/policy\u003e\n\u003c/busconfig\u003e\n```\n\n## Journal\n\n### Writing to the Journal\n\nUsing the pure-Go `journal` package you can submit journal entries directly to systemd's journal, taking advantage of features like indexed key/value pairs for each log entry.\n\n### Reading from the Journal\n\nThe `sdjournal` package provides read access to the journal by wrapping around journald's native C API; consequently it requires cgo and the journal headers to be available.\n\n## logind\n\nThe `login1` package provides functions to integrate with the [systemd logind API](http://www.freedesktop.org/wiki/Software/systemd/logind/).\n\n## machined\n\nThe `machine1` package allows interaction with the [systemd machined D-Bus API](http://www.freedesktop.org/wiki/Software/systemd/machined/).\n\n## Units\n\nThe `unit` package provides various functions for working with [systemd unit files](http://www.freedesktop.org/software/systemd/man/systemd.unit.html).\n","funding_links":[],"categories":["Misc","开源类库","File System","Go","Open source library","Repositories"],"sub_categories":["系统开发","System Development"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoreos%2Fgo-systemd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoreos%2Fgo-systemd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoreos%2Fgo-systemd/lists"}