Module: KStor::Systemd
- Defined in:
- lib/kstor/systemd.rb
Overview
Collection of methods for systemd integration.
Class Method Summary collapse
-
.service_ready ⇒ Object
Notify systemd that we’re ready to serve clients.
-
.service_stopping ⇒ Object
Notify systemd that we’re stopping.
-
.socket ⇒ nil, Socket
Get main socket from systemd.
Class Method Details
.service_ready ⇒ Object
Notify systemd that we’re ready to serve clients.
20 21 22 |
# File 'lib/kstor/systemd.rb', line 20 def service_ready SdNotify.ready end |
.service_stopping ⇒ Object
Notify systemd that we’re stopping.
25 26 27 |
# File 'lib/kstor/systemd.rb', line 25 def service_stopping SdNotify.stopping end |
.socket ⇒ nil, Socket
Get main socket from systemd
12 13 14 15 16 17 |
# File 'lib/kstor/systemd.rb', line 12 def socket listen_pid = ENV['LISTEN_PID'].to_i return nil unless Process.pid == listen_pid Socket.for_fd(3) end |