[CUWiN-Dev] hslsd updates coming

Bill Comisky bcomisky at pobox.com
Mon Oct 17 14:46:06 CDT 2005


On Wed, 12 Oct 2005, David Young wrote:

> On Tue, Sep 27, 2005 at 11:30:09AM -0500, Bill Comisky wrote:
    [ snip ]
>> Ok, since my last upgrade I've seen a node in the testbed rebooting
>> frequently again.  This time I had it dump a bunch of things if hellowdog
>> sends STOP to wdogctl.  No hslsd core files, but from the daemon log it
>> looks like the tickle process is hanging or not being reaped or something:
>>
>> $ grep tickle daemon
>> daemon:Sep  5 18:55:37 cuw hslsd: hsls_shell_tickle: tickle cancelled,
>> tickle process 6648 still runs
    [ snip ]
>> daemon:Sep  5 18:55:52 cuw hslsd: hsls_shell_tickle: tickle cancelled,
>> tickle process 6648 still runs
>
> Bill,
>
> I believe this patch will make the problem go away.
>
> Dave

Dave,

Good seeing you last week.. Attached is a diff of my patched 
hsls_watchdog.c against HEAD.  When I read the waitpid() manpage I thought 
that 0 was returned when WNOHANG was specified if the process was still 
running (a condition it would've waited for without WNOHANG), and -1 was 
for processes not found.  I don't think I've hit that IF condition since 
adding the waitpid() though..

Bill

--
Bill Comisky
bcomisky at pobox.com
-------------- next part --------------
1c1
< /* $Id: hsls_watchdog.c 3581 2005-10-17 11:37:15Z dyoung $ */
---
> /* $Id: /cuw/branches/cnt/src/hsls/hsls_watchdog.c 3171 2005-10-03T14:37:32.482832Z bcomisky  $ */
47d46
< #include "misc/event.h"
144d142
< 	int status;
146a145
> 	int status;
160,164c159,166
< 	if (hsw->hsw_pid != 0 &&
< 	    waitpid(hsw->hsw_pid, &status, WNOHANG) == -1) {
< 		loglib_warnx("%s: tickle cancelled, "
< 		    "tickle process %u still runs", __func__, hsw->hsw_pid);
< 		return 0;
---
> 	if (hsw->hsw_pid != 0) {
> 		if (waitpid(hsw->hsw_pid, &status, WNOHANG) == 0) {
> 			loglib_warnx("%s: tickle cancelled, "
> 			   	"tickle process %u still runs", __func__, hsw->hsw_pid);
> 			return 0;
> 		} else {
> 			hsw->hsw_pid = 0;
> 		}
168c170
< 		SIGNAL_SET(&hsw->hsw_sigchld_ev, SIGCHLD, sigchild_handler,
---
> 		signal_set(&hsw->hsw_sigchld_ev, SIGCHLD, sigchild_handler,
170c172
< 		SIGNAL_ADD(&hsw->hsw_sigchld_ev, NULL);
---
> 		signal_add(&hsw->hsw_sigchld_ev, NULL);


More information about the CU-Wireless-Dev mailing list