{"id":15429541,"url":"https://github.com/agis/ruby-sdnotify","last_synced_at":"2025-04-05T08:08:13.138Z","repository":{"id":56894604,"uuid":"102989066","full_name":"agis/ruby-sdnotify","owner":"agis","description":"A pure-Ruby implementation of systemd's sd_notify(3)","archived":false,"fork":false,"pushed_at":"2024-06-26T22:56:22.000Z","size":28,"stargazers_count":50,"open_issues_count":2,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T07:06:59.034Z","etag":null,"topics":["ruby","ruby-sdnotify","sd-notify","sdnotify","systemd","systemd-service-notification","watchdog"],"latest_commit_sha":null,"homepage":"https://www.freedesktop.org/software/systemd/man/sd_notify.html","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2017-09-09T22:36:59.000Z","updated_at":"2024-06-16T16:53:09.000Z","dependencies_parsed_at":"2024-10-20T09:58:07.163Z","dependency_job_id":"795a4aa7-89eb-498e-9433-e6d65527a876","html_url":"https://github.com/agis/ruby-sdnotify","commit_stats":{"total_commits":37,"total_committers":8,"mean_commits":4.625,"dds":0.6756756756756757,"last_synced_commit":"98eaf641d597c489051af660a5a8edc3939da1d2"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agis%2Fruby-sdnotify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agis%2Fruby-sdnotify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agis%2Fruby-sdnotify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agis%2Fruby-sdnotify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agis","download_url":"https://codeload.github.com/agis/ruby-sdnotify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305935,"owners_count":20917208,"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":["ruby","ruby-sdnotify","sd-notify","sdnotify","systemd","systemd-service-notification","watchdog"],"created_at":"2024-10-01T18:11:25.284Z","updated_at":"2025-04-05T08:08:13.103Z","avatar_url":"https://github.com/agis.png","language":"Ruby","readme":"# ruby-sdnotify\n\n[![Gem Version](https://badge.fury.io/rb/sd_notify.svg)](https://badge.fury.io/rb/sd_notify)\n[![Build status](https://github.com/agis/ruby-sdnotify/actions/workflows/ci.yml/badge.svg)](https://github.com/agis/ruby-sdnotify/actions/workflows/ci.yml)\n[![Documentation](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/github/agis/ruby-sdnotify)\n[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)\n\n\nA pure-Ruby implementation of [sd_notify(3)](https://www.freedesktop.org/software/systemd/man/sd_notify.html) that can be used to\ncommunicate state changes of Ruby programs to [systemd](https://www.freedesktop.org/wiki/Software/systemd/).\n\nRefer to the [API documentation](http://www.rubydoc.info/github/agis/ruby-sdnotify) for more info.\n\n## Getting started\n\nInstall ruby-sdnotify:\n\n```shell\n$ gem install sd_notify\n```\n\nIf you're using Bundler, add it to your Gemfile:\n\n```ruby\ngem \"sd_notify\"\n```\n\n## Usage\n\nThe [API](http://www.rubydoc.info/github/agis/ruby-sdnotify) is mostly tied to\nthe official implementation, therefore refer to the [sd_notify(3) man pages](https://www.freedesktop.org/software/systemd/man/sd_notify.html)\nfor detailed description of how the notification mechanism works.\n\nAn example involving a dummy workload (assuming the program is shipped as a\nsystemd service):\n\n```ruby\nrequire \"sd_notify\"\n\nputs \"Hello! Booting...\"\n\n# doing some initialization work...\nsleep 2\n\n# notify systemd that we're ready\nSdNotify.ready\n\nsum = 0\n5.times do |i|\n  # doing our main work...\n  sleep 1\n\n  sum += 1\n\n  # notify systemd of our progress\n  SdNotify.status(\"{sum} jobs completed\")\nend\n\nputs \"Finished working. Shutting down...\"\n\n# notify systemd we're shutting down\nSdNotify.stopping\n\n# doing some cleanup work...\nsleep 2\n\nputs \"Bye\"\n```\n\n## License\n\nruby-sdnotify is licensed under MIT. See [LICENSE](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagis%2Fruby-sdnotify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagis%2Fruby-sdnotify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagis%2Fruby-sdnotify/lists"}