<div dir="ltr"><div><div><div><div>Hi,<br><br></div> I am using the function sd_pid_notify_with_fds and am unable to store the fds with systemd. My service is a simple echo server, <br></div>and here is the snippet of code that is being called to store the FDS. I have also included the debug code.<br><br> // Store the FDs with systemd<br>    e = getenv("NOTIFY_SOCKET");<br>    if (e == NULL) {<br>        syslog(LOG_NOTICE, "environment variable Notify socket is null");<br>    } else {<br>        syslog(LOG_NOTICE, "env. variable Notify Socket =%s %d", e,<br>                           strlen(e));<br>    }<br><br>    syslog(LOG_NOTICE, "Storing %d number of fds", num_fd);<br>    ret = sd_pid_notify_with_fds(0, 0, "FDSTORE=1\n", (const int *) fd,<br>                           num_fd);<br>    syslog(LOG_NOTICE, "Result of sd notify %d", ret);<br><br></div> From the debug printf I see<br>Jan  5 00:37:23 ctoserver11 /usr/bin/myechoser[13640]: env. variable Notify Socket =/run/systemd/notify 19<br>Jan  5 00:37:23 ctoserver11 /usr/bin/myechoser[13640]: Storing 1 number of fds<br>Jan  5 00:37:23 ctoserver11 /usr/bin/myechoser[13640]: Result of sd notify -22<br><br><br></div><div> The return value seems to be -EINVAL, but looking at the code and the above debug, I am not sure why this is happening?<br><br></div><div> Any help would be great.<br><br></div><div>Thanks<br></div><div>Jana<br><br></div><div>  <br><span></span><span></span><br></div></div>