FYI, Look at this old patch/workaround in asterisk which solved the problem
with daemon() and uClibc.

https://dev.openwrt.org/browser/packages/net/asterisk-1.6.x/patches/200-ucli
bc-daemon.patch?rev=14304

/Christian



-----Original Message-----
From: Roseen, Göran [mailto:goran.ros...@software-innovation.se] 
Sent: den 8 mars 2010 12:54
To: OWFS (One-wire file system) discussion and help
Subject: Re: [Owfs-developers] owfs (owserver) on DNS-323. Will not runin
the background.

Thanks for the tip! I have uClibc 0.9.28, which dates back to 2007, so it
might very well be the problem.
 
I have tried to build it from recent sources, but ran across i a lot of
minor issues concerning the unusual layout of the device (I do the compiling
ON the device itself). But I'll try some more, or maybe I'll just try the
daemon function in owlib instead. I'll be back later and report what
happens.
 
Göran Roseen


________________________________

Från: Christian Magnusson [mailto:m...@mag.cx]
Skickat: sö 2010-03-07 10:21
Till: 'OWFS (One-wire file system) discussion and help'
Ämne: Re: [Owfs-developers] owfs (owserver) on DNS-323. Will not runin the
background.



I guess your uClibc version contain a bug which result into a non-working
daemon() function. (since it call wrong fork() function).

 

Do you know exactly which UCLIBC version you have?  There is a workaround to
define the daemon() function within the owlib, and that might be possible
for you. Otherwise you probably need to patch uClibc and recompile
everything for your NAS.

The old bug in uClibc is caused by a faulty libc_hidden_proto to fork().

 

+--- uClibc.org/libc/unistd/daemon.c    2009-07-14 11:09:20.000000000 +0200

++++ uClibc/libc/unistd/daemon.c        2009-08-06 10:21:57.000000000 +0200

+@@ -54,7 +54,7 @@

+ libc_hidden_proto(dup2)

+ libc_hidden_proto(setsid)

+ libc_hidden_proto(chdir)

+-libc_hidden_proto(fork)

++/* libc_hidden_proto(fork) */

+

+ int daemon( int nochdir, int noclose )

+ {

 

 

/Christian

 

 

 

From: Paul Alfille [mailto:paul.alfi...@gmail.com] 
Sent: den 6 mars 2010 22:06
To: OWFS (One-wire file system) discussion and help
Subject: Re: [Owfs-developers] owfs (owserver) on DNS-323. Will not run in
the background.

 

 

On Sat, Mar 6, 2010 at 1:18 PM, Roseen, Göran
<goran.ros...@software-innovation.se> wrote:

Hi all,

I have a DLink DNS-323 Network Attached Storage, and besides storing stuff
on it, it is a perfect little server for things you want to keep running 24
hours. Like the WRT54G, but with a lot more storage.


Any idea what distribution you are using? Especially what C library. It
looks like the handling of glibc and uclibc on matters like fork and daemon
are different.
 

        I downloaded owfs-2.7p28 and ran ./configure and make install, and
hey! It compiled with no errors!
        I then tried to run owserver with a test adapter. It started three
threads in the background that I can see with ps ax, but owdir shows
nothing.
        
        Then I tried running owserver in the foreground, and that works
fine! It works nicely with -u and owget gives me the temperature on a
connected sensor.
        
        (I haven't got Fuse, so I don't intend to run owfs. Configure
detected this nicely.)
        
        I see a line of code in owserver.c, saying something about special
treatment of exit() on the wrt54, compiled in with the macro __UCLIBC__.
Perhaps this is needed on the DNS-323 too. I do have uclibc on the machine,
but I am not sure if the library path is set correctly. And I can't see
anything in ./configure or the Makefiles referring to this macro.


The code to go into the background is in modules/owlib/src/c/daemon.c

 

        Does anyone have any ideas on how I can go on debugging? I tried
running with verbose output redirected to a file, but when running in the
background I don't get any output at all.

Are there any messages posted to syslog?

 

__________ Information från ESET NOD32 Antivirus, version av
virussignaturdatabas 4921 (20100306) __________

 

Meddelandet har kontrollerats av ESET NOD32 Antivirus.

 

http://www.esetscandinavia.com



__________ Information från ESET NOD32 Antivirus, version av
virussignaturdatabas 4921 (20100306) __________

Meddelandet har kontrollerats av ESET NOD32 Antivirus.

http://www.esetscandinavia.com <http://www.esetscandinavia.com/> 

 

__________ Information från ESET NOD32 Antivirus, version av
virussignaturdatabas 4926 (20100308) __________

Meddelandet har kontrollerats av ESET NOD32 Antivirus.

http://www.esetscandinavia.com
 
 

__________ Information från ESET NOD32 Antivirus, version av
virussignaturdatabas 4926 (20100308) __________

Meddelandet har kontrollerats av ESET NOD32 Antivirus.

http://www.esetscandinavia.com
 

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to