[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Linux-cluster] qdiskd does not start

On Tue, 03. Jun 2008, Stephan Windmüller wrote:

> With strace I see that qdiskd reads /var/run/qdiskd.pid and tries to
> access this process (which is not running any more). Even when I delete
> this pid-file nothing changes.

After reading parts of the source code I think that I found the problem.
In qdisk/main.c the function daemon_init is called:

| if (daemon_init(argv[0]) < 0)
|     goto out;

But the type of daemon_init is "void" and it does not return a value:

| void
| daemon_init(char *prog)
| {
|       [...]
|       daemon(0, 0);
|       update_pidfile(prog);
| }

I do not understand why the linker does not produce an error here. Also it
seems unwanted that daemon_init dies with "exit(1)" when an error occurs
instead of returning -1.

However, qdiskd will always exit when daemonized with this code. I removed the
comparison < 0 and got this in syslog:

| qdiskd: <info> Initial score 3/3 
| qdiskd: <info> Initialization complete 
| qdiskd: <notice> Score sufficient for master operation (3/3; required=1); upgrading 
| qdiskd: <debug> Making bid for master 
| qdiskd: <info> Assuming master role 

But after that "cman_tool status" hangs and produces no output.

- Stephan

Attachment: signature.asc
Description: Digital signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]