site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Maxim, Thanks! davez On Aug 5, 2008, at 4:55 AM, Maxim Zhuravlev wrote: Hi, all. I'm to implement a daemon, that should change RunAtLoad key value on a user demand. I guess, the following code should do the thing: <code> if ( ( checkin_request = launch_data_new_string( LAUNCH_KEY_CHECKIN ) ) == NULL ) { fprintf(stderr,"unable to init checkin request\n"); return; } if ( ( checkin_response = launch_msg( checkin_request ) ) == NULL ) { fprintf(stderr,"unable to get checkin response\n"); return; } if ( launch_data_get_type( checkin_response ) == LAUNCH_DATA_ERRNO ) <--- HERE ERRNO=13 ERROR OCCURE { fprintf(stderr,"checkin failed with errno = %d\n", launch_data_get_errno(checkin_response) ); return; } if ( ( runatload_key = launch_data_dict_lookup( checkin_response, LAUNCH_JOBKEY_RUNATLOAD ) ) == NULL ) { fprintf(stderr,"unable to get RunAtLoad key\n"); return; } if ( launch_data_set_bool (runatload_key, ( user_defined_value == true_value ) ? true: false ) == false ) { fprintf(stderr,"unable to set RunAtLoad key\n"); return; } if ( launch_msg( runatload_key ) == NULL ) { fprintf(stderr,"unable to msg RunAtLoad\n"); return; } </code> Here is my *.plist file: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>blah-blah</string> <key>RunAtLoad</key> <false/> <key>ServiceIPC</key> <true/> <key>WatchPaths</key> <array> <string>some_kickstart_path</string> </array> </dict> </plist> And the question is: why do I get errno=13 error, while checkin. Thaks in advance, - Maxim. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/zarzycki%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... We'd advise against using the launchd configuration file as a substitute for a real configuration file. Please consider just leaving "RunAtLoad" == true and then have your program read a configuration file to determine whether any action is necessary. This email sent to zarzycki@apple.com This email sent to site_archiver@lists.apple.com