Re: [systemd-devel] Unable to store fds with systemd and reterive it back again

2016-01-06 Thread Daniel Mack
Hi, On 01/06/2016 12:07 AM, Pathangi Janardhanan wrote: > Hi All, > > After trying a few things out, here are couple doubts that I have. > > 1. I am able to get this to work, if I modify the way the sendmsg is > being done, here is a temp. function that I wrote in my own service > to mimic the

Re: [systemd-devel] Unable to store fds with systemd and reterive it back again

2016-01-06 Thread Pathangi Janardhanan
Hi Daniel, >It's only necessary to connect() sockets that are in connection mode >(SOCK_STREAM or SOCK_SEQPACKET), but this one is a SOCK_DGRAM socket. >The reason why this is failing is because your systemd version is too >old. All versions prior to v227 have a bug that causes a miscalculation

Re: [systemd-devel] Unable to store fds with systemd and reterive it back again

2016-01-05 Thread Pathangi Janardhanan
Hi, >> ret = sd_pid_notify_with_fds(0, 0, "FDSTORE=1\n", (const int *) fd, >>num_fd); > Is "fd" a single fd? If so you need to pass this as of course... No, fd is a int array, which holds num_fd, "fd" values. >The FDSTORE=1 line doesn't need to be suffixed with

Re: [systemd-devel] Unable to store fds with systemd and reterive it back again

2016-01-05 Thread Pathangi Janardhanan
Hi, >> This is the output of the strace call on this section of the code in >> the sd_pid_notify_with_fds, when I try to save the fds. >> >> socket(PF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 8 >> >> sendmsg(8, {msg_name(21)={sa_family=AF_LOCAL, >> sun_path="/run/systemd/notify"},

Re: [systemd-devel] Unable to store fds with systemd and reterive it back again

2016-01-05 Thread Daniel Mack
On 01/05/2016 06:33 PM, Pathangi Janardhanan wrote: > This is the output of the strace call on this section of the code in > the sd_pid_notify_with_fds, when I try to save the fds. > > socket(PF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 8 > > sendmsg(8, {msg_name(21)={sa_family=AF_LOCAL, >

Re: [systemd-devel] Unable to store fds with systemd and reterive it back again

2016-01-05 Thread Lennart Poettering
On Tue, 05.01.16 01:11, Pathangi Janardhanan (path.j...@gmail.com) wrote: > 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

Re: [systemd-devel] Unable to store fds with systemd and reterive it back again

2016-01-05 Thread Pathangi Janardhanan
Hi All, After trying a few things out, here are couple doubts that I have. 1. I am able to get this to work, if I modify the way the sendmsg is being done, here is a temp. function that I wrote in my own service to mimic the actions of sd_pid_notify_with_pids and with this I am able to store

Re: [systemd-devel] Unable to store fds with systemd and reterive it back again

2016-01-04 Thread Evgeny Vereshchagin
05.01.2016, 09:11, "Pathangi Janardhanan" :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

Re: [systemd-devel] Unable to store fds with systemd and reterive it back again

2016-01-04 Thread Tomasz Torcz
On Tue, Jan 05, 2016 at 01:11:16AM -0500, Pathangi Janardhanan wrote: > 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