From Carl.Smith at kaseya.com Fri Feb 8 15:45:16 2008 From: Carl.Smith at kaseya.com (Carl Smith) Date: Fri Feb 8 15:45:15 2008 Subject: [launchd-dev] LaunchD crashing daemon in 10.5 In-Reply-To: References: Message-ID: <926D7E8EA6861E42B40F0953566F27AA0367EC98@EHOST005-42.exch005intermedia.net> I have an agent and daemon that I have installed and running on a 10.5 system. The problem I am having is when I do an 'update' the call from 'sudo launchctl unload /System/Library/LaunchDaemons/com.mycompany.mydaemon.com' my daemon receives a SIGTERM and aborts and the rest of my install procedures fails. My project consists of an agent and a daemon. The plists that I use 'launchctl unload' on live in the following areas: Daemon = /System/Library/LaunchDaemons/ Agent = /Library/LaunchAgents/ I use 'sudo launchctl unload ...' for the daemon and 'launchctl unload ...' for the agent. This 'update' works fine in 10.4 but fails under 10.5. I can install my agent and daemon fine I just can't seem to 'unload' gracefully running in the 10.5 enviroment. Any suggestions or help would greatly be appreciated. Carl From hamish at gmail.com Fri Feb 8 15:59:18 2008 From: hamish at gmail.com (Hamish Allan) Date: Fri Feb 8 15:59:18 2008 Subject: [launchd-dev] LaunchD crashing daemon in 10.5 In-Reply-To: <926D7E8EA6861E42B40F0953566F27AA0367EC98@EHOST005-42.exch005intermedia.net> References: <926D7E8EA6861E42B40F0953566F27AA0367EC98@EHOST005-42.exch005intermedia.net> Message-ID: <597e7edb0802081559o4305f692q4023edd4cc3ae137@mail.gmail.com> Not that this should be causing the problem, but you shouldn't be writing to /System -- your daemon should be installed in /Library/LaunchDaemons. Can you not just catch SIGTERM in your daemon and exit cleanly? Hamish On Feb 8, 2008 11:45 PM, Carl Smith wrote: > I have an agent and daemon that I have installed and running on a 10.5 > system. The problem I am having is when I do an 'update' the call from > 'sudo launchctl unload > /System/Library/LaunchDaemons/com.mycompany.mydaemon.com' my daemon > receives a SIGTERM and aborts and the rest of my install procedures > fails. > > My project consists of an agent and a daemon. The plists that I use > 'launchctl unload' on live in the following areas: > > Daemon = /System/Library/LaunchDaemons/ > Agent = /Library/LaunchAgents/ > > I use 'sudo launchctl unload ...' for the daemon and 'launchctl unload > ...' for the agent. > > This 'update' works fine in 10.4 but fails under 10.5. I can install my > agent and daemon fine I just can't seem to 'unload' gracefully running > in the 10.5 enviroment. > > Any suggestions or help would greatly be appreciated. > > Carl > _______________________________________________ > launchd-dev mailing list > launchd-dev@lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo/launchd-dev > From Carl.Smith at kaseya.com Fri Feb 8 16:07:21 2008 From: Carl.Smith at kaseya.com (Carl Smith) Date: Fri Feb 8 16:07:21 2008 Subject: [launchd-dev] LaunchD crashing daemon in 10.5 In-Reply-To: <597e7edb0802081559o4305f692q4023edd4cc3ae137@mail.gmail.com> References: <926D7E8EA6861E42B40F0953566F27AA0367EC98@EHOST005-42.exch005intermedia.net> <597e7edb0802081559o4305f692q4023edd4cc3ae137@mail.gmail.com> Message-ID: <926D7E8EA6861E42B40F0953566F27AA0367EC99@EHOST005-42.exch005intermedia.net> I am taking over this project from another developer so please excuse me ahead of time for any 'stupid' questions. As far as SIGTERM goes in Apples tech notes about launchd it says one should be catching SIGTERM, for what I do not know, but my question would be why would catching it in 10.4 not make a different but in 10.5 it does? And why would 10.5 be throwing a SIGTERM and 10.4 not throwing one? Thanks Carl Not that this should be causing the problem, but you shouldn't be writing to /System -- your daemon should be installed in /Library/LaunchDaemons. Can you not just catch SIGTERM in your daemon and exit cleanly? Hamish On Feb 8, 2008 11:45 PM, Carl Smith wrote: > I have an agent and daemon that I have installed and running on a 10.5 > system. The problem I am having is when I do an 'update' the call from > 'sudo launchctl unload > /System/Library/LaunchDaemons/com.mycompany.mydaemon.com' my daemon > receives a SIGTERM and aborts and the rest of my install procedures > fails. > > My project consists of an agent and a daemon. The plists that I use > 'launchctl unload' on live in the following areas: > > Daemon = /System/Library/LaunchDaemons/ > Agent = /Library/LaunchAgents/ > > I use 'sudo launchctl unload ...' for the daemon and 'launchctl unload > ...' for the agent. > > This 'update' works fine in 10.4 but fails under 10.5. I can install my > agent and daemon fine I just can't seem to 'unload' gracefully running > in the 10.5 enviroment. > > Any suggestions or help would greatly be appreciated. > > Carl > _______________________________________________ > launchd-dev mailing list > launchd-dev@lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo/launchd-dev > _______________________________________________ launchd-dev mailing list launchd-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/launchd-dev From hamish at gmail.com Fri Feb 8 16:21:12 2008 From: hamish at gmail.com (Hamish Allan) Date: Fri Feb 8 16:21:11 2008 Subject: [launchd-dev] LaunchD crashing daemon in 10.5 In-Reply-To: <926D7E8EA6861E42B40F0953566F27AA0367EC99@EHOST005-42.exch005intermedia.net> References: <926D7E8EA6861E42B40F0953566F27AA0367EC98@EHOST005-42.exch005intermedia.net> <597e7edb0802081559o4305f692q4023edd4cc3ae137@mail.gmail.com> <926D7E8EA6861E42B40F0953566F27AA0367EC99@EHOST005-42.exch005intermedia.net> Message-ID: <597e7edb0802081621o7540da5en22ab3f7076779804@mail.gmail.com> On Feb 9, 2008 12:07 AM, Carl Smith wrote: > And why would 10.5 be throwing a SIGTERM and 10.4 not throwing one? I'm not sure, but there have been many enhancements to launchd between 10.4 and 10.5. SIGTERM is the appropriate signal for asking a POSIX process to terminate gracefully -- indeed, how did the daemon ever manage to exit gracefully under 10.4? Also, why does the rest of your installation procedure fail when your daemon exits abruptly? Hamish From jjacobs at motorola.com Fri Feb 8 17:27:55 2008 From: jjacobs at motorola.com (Joseph Jacobs) Date: Fri Feb 8 17:28:01 2008 Subject: [launchd-dev] LaunchD crashing daemon in 10.5 In-Reply-To: <597e7edb0802081621o7540da5en22ab3f7076779804@mail.gmail.com> References: <926D7E8EA6861E42B40F0953566F27AA0367EC98@EHOST005-42.exch005intermedia.net> <597e7edb0802081559o4305f692q4023edd4cc3ae137@mail.gmail.com> <926D7E8EA6861E42B40F0953566F27AA0367EC99@EHOST005-42.exch005intermedia.net> <597e7edb0802081621o7540da5en22ab3f7076779804@mail.gmail.com> Message-ID: >And why would 10.5 be throwing a SIGTERM and 10.4 not throwing one? Given the issues with LaunchAgents on 10.4, perhaps it wasn't getting launched by launchd at all, so launchd wasn't sending it a SIGTERM? From dev at skwdev.com Fri Feb 8 22:47:15 2008 From: dev at skwdev.com (Shaun Wexler) Date: Fri Feb 8 22:47:23 2008 Subject: [launchd-dev] LaunchD crashing daemon in 10.5 In-Reply-To: <926D7E8EA6861E42B40F0953566F27AA0367EC98@EHOST005-42.exch005intermedia.net> References: <926D7E8EA6861E42B40F0953566F27AA0367EC98@EHOST005-42.exch005intermedia.net> Message-ID: <690840FD-62D4-4FEB-A743-E37B763ADCBE@skwdev.com> On Feb 8, 2008, at 3:45 PM, Carl Smith wrote: > I have an agent and daemon that I have installed and running on a 10.5 > system. The problem I am having is when I do an 'update' the call from > 'sudo launchctl unload > /System/Library/LaunchDaemons/com.mycompany.mydaemon.com' my daemon > receives a SIGTERM and aborts and the rest of my install procedures > fails. > > My project consists of an agent and a daemon. The plists that I use > 'launchctl unload' on live in the following areas: > > Daemon = /System/Library/LaunchDaemons/ > Agent = /Library/LaunchAgents/ > > I use 'sudo launchctl unload ...' for the daemon and 'launchctl unload > ...' for the agent. > > This 'update' works fine in 10.4 but fails under 10.5. I can install > my > agent and daemon fine I just can't seem to 'unload' gracefully running > in the 10.5 enviroment. > > Any suggestions or help would greatly be appreciated. Your daemon is not following the spec. It must catch SIGTERM, cleanup, then exit(EX_OK). -- Shaun Wexler MacFOH http://www.macfoh.com "A person who never made a mistake never tried anything new." - Albert Einstein From Ryan.C.Spaulding at nasa.gov Mon Feb 11 13:49:32 2008 From: Ryan.C.Spaulding at nasa.gov (Ryan Spaulding) Date: Mon Feb 11 13:49:25 2008 Subject: [launchd-dev] launchd (257) not building Message-ID: <7985B539-3873-4324-97B6-5DB226C448CB@nasa.gov> Hi All, I am trying to build launchd for 10.5.1. I downloaded the source from the following URL: http://www.opensource.apple.com/darwinsource/10.5.1/ Below is the error output from running ./configure then make: mac919:launchd ryans$ make Making all in src cd .. && /bin/sh /Users/ryans/launchd/launchd-257/launchd/missing -- run autoheader rm -f stamp-h1 touch config.h.in cd .. && /bin/sh ./config.status src/config.h config.status: creating src/config.h config.status: src/config.h is unchanged make all-am gcc -DHAVE_CONFIG_H -I. -no-cpp-precomp -F/System/Library/ PrivateFrameworks -Wall -Wextra -Waggregate-return -Wshadow -Wmissing- prototypes -Wmissing-declarations -Werror -D__MigTypeCheck=1 - fvisibility=hidden -Dmig_external=__private_extern__ -I/System/ Library/Frameworks/System.framework/PrivateHeaders -g -O2 -MT launchctl-launchctl.o -MD -MP -MF .deps/launchctl-launchctl.Tpo -c -o launchctl-launchctl.o `test -f 'launchctl.c' || echo './'`launchctl.c In file included from launchctl.c:24: liblaunch_private.h:27:24: error: quarantine.h: No such file or directory In file included from launchctl.c:24: liblaunch_private.h:116: error: syntax error before ?qtn_proc_t? cc1: warnings being treated as errors liblaunch_private.h:116: warning: no semicolon at end of struct or union liblaunch_private.h:119: error: syntax error before ?}? token launchctl.c:31:35: error: CoreFoundation/CFPriv.h: No such file or directory launchctl.c:74:23: error: bootfiles.h: No such file or directory launchctl.c: In function ?do_sysversion_sysctl?: launchctl.c:2961: warning: implicit declaration of function ?_CFCopySystemVersionDictionary? launchctl.c:2961: warning: assignment makes pointer from integer without a cast launchctl.c:2965: error: ?_kCFSystemVersionBuildVersionKey? undeclared (first use in this function) launchctl.c:2965: error: (Each undeclared identifier is reported only once launchctl.c:2965: error: for each function it appears in.) launchctl.c: In function ?do_application_firewall_magic?: launchctl.c:3030: error: ?SO_EXECPATH? undeclared (first use in this function) launchctl.c: In function ?do_bootroot_magic?: launchctl.c:3090: error: syntax error before ?kBootRootActiveKey? make[2]: *** [launchctl-launchctl.o] Error 1 make[1]: *** [all] Error 2 make: *** [all-recursive] Error 1 Should I be downloading from subversion or am I missing something. I have been building launchd under Tiger for a while and have never run into any issues building it. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-dev/attachments/20080211/53c2d3ca/attachment.html From jaharmi at jaharmi.com Thu Feb 21 07:29:07 2008 From: jaharmi at jaharmi.com (Jeremy Reichman) Date: Thu, 21 Feb 2008 10:29:07 -0500 Subject: [launchd-dev] Global Login Items Message-ID: I realize this is not specifically related to launchd but I was reading Technote 2083 about the following: "Global Login Item A global login item is a login item that is launched when any user logs in. Installing a global login item is roughly equivalent to installing that login item for all users on the system: every time a user logs in, loginwindow launches that user's login items and all global login items. In Mac OS X 10.5 and later you can install a global login item using the shared file lists interface to Launch Services." Questions: A) is there a better list to ask about this? B) can these be installed/managed the way normal login items are, via a plist (loginwindow.plist contains login items in the User Domain) in the Local Domain along with supplying the executables it points to? C) how is this support different in 10.5 vs. the editing of /Library/Preferences/loginwindow.plist, which has been possible in the past? I ask because I have specific needs for Global Login Items (i.e. items run in the user context at login time, often with a GUI, in contrast to LaunchAgents -- which don't work in Tiger -- and the LoginHook). Up until this point, it has been something of a workaround to run them (especially lacking MCX and a directory service), although it could be done. For example: Thanks! -- Jeremy From launchd at khiltd.com Thu Feb 21 08:33:23 2008 From: launchd at khiltd.com (Nathan Duran) Date: Thu, 21 Feb 2008 08:33:23 -0800 Subject: [launchd-dev] Global Login Items In-Reply-To: References: Message-ID: <4BE2F43A-472C-4E62-B4F5-44AD36E7D727@khiltd.com> On Feb 21, 2008, at 7:29 AM, Jeremy Reichman wrote: > C) how is this support different in 10.5 vs. the editing of > /Library/Preferences/loginwindow.plist, which has been possible in > the past? It's different because you're not supposed to touch prefs files that don't belong to you. Going through a higher level API isolates your code from the format of the property list so changes to that format will not break your code, nor will your code break the OS. From gfranks at hwi.buffalo.edu Thu Feb 21 12:52:04 2008 From: gfranks at hwi.buffalo.edu (Geoff Franks) Date: Thu, 21 Feb 2008 15:52:04 -0500 Subject: [launchd-dev] Stray Proccess Log message Message-ID: I have a previously-cronned job that I'm moving to launchd on my new 10.5 server. It runs every 10 minutes, and causes the following entry to show up in the syslog: Feb 21 15:43:45 server1 com.apple.launchd[1] (edu.buffalo.hwi.raidutil[43977]): Stray process with PGID equal to this dead job: PID 43983 PPID 1 sendmail The script the launchd job runs calls sendmail a the end of it, so my guess is that the script finishes, while sendmail is still running, and then launchd has to clean up after the script exits, so tries to kill the sendmail process. However, my emails are all going through and seemingly working properly. Additionally, I specified the AbandonProccessGrop key in the plist so it wouldn't try cleaning up the other processes spawned. Shouldn't this take care of the log message? Geoff Franks Sr. Systems Administrator Hauptman Woodward Institute From zarzycki at apple.com Thu Feb 21 15:31:03 2008 From: zarzycki at apple.com (Dave Zarzycki) Date: Thu, 21 Feb 2008 15:31:03 -0800 Subject: [launchd-dev] Stray Proccess Log message In-Reply-To: References: Message-ID: <9F829F07-11D6-4F58-B9FD-52DFA501775A@apple.com> On Feb 21, 2008, at 12:52 PM, Geoff Franks wrote: > I have a previously-cronned job that I'm moving to launchd on my new > 10.5 > server. It runs every 10 minutes, and causes the following entry to > show up > in the syslog: > > Feb 21 15:43:45 server1 com.apple.launchd[1] > (edu.buffalo.hwi.raidutil[43977]): Stray process with PGID equal to > this > dead job: PID 43983 PPID 1 sendmail > > The script the launchd job runs calls sendmail a the end of it, so > my guess > is that the script finishes, while sendmail is still running, and then > launchd has to clean up after the script exits, so tries to kill the > sendmail process. However, my emails are all going through and > seemingly > working properly. That is probably just luck. > Additionally, I specified the AbandonProccessGrop > key in the plist so it wouldn't try cleaning up the other processes > spawned. > Shouldn't this take care of the log message? Nope. We hope that you'll someday update the script to either wait for descendant processes to finish, or alternatively, properly daemonize them. davez From launchd at khiltd.com Thu Feb 21 15:59:48 2008 From: launchd at khiltd.com (Nathan Duran) Date: Thu, 21 Feb 2008 15:59:48 -0800 Subject: [launchd-dev] Stray Proccess Log message In-Reply-To: References: Message-ID: <4BD28286-04F4-4FC8-B1BC-8536835D7279@khiltd.com> On Feb 21, 2008, at 12:52 PM, Geoff Franks wrote: > Feb 21 15:43:45 server1 com.apple.launchd[1] > (edu.buffalo.hwi.raidutil[43977]): Stray process with PGID equal to > this > dead job: PID 43983 PPID 1 sendmail NetAuthAgent and something mysteriously called "Locum" die this exact same way constantly on 10.5.2, usually right before LAN traffic grinds to a halt for no apparent reason. Looking at the chunk of code that prints these messages I've never been able to figure out *exactly* what set of conditions precipitates them (I have an idea, but that idea doesn't always match what I see going on), but they happen a lot, even with shipping Apple code. So often that I'd be in favor of a more verbose error message if such an idea were ever kicked around the office. From eskimo1 at apple.com Fri Feb 22 01:33:39 2008 From: eskimo1 at apple.com (Quinn) Date: Fri, 22 Feb 2008 09:33:39 +0000 Subject: [launchd-dev] Global Login Items In-Reply-To: References: Message-ID: At 10:29 -0500 21/2/08, Jeremy Reichman wrote: >A) is there a better list to ask about this? Not really. Questions like this typically go to the generic mailing lists (like cocoa-dev and carbon-dev), but I don't have the bandwith to read those lists (-: >B) can these be installed/managed the way normal login items are, via a >plist (loginwindow.plist contains login items in the User Domain) in the >Local Domain along with supplying the executables it points to? Pretty much, yes. >C) how is this support different in 10.5 vs. the editing of >/Library/Preferences/loginwindow.plist, which has been possible in the past? Mac OS X 10.5 has a compatibility layer that synchronises the login items that you set up the new API with the login items in the preferences file. It works for per-user and global login items. This compatibility layer will go away in future system software. Do not directly manipulate login items (either global or per-user) if the new API is available. In general, I recommend the following: o Use the new API if it's available. o Alternatively, if your needs are simple, use LoginItemsAE. o If the new API is not available and LoginItemsAE is insufficient, then directly manipulate the preferences file. Just to be clear, if you directly manipulate the preferences file, you are likely to break on a post-10.5.x system. S+E -- Quinn "The Eskimo!" Apple Developer Relations, Developer Technical Support, Core OS/Hardware From eskimo1 at apple.com Fri Feb 22 01:54:12 2008 From: eskimo1 at apple.com (Quinn) Date: Fri, 22 Feb 2008 09:54:12 +0000 Subject: [launchd-dev] Stray Proccess Log message In-Reply-To: <4BD28286-04F4-4FC8-B1BC-8536835D7279@khiltd.com> References: <4BD28286-04F4-4FC8-B1BC-8536835D7279@khiltd.com> Message-ID: At 15:59 -0800 21/2/08, Nathan Duran wrote: >NetAuthAgent and something mysteriously called "Locum" die this exact >same way constantly on 10.5.2, usually right before LAN traffic grinds >to a halt for no apparent reason. Locum is a privileged tool that Finder uses when it needs to do privileged file system operations. /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/Resources/Locum I have no idea why you're seeing this message for Locum and NetAuthAgent, but it's obvious that something has gone terribly wrong. Regardless, it's not relevant to Geoff's original question. >Looking at the chunk of code that >prints these messages I've never been able to figure out *exactly* >what set of conditions precipitates them (I have an idea, but that >idea doesn't always match what I see going on), but they happen a lot, >even with shipping Apple code. So often that I'd be in favor of a more >verbose error message if such an idea were ever kicked around the >office. The following section of TN2083 "Daemons and Agents" gives a bunch of background material. Dave can fill in the specific details, but here's the general gist of things... When launchd starts a job, it puts the process in a unique process group. When that process dies, launchd SIGTERMs the process group to 'garbage collect' any processes that the main process might have launched. The idea is as follows: o If the main process launches a helper tool, the helper tool won't daemonise itself. Thus, it will be in the same process group, and thus it will be killed by the SIGTERM. This is generally a good thing because it means that, the next time launchd starts the main process, the main process starts with a clean slate. o If the main process starts some other process that's meant to run /after/ the main process, the other process /must/ daemonise itself. That puts the other process in its own process group, and launchd will leave it alone. It's likely that Geoff's launchd job is starting sendmail but not waiting for it to run to completion. Thus, launchd is trying to garbage collect sendmail. This is bad. Frankly, it's just luck that it works at all. S+E -- Quinn "The Eskimo!" Apple Developer Relations, Developer Technical Support, Core OS/Hardware From gfranks at hwi.buffalo.edu Fri Feb 22 06:15:59 2008 From: gfranks at hwi.buffalo.edu (Geoff Franks) Date: Fri, 22 Feb 2008 09:15:59 -0500 Subject: [launchd-dev] Stray Proccess Log message In-Reply-To: <9F829F07-11D6-4F58-B9FD-52DFA501775A@apple.com> Message-ID: On 2/21/08 6:31 PM, "Dave Zarzycki" wrote: > On Feb 21, 2008, at 12:52 PM, Geoff Franks wrote: > >> I have a previously-cronned job that I'm moving to launchd on my new >> 10.5 >> server. It runs every 10 minutes, and causes the following entry to >> show up >> in the syslog: >> >> Feb 21 15:43:45 server1 com.apple.launchd[1] >> (edu.buffalo.hwi.raidutil[43977]): Stray process with PGID equal to >> this >> dead job: PID 43983 PPID 1 sendmail >> >> The script the launchd job runs calls sendmail a the end of it, so >> my guess >> is that the script finishes, while sendmail is still running, and then >> launchd has to clean up after the script exits, so tries to kill the >> sendmail process. However, my emails are all going through and >> seemingly >> working properly. > > That is probably just luck. > >> Additionally, I specified the AbandonProccessGrop >> key in the plist so it wouldn't try cleaning up the other processes >> spawned. >> Shouldn't this take care of the log message? > > Nope. We hope that you'll someday update the script to either wait for > descendant processes to finish, or alternatively, properly daemonize > them. > > davez This is a 10 line bash script that I ran as a cron job previously. It emailed on failures. Why would I daemonize something like that? Geoff Franks Sr. Systems Administrator Hauptman Woodward Institute From zarzycki at apple.com Fri Feb 22 07:45:00 2008 From: zarzycki at apple.com (Dave Zarzycki) Date: Fri, 22 Feb 2008 07:45:00 -0800 Subject: [launchd-dev] Stray Proccess Log message In-Reply-To: References: Message-ID: <35EDCB91-2741-41CC-AAC5-2B8FC2834598@apple.com> On Feb 22, 2008, at 6:15 AM, Geoff Franks wrote: > On 2/21/08 6:31 PM, "Dave Zarzycki" wrote: > >> On Feb 21, 2008, at 12:52 PM, Geoff Franks wrote: >> >>> I have a previously-cronned job that I'm moving to launchd on my new >>> 10.5 >>> server. It runs every 10 minutes, and causes the following entry to >>> show up >>> in the syslog: >>> >>> Feb 21 15:43:45 server1 com.apple.launchd[1] >>> (edu.buffalo.hwi.raidutil[43977]): Stray process with PGID equal to >>> this >>> dead job: PID 43983 PPID 1 sendmail >>> >>> The script the launchd job runs calls sendmail a the end of it, so >>> my guess >>> is that the script finishes, while sendmail is still running, and >>> then >>> launchd has to clean up after the script exits, so tries to kill the >>> sendmail process. However, my emails are all going through and >>> seemingly >>> working properly. >> >> That is probably just luck. >> >>> Additionally, I specified the AbandonProccessGrop >>> key in the plist so it wouldn't try cleaning up the other processes >>> spawned. >>> Shouldn't this take care of the log message? >> >> Nope. We hope that you'll someday update the script to either wait >> for >> descendant processes to finish, or alternatively, properly daemonize >> them. >> >> davez > > This is a 10 line bash script that I ran as a cron job previously. It > emailed on failures. Why would I daemonize something like that? Unless you're consciously backgrounding sendmail, the bug is more likely in the sendmail program itself. davez From gfranks at hwi.buffalo.edu Fri Feb 22 08:42:41 2008 From: gfranks at hwi.buffalo.edu (Geoff Franks) Date: Fri, 22 Feb 2008 11:42:41 -0500 Subject: [launchd-dev] Stray Proccess Log message In-Reply-To: <35EDCB91-2741-41CC-AAC5-2B8FC2834598@apple.com> Message-ID: On 2/22/08 10:45 AM, "Dave Zarzycki" wrote: > > On Feb 22, 2008, at 6:15 AM, Geoff Franks wrote: > >> On 2/21/08 6:31 PM, "Dave Zarzycki" wrote: >> >>> On Feb 21, 2008, at 12:52 PM, Geoff Franks wrote: >>> >>>> I have a previously-cronned job that I'm moving to launchd on my new >>>> 10.5 >>>> server. It runs every 10 minutes, and causes the following entry to >>>> show up >>>> in the syslog: >>>> >>>> Feb 21 15:43:45 server1 com.apple.launchd[1] >>>> (edu.buffalo.hwi.raidutil[43977]): Stray process with PGID equal to >>>> this >>>> dead job: PID 43983 PPID 1 sendmail >>>> >>>> The script the launchd job runs calls sendmail a the end of it, so >>>> my guess >>>> is that the script finishes, while sendmail is still running, and >>>> then >>>> launchd has to clean up after the script exits, so tries to kill the >>>> sendmail process. However, my emails are all going through and >>>> seemingly >>>> working properly. >>> >>> That is probably just luck. >>> >>>> Additionally, I specified the AbandonProccessGrop >>>> key in the plist so it wouldn't try cleaning up the other processes >>>> spawned. >>>> Shouldn't this take care of the log message? >>> >>> Nope. We hope that you'll someday update the script to either wait >>> for >>> descendant processes to finish, or alternatively, properly daemonize >>> them. >>> >>> davez >> >> This is a 10 line bash script that I ran as a cron job previously. It >> emailed on failures. Why would I daemonize something like that? > > Unless you're consciously backgrounding sendmail, the bug is more > likely in the sendmail program itself. > > davez /usr/sbin/raidutil list status | /usr/bin/mail -s "RAID: `hostname`" Is all I'm calling. I've had reports of a few other people on the MacEnterprise list with similar issues regarding postfix/sendmail and launchd jobs. Should I file a bug report for this? Geoff Franks Sr. Systems Administrator Hauptman Woodward Institute From zarzycki at apple.com Fri Feb 22 10:21:43 2008 From: zarzycki at apple.com (Dave Zarzycki) Date: Fri, 22 Feb 2008 10:21:43 -0800 Subject: [launchd-dev] Stray Proccess Log message In-Reply-To: References: Message-ID: On Feb 22, 2008, at 8:42 AM, Geoff Franks wrote: > On 2/22/08 10:45 AM, "Dave Zarzycki" wrote: > >> >> On Feb 22, 2008, at 6:15 AM, Geoff Franks wrote: >> >>> On 2/21/08 6:31 PM, "Dave Zarzycki" wrote: >>> >>>> On Feb 21, 2008, at 12:52 PM, Geoff Franks wrote: >>>> >>>>> I have a previously-cronned job that I'm moving to launchd on my >>>>> new >>>>> 10.5 >>>>> server. It runs every 10 minutes, and causes the following entry >>>>> to >>>>> show up >>>>> in the syslog: >>>>> >>>>> Feb 21 15:43:45 server1 com.apple.launchd[1] >>>>> (edu.buffalo.hwi.raidutil[43977]): Stray process with PGID equal >>>>> to >>>>> this >>>>> dead job: PID 43983 PPID 1 sendmail >>>>> >>>>> The script the launchd job runs calls sendmail a the end of it, so >>>>> my guess >>>>> is that the script finishes, while sendmail is still running, and >>>>> then >>>>> launchd has to clean up after the script exits, so tries to kill >>>>> the >>>>> sendmail process. However, my emails are all going through and >>>>> seemingly >>>>> working properly. >>>> >>>> That is probably just luck. >>>> >>>>> Additionally, I specified the AbandonProccessGrop >>>>> key in the plist so it wouldn't try cleaning up the other >>>>> processes >>>>> spawned. >>>>> Shouldn't this take care of the log message? >>>> >>>> Nope. We hope that you'll someday update the script to either wait >>>> for >>>> descendant processes to finish, or alternatively, properly >>>> daemonize >>>> them. >>>> >>>> davez >>> >>> This is a 10 line bash script that I ran as a cron job previously. >>> It >>> emailed on failures. Why would I daemonize something like that? >> >> Unless you're consciously backgrounding sendmail, the bug is more >> likely in the sendmail program itself. >> >> davez > > > /usr/sbin/raidutil list status | /usr/bin/mail -s "RAID: `hostname`" > > > > Is all I'm calling. I've had reports of a few other people on the > MacEnterprise list with similar issues regarding postfix/sendmail and > launchd jobs. Should I file a bug report for this? Yes, please. http://bugreport.apple.com/ davez From launchd at khiltd.com Fri Feb 22 14:13:35 2008 From: launchd at khiltd.com (Nathan Duran) Date: Fri, 22 Feb 2008 14:13:35 -0800 Subject: [launchd-dev] Stray Proccess Log message In-Reply-To: References: <4BD28286-04F4-4FC8-B1BC-8536835D7279@khiltd.com> Message-ID: <68FE94D9-4364-4663-86E8-BBD8158EC644@khiltd.com> On Feb 22, 2008, at 1:54 AM, Quinn wrote: > I have no idea why you're seeing this message for Locum and > NetAuthAgent, but it's obvious that something has gone terribly > wrong. Regardless, it's not relevant to Geoff's original question. It's happening to a lot of people, so I'd agree that many things are terribly wrong with 10.5.2. However, at times when your users and the people who sign your paychecks are one and the same, the ability to determine whether or not a given error message is your fault or Apple's can become surprisingly relevant. I believe that launchd's numerous undocumented features and behaviors coupled with its oftentimes cryptically terse function names and error messages ("Workaround Bonjour" stall anyone?) are responsible for a lot of people resisting the "use it or else" mantra, thereby slowing its adoption rate both internally and externally. I've seen invalid Apple-shipped plists, Apple-shipped daemons that don't cooperate with launchd at all (try keeping vpnd alive) and plenty of stuff like this: launchctl: Please convert the following to launchd: /etc/mach_init.d/ chum.plist launchctl: Please convert the following to launchd: /etc/mach_init.d/ dashboardadvisoryd.plist launchctl: Please convert the following to launchd: /etc/mach_init.d/ pilotfish.plist Did these guys just not get the memo, or was the memo difficult to get through? If those "Stray process" messages conveyed the whole of what had transpired in easily digestible terms, Geoff probably wouldn't have had a question to begin with. Here's a rather extreme example from another department that certainly leaves nothing to the imagination: "This application is trying to draw a very large combo box, 145 points tall. Vertically resizable combo boxes are not supported, but it happens that 10.4 and previous drew something that looked kind of sort of okay. The art in 10.5 does not break up in a way that supports that drawing. To avoid breaking existing apps, NSComboBox in 10.5 will use the 10.4 art for large combo boxes, but it won't exactly match the rest of the system. This application should be revised to stop using large combo boxes. This warning will appear once per app launch." It's just a hunch, but I'd bet nobody's asking what the heck that means on their list ;)