Ticket #782 (closed Defect: fixed)

Opened 1 year ago

Last modified 3 months ago

Launchd Incompatibilities

Reported by: dak180 Assigned to: charlief
Priority: Undetermined Milestone: Undetermined
Component: Client - Daemon Version: 6.2.18
Keywords: launchd, OSX, 10.5, daemon Cc:

Description

With the attached plist launchd restarts boinc continuously because there is already a copy running.

This leads me to believe that boinc is not following the rules for a launchd controlled daemon.

A daemon or agent launched by launchd MUST NOT do the following
 in the process directly launched by launchd:

  oo   Call daemon(3).
  oo   Do the moral equivalent of daemon(3) by calling fork(2)
        and have the parent process exit(3) or _exit(2).

I am running the OS X version which is 6.2.18 not 6.2.19.

Attachments

edu.berkeley.boinc.plist (0.7 kB) - added by dak180 on 11/24/08 18:22:01.
launchd plist file (10.5 Only)

Change History

11/24/08 18:22:01 changed by dak180

  • attachment edu.berkeley.boinc.plist added.

launchd plist file (10.5 Only)

11/25/08 03:22:39 changed by Nicolas

  • version changed from 6.2.19 to 6.2.18.

(follow-up: ↓ 4 ) 11/25/08 03:23:43 changed by Nicolas

If you use the -daemon switch, daemon(3) will be called. So... don't use that switch?

11/25/08 04:45:35 changed by KSMarksPsych

  • owner changed from davea to charlief.

Reassigning this to Charlie as it's a Mac thing.

(in reply to: ↑ 2 ; follow-up: ↓ 5 ) 11/25/08 11:07:21 changed by dak180

Replying to Nicolas:

If you use the -daemon switch, daemon(3) will be called. So... don't use that switch?

I may be wrong, but I do not think that that is all that the '-daemon' switch does.

Even if that were the case the plist file that is included in [14490] has the switch in it and should not.

(in reply to: ↑ 4 ) 11/25/08 17:06:20 changed by charlief

Replying to dak180:

Replying to Nicolas:

If you use the -daemon switch, daemon(3) will be called. So... don't use that switch?

I may be wrong, but I do not think that that is all that the '-daemon' switch does. Even if that were the case the plist file that is included in [14490] has the switch in it and should not.

First, BOINC does follow all the rules in the document referenced by dak180. It does not call either daemon() or fork() followed by exit() or _exit().

Second, the -daemon argument does not cause BOINC to call daemon (3). The affect of arguments is determined solely by how they are used by BOINC Client's code. The -daemon argument in the plist file is correct and necessary; BOINC uses this to tell it not to exit automatically when it detects that the manager has quit or crashed.

Third, the problem arises because dak180 has modified the original plist which is installed by the Make_BOINC_Service.sh script available on the BOINC web site. The original script works correctly. He has added the KeepAlive? tag, which has introduced this problem.

However, the KeepAlive? tag should work. I'm investigating this issue. It seems that even though launchd does properly launch BOINC at system boot, it fails to recognize that it is running after that and tries to launch it again with the KeepAlive? tag. I've also noticed that launchctl stop edu.berkeley.boinc doesn't work properly; I suspect these issues are related.

I'll update this ticket when I have more information.

11/25/08 17:14:44 changed by dak180

  • keywords changed from launchd, OS X, 10.5 to launchd, OSX, 10.5.

11/25/08 17:23:27 changed by dak180

  • keywords changed from launchd, OSX, 10.5 to launchd, OSX, 10.5, daemon.

11/26/08 05:43:11 changed by charlief

  • status changed from new to closed.
  • resolution set to fixed.

(In [16565]) client: Fix error from changeset 14415 which caused Mac client to call daemon() if it was passed -daemon argument, causing problems using launchd with KeepAlive? option; fixes #782.


If this page is incomplete or incorrect, please edit it or add it to the wiki to-do list. To do this, you must be logged in; click Login or Register above.