diff --git a/src/server/slavefuncs.c b/src/server/slavefuncs.c --- a/src/server/slavefuncs.c +++ b/src/server/slavefuncs.c @@ -17,20 +17,17 @@ along with DistRen. If not, see . */ -/* - * ********************************************************************************** - * Slave listens on server for a command in the format of each function... - * We need if's for returns... ==> watchdog - * ********************************************************************************** -*/ - -// Registration on server. Needs attention. Prevent account spamming. -// Key transfer? -// Set up something like: distrend -c username email@example.com + /* + * Registration on server. Needs attention. Prevent account spamming. + * TODO: MAKE THIS FUNCTION RETURN THE UNIQUE URL TO THE USER'S KEY!!! + * Set up something like: distrend -c username email@example.com + */ void registeruser(char *username, char *email){ - // Logs into sandboxed user on zserver2 and registers a user. Should eventually generate a key on the server and return it to the user. - // All created user accounts should be sandboxed accordingly, requiring a different skel, and the default shell to be rbash. Also, - // a custom path defined in the .bash_profile of the skel is needed. + /* + * Logs into sandboxed user on zserver2 and registers a user. Should eventually generate a key on the server and return it to the user. + * All created user accounts should be sandboxed accordingly, requiring a different skel, and the default shell to be rbash. Also, + * a custom path defined in the .bash_profile of the skel is needed. + */ char buf[10]; struct execio *testrem; char *execargv[] = @@ -48,7 +45,7 @@ void registeruser(char *username, char * "-d", "/home/distren", "--gid", - "541", // Add in shellscript to generate ssh key and return it to the user somehow + "541", // Add in shellscript to generate ssh key and return it to the user somehow, probably post to http username, (char *)NULL }; @@ -98,7 +95,7 @@ void loginuser(char *username){ } -// Executors +/* Executors */ /* It seems that the client will need to know the job number. Is finish_frame going to be on the client or the server? we gotta figure that out! @@ -109,6 +106,18 @@ void exec_blender(struct blendjob* blend asprintf(frame,frame_str); // GNU/*nix compatible only, fix before releasing win32, although dll for windows for asprintf exists! int ret; char *cmd[] = { "blender", "-b", "-o", output, input, "-f", frame_str, (char *)0 }; - ret = execv("/usr/bin/blender", cmd); + ret = execv("/usr/bin/blender", cmd); // This path will be absolute for testing, should be relative to install on production finish_frame(blendjob, frame); } + +/* Update me when the time comes: +void exec_luxrender(struct luxjob* luxjob, char *input, char *output, int frame) +{ + char *frame_str; + asprintf(frame,frame_str); + int ret; + char *cmd[] = { "luxrender", "-b", "-o", output, input, "-f", frame_str, (char *)0 }; // Fix args later + ret = execv("/usr/bin/luxrender", cmd); // Absolute for testing, relative on production + finish_frame(luxjob, frame); +} +*/