File: nathan

package info (click to toggle)
workman 1.3.4-9
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,164 kB
  • ctags: 1,170
  • sloc: ansic: 14,491; makefile: 142; sh: 44
file content (31 lines) | stat: -rw-r--r-- 1,413 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
It looks like workman forks a few places itself.  I am guessing that
there's a fork before the database lookup (load()) -- every process that
calls load() can fork exactly one child at a time, but if there are
multiple processes calling load(), that could be the problem.

To check, you could do something like
        /* Asyncronous */
+       if (cddb.protocol && !found_in_rc && !found_in_db && !cddb_lock) {
            /* Make sure we only have one request out to CDDB at a time.
               In case server is down or something, we don't want to keep
               forking children. */
            cddb_lock = 1;   /* was poorly named in_cddb */
            signal(SIGCHLD, (sig_t)wakeup_from_cddb);
            if (!fork()) {
                /* Child */
+               fprintf(stderr, "parent %x spawned %x\n",
+                       getppid(), getpid());
+               cddb_lock = 1; /* extra safety, can't hurt */
                check_in_cddb();
                exit(0);
            }
        }

To fix it, you'd either have to remove the multiple processes calling
load(), or make this a per-user lock instead of a per-process, maybe by
using a lock file ~/.workman.cddb.lock or something. 

But I think that's Workman's problem, and not libworkman's problem, and 
I was just trying to fix AScd.  If libworkman is no longer maintained as 
a separate entity, then I'm not so concerned with it.