Skip to content

42ity/fty-service-status-systemd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fty-service-status-systemd

Fty-service-status plugin for systemd notification

How to build

mkdir build
cd build
cmake ..
make
make doc # to create doxygen documentation at the root of the project (at least doxygen is needed)

cmake .. -DBUILD_EXAMPLE=On # to also build example
make

Description

This plugin is a wrapper on "sd_notify" see man page here

When Operating Status is set at "InService" we notify systemd with a "READY=1" and when the Operating Status is set to "Stopping" or "Shutting Down" we notify systemd with "STOPPING=1". This allow systemd to syncronize process in a better way.

As an extra status for the service, for all Operating Status and Health States, we notify systemd with the "STATUS=Operating Status <X>, Health State <Y> "

By default the plugin is install here "$(PREFIX_LIBEXECDIR)/service_status_plugins/libfty-service-status-systemd.so"

The error codes return by the functions of the plugin are the one of "sd_notify" see man page here

How to use with systemd

Your service must be Type=notify

[Unit]
...

[Service]
#Define the service Type as notify to be allow systemd to get the notification
Type=notify
...

See example/example.service for the example service and Systemd official documentation for more information about systemd service

About

Service Status Plugin for Systemd

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •