All Projects → agis → ruby-sdnotify

agis / ruby-sdnotify

Licence: MIT license
A pure-Ruby implementation of systemd's sd_notify(3)

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to ruby-sdnotify

Fluent Plugin Systemd
This is a fluentd input plugin. It reads logs from the systemd journal.
Stars: ✭ 124 (+169.57%)
Mutual labels:  systemd
Chkservice
Systemd units manager with ncurses, terminal interface
Stars: ✭ 219 (+376.09%)
Mutual labels:  systemd
squashmount
Init and management script for mounting rewritable squashfs-compressed data
Stars: ✭ 40 (-13.04%)
Mutual labels:  systemd
Pia Tools
Shell script to automate privateinternetaccess port forwarding and starting/stopping transmission when connected/disconnected and other stuff
Stars: ✭ 130 (+182.61%)
Mutual labels:  systemd
Ansible Role Hardening
Ansible role to apply a security baseline. Systemd edition.
Stars: ✭ 188 (+308.7%)
Mutual labels:  systemd
Dplatform Shell
Deploy self-hosted apps easily: simple, bloat-free, independent installation
Stars: ✭ 245 (+432.61%)
Mutual labels:  systemd
Asus Fan Control
🌀 Fan control for ASUS devices running Linux.
Stars: ✭ 120 (+160.87%)
Mutual labels:  systemd
ansible-role-systemd-service
No description or website provided.
Stars: ✭ 37 (-19.57%)
Mutual labels:  systemd
Container Linux Update Operator
A Kubernetes operator to manage updates of Container Linux by CoreOS
Stars: ✭ 208 (+352.17%)
Mutual labels:  systemd
fresh-coffee-listener
Using a raspberry pi, we listen to the coffee machine and count the number of coffee consumption
Stars: ✭ 52 (+13.04%)
Mutual labels:  systemd
Netctl
Profile based systemd network management
Stars: ✭ 163 (+254.35%)
Mutual labels:  systemd
Procsd
Manage your application processes in production hassle-free like Heroku CLI with Procfile and Systemd
Stars: ✭ 181 (+293.48%)
Mutual labels:  systemd
journald
Go implementation of systemd Journal's native API for logging
Stars: ✭ 34 (-26.09%)
Mutual labels:  systemd
Graceful
graceful reload golang http server, zero downtime, compatible with systemd, supervisor
Stars: ✭ 129 (+180.43%)
Mutual labels:  systemd
watchdogd
Advanced system & process supervisor for Linux
Stars: ✭ 146 (+217.39%)
Mutual labels:  watchdog
Go Systemd
Go bindings to systemd socket activation, journal, D-Bus, and unit files
Stars: ✭ 1,756 (+3717.39%)
Mutual labels:  systemd
Systemd Ngrok
Automatically start ngrok by systemd
Stars: ✭ 241 (+423.91%)
Mutual labels:  systemd
nspawn
Containers with systemd-nspawn
Stars: ✭ 19 (-58.7%)
Mutual labels:  systemd
sicherboot
Unmaintained systemd-boot integration with secure boot support; consider https://github.com/Foxboron/sbctl instead.
Stars: ✭ 31 (-32.61%)
Mutual labels:  systemd
daemons.el
An Emacs UI for managing init system services
Stars: ✭ 87 (+89.13%)
Mutual labels:  systemd

ruby-sdnotify

Gem Version Build status Documentation License

A pure-Ruby implementation of sd_notify(3) that can be used to communicate state changes of Ruby programs to systemd.

Refer to the API documentation for more info.

Getting started

Install ruby-sdnotify:

$ gem install sd_notify

If you're using Bundler, add it to your Gemfile:

gem "sd_notify"

Usage

The API is mostly tied to the official implementation, therefore refer to the sd_notify(3) man pages for detailed description of how the notification mechanism works.

An example involving a dummy workload (assuming the program is shipped as a systemd service):

require "sd_notify"

puts "Hello! Booting..."

# doing some initialization work...
sleep 2

# notify systemd that we're ready
SdNotify.ready

sum = 0
5.times do |i|
  # doing our main work...
  sleep 1

  sum += 1

  # notify systemd of our progress
  SdNotify.status("{sum} jobs completed")
end

puts "Finished working. Shutting down..."

# notify systemd we're shutting down
SdNotify.stopping

# doing some cleanup work...
sleep 2

puts "Bye"

License

ruby-sdnotify is licensed under MIT. See LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].