05.01.2016, 09:11, "Pathangi Janardhanan" <path.j...@gmail.com>:
Hi,

 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,
and here is the snippet of code that is being called to store the FDS. I have also included the debug code.

 // Store the FDs with systemd
    e = getenv("NOTIFY_SOCKET");
    if (e == NULL) {
        syslog(LOG_NOTICE, "environment variable Notify socket is null");
    } else {
        syslog(LOG_NOTICE, "env. variable Notify Socket =%s %d", e,
                           strlen(e));
    }

    syslog(LOG_NOTICE, "Storing %d number of fds", num_fd);
    ret = sd_pid_notify_with_fds(0, 0, "FDSTORE=1\n", (const int *) fd,
                           num_fd);
    syslog(LOG_NOTICE, "Result of sd notify %d", ret);

 From the debug printf I see
Jan  5 00:37:23 ctoserver11 /usr/bin/myechoser[13640]: env. variable Notify Socket =/run/systemd/notify 19
Jan  5 00:37:23 ctoserver11 /usr/bin/myechoser[13640]: Storing 1 number of fds
Jan  5 00:37:23 ctoserver11 /usr/bin/myechoser[13640]: Result of sd notify -22


 The return value seems to be -EINVAL, but looking at the code and the above debug, I am not sure why this is happening?

 Any help would be great.

Thanks
Jana

 
,

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

 
Which version of systemd are you using?
 
See https://github.com/systemd/systemd/commit/a5bd3c32abb00ad945282568fd1a97c180b68047
That bug affects `systemtctl restart systemd-journald`.
See https://github.com/systemd/systemd/issues/2236#issuecomment-167739937
 
--
Best regards,
Evgeny Vereshchagin
 
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to