source:
trunk/patches/trqauth_syslog.patch
@
61
Last change on this file since 61 was 61, checked in by bas, 12 years ago | |
---|---|
File size: 1.9 KB |
-
trq_auth_daemon.c
36 36 /* Currently this only display's the port for the trq server 37 37 * from the lib_ifl.h file or server_name file (The same way 38 38 * the client utilities determine the pbs_server port) 39 */ 40 printf("hostname: %s\n", tmp_name); 39 */ 40 if (debug_mode == TRUE) 41 { 42 printf("pbs_server: %s\n", tmp_name); 43 } 44 else 45 { 46 openlog("trqauthd", LOG_PID | LOG_NOWAIT, LOG_DAEMON); 47 syslog(LOG_INFO, "pbs_server : %s\n", tmp_name); 48 closelog(); 49 } 41 50 *ip = tmp_name; 42 51 PBS_get_server(tmp_name, (unsigned int *)t_port); 43 52 if (*t_port == 0) … … 61 70 char **sign_key) 62 71 { 63 72 int rc = PBSE_NONE; 64 fprintf(stderr, "pbs_server port is: %d\n", t_server_port); 73 74 if (debug_mode == TRUE) 75 { 76 fprintf(stderr, "pbs_server port is: %d\n", t_server_port); 77 } 78 else 79 { 80 openlog("trqauthd", LOG_PID | LOG_NOWAIT, LOG_DAEMON); 81 syslog(LOG_INFO, "pbs_server port is : %d\n", t_server_port); 82 closelog(); 83 } 84 65 85 return rc; 66 86 } 67 87 … … 88 108 89 109 if (getenv("PBSDEBUG") != NULL) 90 110 debug_mode = TRUE; 111 91 112 if (debug_mode == FALSE) 92 113 { 93 114 pid = fork(); … … 104 125 } 105 126 else 106 127 { 107 fprintf(stderr, "trqauthd daemonized - port %d\n", server_port); 128 openlog("trqauthd", LOG_PID | LOG_NOWAIT, LOG_DAEMON); 129 syslog(LOG_INFO, "daemonized - port: %d\n", server_port); 130 closelog(); 131 108 132 /* If I made it here I am the child */ 109 133 fclose(stdin); 110 134 fclose(stdout); 111 135 fclose(stderr); 136 112 137 /* We closed 0 (stdin), 1 (stdout), and 2 (stderr). fopen should give us 113 138 0, 1 and 2 in that order. this is a UNIX practice */ 114 139 (void)fopen("/dev/null", "r");
Note: See TracBrowser
for help on using the repository browser.