[Paul Alfille] > Interesting. Perhaps turning on debugging would give some hints of > where the problem lies. > My money is on the pl2303 driver that I've had trouble with.
I've moved it to the real setup now. I'll check some more if it continues to be a problem. > I don't know. The newest version 2.7p36 reworks some of the owserver > handling and might be better. I'd appreciate if you could give it a test. Will do! >> By the way, an idea for owserver (perhaps as an option): let it fork >> at startup, let the child do the usual stuff and have the parent >> restart if the child crashes. In my pretty complex setups, owserver >> crashes happen from time to time (usually days or weeks apart for >> 2.7p22, later versions seem more unstable), so I use an external >> watchdog to restart owserver when it dies. I haven't been able to >> figure out what causes these crashes or disappearing devices. I've >> had one setup with about 20 devices that never has had any problems, >> currently owserver was started 323 days ago, still running... >> > > In my longest running implementation, I start owserver from inittab, which > does exactly what you describe. (Restart on crash). > > Do you have any example code for this? Forking is no problem, we already fork > for entering background. I'm a little wary of signal handling, and how well > this > will work on all platforms (uClibc for instance). In that case the parent exits, so you would need to fork again. I'm not an expert, but I would simply use waitpid in the parent to wait for the child to crash (or otherwise exit). But the trickier part is perhaps that we probably want to be able to kill the parent and the child with it, so we need the parent to catch the signal and pass it on. I'm not sure if signals will be a problem on embedded platforms. I would think this is pretty basic and should work. Threads are trickier. Something like this: #include <sys/types.h> #include <unistd.h> #include <stdio.h> #include <signal.h> void signal_handler(int sig) { signal(sig, SIG_DFL); kill(0, sig); } int main() { while (1) { int pid = fork(); if (!pid) { /* Child process, do stuff */ while (1) { printf("Child working\n"); sleep(1); } } else { /* Parent */ /* Catch signals that we want to pass to child */ signal(SIGHUP, &signal_handler); signal(SIGINT, &signal_handler); signal(SIGQUIT, &signal_handler); signal(SIGTERM, &signal_handler); printf("pid %d\n", pid); waitpid(pid, 0, 0); /* Reset back to default */ signal(SIGHUP, SIG_DFL); signal(SIGINT, SIG_DFL); signal(SIGQUIT, SIG_DFL); signal(SIGTERM, SIG_DFL); } } } -- Steinar ------------------------------------------------------------------------------ _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers