Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#782 closed Defect (fixed)

Launchd Incompatibilities

Reported by: dak180 Owned by: 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 (1)

edu.berkeley.boinc.plist (679 bytes) - added by dak180 15 years ago.
launchd plist file (10.5 Only)

Download all attachments as: .zip

Change History (9)

Changed 15 years ago by dak180

Attachment: edu.berkeley.boinc.plist added

launchd plist file (10.5 Only)

comment:1 Changed 15 years ago by Nicolas

Version: 6.2.196.2.18

comment:2 Changed 15 years ago by Nicolas

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

comment:3 Changed 15 years ago by KSMarksPsych

Owner: changed from davea to charlief

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

comment:4 in reply to:  2 ; Changed 15 years ago 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.

comment:5 in reply to:  4 Changed 15 years ago 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.

comment:6 Changed 15 years ago by dak180

Keywords: OSX added; OS X removed

comment:7 Changed 15 years ago by dak180

Keywords: daemon added

comment:8 Changed 15 years ago by charlief

Resolution: fixed
Status: newclosed

(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.

Note: See TracTickets for help on using tickets.