Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Sep 2005 06:43:00 GMT
From:      soc-tyler <soc-tyler@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 83002 for review
Message-ID:  <200509020643.j826h0Jt004670@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=83002

Change 83002 by soc-tyler@soc-tyler_launchd on 2005/09/02 06:42:31

	Quickstart broken, naptime

Affected files ...

.. //depot/projects/soc2005/launchd/launchctl/launchctl.c#20 edit

Differences ...

==== //depot/projects/soc2005/launchd/launchctl/launchctl.c#20 (text+ko) ====

@@ -133,7 +133,7 @@
 	{ "unload",	load_and_unload_cmd,	"Unload configuration files and/or directories" },
 //	{ "reload",	reload_cmd,		"Reload configuration files and/or directories" },
 	{ "start",      start_stop_remove_cmd,  "Start specified job" },
-	{ "quickstart", quickstart_cmd,		"Load and start specified"},
+	//{ "quickstart", quickstart_cmd,		"Load and start specified"},
 //	{ "stop",       start_stop_remove_cmd,  "Stop specified job" },
 	{ "submit",     submit_cmd,             "Submit a job from the command line" },
 	{ "remove",     start_stop_remove_cmd,  "Remove/stop specified job" },
@@ -384,7 +384,6 @@
 
 	if ((flags = property_find((properties)(prop), LAUNCH_PROPERTY_FLAGS))
 		== NULL) {
-		fprintf(stderr, "**debug** no flags set for this job\n");
 		fflag = false;
 		free(flags);
 	}
@@ -1217,31 +1216,32 @@
 }
 
 static int quickstart_cmd(int argc, char *const argv[]) {
-	launch_data_t pass1, pass2; // need two passes for "compat" reasons
+	launch_data_t pass1;
 	launch_data_t resp, msg, label;
+	launch_data_t thejob;
 	
-	label = launch_data_alloc(LAUNCH_DATA_STRING);
-
 	/* XXX: I need to add some error checking after the deadline */
 
 	pass1 = launch_data_alloc(LAUNCH_DATA_ARRAY);
-        pass2 = launch_data_alloc(LAUNCH_DATA_ARRAY);	
 
-	readpath(argv[1], pass1, pass2, false, true, false);
+	thejob = read_conf_file(argv[1], false, true);
+	label = launch_data_dict_lookup(thejob, LAUNCH_JOBKEY_LABEL);
 
 	/* XXX: assuming data has been read correctly */
+	launch_data_array_append(pass1, thejob);
 	submit_job_pass(pass1);
 
-	launch_data_free(pass2);
-
+	fprintf(stderr, "finished loading in quickstart()\n");
 	/* end load portion */
-	label = launch_data_dict_lookup(pass1, LAUNCH_JOBKEY_LABEL);
 
+	fprintf(stderr, "label of type: %d\n", launch_data_get_type(label));
+	fprintf(stderr, "constructing msg data struct\n");
 	msg = launch_data_alloc(LAUNCH_DATA_DICTIONARY);
-	launch_data_dict_insert(msg, label, LAUNCH_KEY_STARTJOB);
+	//launch_data_dict_insert(msg, label, LAUNCH_KEY_STARTJOB);
 
-
+	fprintf(stderr, "calling launch_msg()\n");
 	resp = launch_msg(msg);
+	fprintf(stderr, "executed launch_msg()\n");
 	launch_data_free(msg);
 
 	if (resp == NULL) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509020643.j826h0Jt004670>