[systemd-devel] Query regarding NOTIFY_SOCKET

Tomasz Torcz tomek at pipebreaker.pl
Tue Nov 8 11:45:51 UTC 2016


On Tue, Nov 08, 2016 at 05:01:59PM +0530, Raghavendra. H. R wrote:
> Hi All,
> 
> I'm a newbie in Systemd init system and I'm exploring sd_notify which is
> basically used for notification purpose in SystemD.

  It is written “systemd” (all lowercase).
 
> I have created one unit file which is of type "notify" and in my
> application I have written sd_notify(0, "READY=1"); from which SystemD can
> be notified that my process in totally up and running.
> 
> Below given is my Service file.
> 
> *[Unit]*
> *Description=Sd_notify example*
> 
> *[Service]*
> *ExecStart=/etc/Myapp*


  This is not 'unit of type notify'. This is unit of type 'simple'.
Please read "man systemd.service" and paragraph Type= and choose
correctly.


> Need help in understanding what value should be set in the environment
> varaible NOTIFY_SOCKET.
> But there's no much information/documentation available on NOTIFY_SOCKET.

  NOTIFY_SOCKET is filled-in by systemd and it is available when you 
correctly defined unit type.  If you want to check it's value, you can
user getenv() inside you program and print the value.
  I think amount of documentation about NOTIFY_SOCKET is enough, if
you think there's something specific missing, let us know.


-- 
Tomasz Torcz               "Never underestimate the bandwidth of a station
xmpp: zdzichubg at chrome.pl    wagon filled with backup tapes." -- Jim Gray



More information about the systemd-devel mailing list