[systemd-devel] FW: pthread_create() fails SysV in myDaemon on boot

Michael D. Berger m.d.berger at ieee.org
Fri Nov 4 09:26:10 PDT 2011


> -----Original Message-----
> From: Michal Schmidt [mailto:mschmidt at redhat.com] 
> Sent: Friday, November 04, 2011 07:20
> To: Michael D. Berger
> Cc: systemd-devel at lists.freedesktop.org
> Subject: Re: [systemd-devel] FW: pthread_create() fails SysV 
> in myDaemon on boot
> 
> On Thu, 03 Nov 2011 12:41:05 -0400 Michael D. Berger wrote:
> > However, in starting a TCP listener socket, from 
> "bind(...)" I now get 
> > EADDRNOTAVAIL which is explained in "man 2 bind", so I am still not 
> > operational.
> 
> Do you use NetworkManager? The network interface may not be 
> up yet when your service starts. Does enabling 
> NetworkManager-wait-online.service
> help?
> 
> Have you considered using the IP_FREEBIND socket option to 
> avoid the need for ordering your service after network.target? See:
> http://www.kernel.org/doc/man-pages/online/pages/man7/ip.7.html
> 
> Michal
> 
[...]

I applied the fix mentioned before:
   in /etc/systemd/system.conf, 
   change
   #DefaultControllers=cpu
   into
   DefaultControllers=

I then removed myDaemon.service to start in SysV, and after
googing around, put this in my listener setup:
   int   optOn = 1;
   setsockopt(getHandle(),IPPROTO_IP,IP_FREEBIND,&optOn,sizeof(optOn))

It worked.  I now have myDaemon starting on boot, and
working correctly.

I am still hoping for additional information to get it
working correctly in systemd, as mentioned in other posts.

Thanks,
Mike.
--
Michael D. Berger
m.d.berger at ieee.org
http://www.rosemike.net/
  



More information about the systemd-devel mailing list