diff --git a/mediachanger/castorrmc/rmc/rmc_logreq.c b/mediachanger/castorrmc/rmc/rmc_logreq.c index 6ee62b40d8f1afff89a104c86586be7bbfb17894..d8acafe2c1604d230435d12bf1f4ec3a47a8efb8 100644 --- a/mediachanger/castorrmc/rmc/rmc_logreq.c +++ b/mediachanger/castorrmc/rmc/rmc_logreq.c @@ -31,9 +31,6 @@ void rmc_logreq(const char *const func, char *const logbuf) { *(p + n1) = '\\'; *(p + n1 + 1) = '\0'; rmc_logit (func, RMC98, p); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 98, 2, - "func" , TL_MSG_PARAM_STR, "rmc_logreq", - "Request", TL_MSG_PARAM_STR, p ); if (p != logbuf) { *p = savechrs2[0]; *(p + 1) = savechrs2[1]; @@ -48,9 +45,6 @@ void rmc_logreq(const char *const func, char *const logbuf) { n2 -= n1; } rmc_logit (func, RMC98, p); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 98, 2, - "func" , TL_MSG_PARAM_STR, "rmc_logreq", - "Request", TL_MSG_PARAM_STR, p ); if (p != logbuf) { *p = savechrs2[0]; *(p + 1) = savechrs2[1]; diff --git a/mediachanger/castorrmc/rmc/rmc_procreq.c b/mediachanger/castorrmc/rmc/rmc_procreq.c index 5390ea0483832690247d6197cd0d830847818fa2..f686847790341b18d1b42f5847b0066e738d5995 100644 --- a/mediachanger/castorrmc/rmc/rmc_procreq.c +++ b/mediachanger/castorrmc/rmc/rmc_procreq.c @@ -44,12 +44,6 @@ int rmc_srv_export(struct rmc_srv_rqst_context *const rqst_context) { unmarshall_LONG (rbp, uid); unmarshall_LONG (rbp, gid); rmc_logit (func, RMC92, "export", uid, gid, rqst_context->clienthost); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 92, 5, - "func" , TL_MSG_PARAM_STR, "rmc_srv_export", - "Type" , TL_MSG_PARAM_STR, "export", - "UID" , TL_MSG_PARAM_UID, uid, - "GID" , TL_MSG_PARAM_GID, gid, - "ClientHost", TL_MSG_PARAM_STR, rqst_context->clienthost ); /* Unmarshall and ignore the loader field as it is no longer used */ { char smc_ldr[CA_MAXRBTNAMELEN+1]; @@ -108,13 +102,6 @@ int rmc_srv_findcart(struct rmc_srv_rqst_context *const rqst_context) { unmarshall_LONG (rbp, uid); unmarshall_LONG (rbp, gid); rmc_logit (func, RMC92, "findcart", uid, gid, rqst_context->clienthost); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 92, 5, - "func" , TL_MSG_PARAM_STR, "rmc_srv_findcart", - "Type" , TL_MSG_PARAM_STR, "findcart", - "UID" , TL_MSG_PARAM_UID, uid, - "GID" , TL_MSG_PARAM_GID, gid, - "ClientHost", TL_MSG_PARAM_STR, - rqst_context->clienthost); /* Unmarshall and ignore the loader fiel as it is no longer used */ { char smc_ldr[CA_MAXRBTNAMELEN+1]; @@ -196,12 +183,6 @@ int rmc_srv_getgeom(struct rmc_srv_rqst_context *const rqst_context) { unmarshall_LONG (rbp, uid); unmarshall_LONG (rbp, gid); rmc_logit (func, RMC92, "getgeom", uid, gid, rqst_context->clienthost); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 92, 5, - "func" , TL_MSG_PARAM_STR, "rmc_srv_getgeom", - "Type" , TL_MSG_PARAM_STR, "getgeom", - "UID" , TL_MSG_PARAM_UID, uid, - "GID" , TL_MSG_PARAM_GID, gid, - "ClientHost", TL_MSG_PARAM_STR, rqst_context->clienthost ); /* Unmarshall and ignore the loader field as it is no longer used */ { char smc_ldr[CA_MAXRBTNAMELEN+1]; @@ -246,12 +227,6 @@ int rmc_srv_import(struct rmc_srv_rqst_context *const rqst_context) { unmarshall_LONG (rbp, uid); unmarshall_LONG (rbp, gid); rmc_logit (func, RMC92, "import", uid, gid, rqst_context->clienthost); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 92, 5, - "func" , TL_MSG_PARAM_STR, "rmc_srv_import", - "Type" , TL_MSG_PARAM_STR, "import", - "UID" , TL_MSG_PARAM_UID, uid, - "GID" , TL_MSG_PARAM_GID, gid, - "ClientHost", TL_MSG_PARAM_STR, rqst_context->clienthost ); /* Unmarshall and ignore the loader field as it is no longer used */ { char smc_ldr[CA_MAXRBTNAMELEN+1]; @@ -302,12 +277,6 @@ int rmc_srv_mount(struct rmc_srv_rqst_context *const rqst_context) { unmarshall_LONG (rbp, uid); unmarshall_LONG (rbp, gid); rmc_logit (func, RMC92, "mount", uid, gid, rqst_context->clienthost); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 92, 5, - "func" , TL_MSG_PARAM_STR, "rmc_srv_mount", - "Type" , TL_MSG_PARAM_STR, "mount", - "UID" , TL_MSG_PARAM_UID, uid, - "GID" , TL_MSG_PARAM_GID, gid, - "ClientHost", TL_MSG_PARAM_STR, rqst_context->clienthost ); /* Unmarshall and ignore the loader field as it is no longer used */ { char smc_ldr[CA_MAXRBTNAMELEN+1]; @@ -368,12 +337,6 @@ int rmc_srv_readelem(struct rmc_srv_rqst_context *const rqst_context) { unmarshall_LONG (rbp, uid); unmarshall_LONG (rbp, gid); rmc_logit (func, RMC92, "readelem", uid, gid, rqst_context->clienthost); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 92, 5, - "func" , TL_MSG_PARAM_STR, "rmc_srv_readelem", - "Type" , TL_MSG_PARAM_STR, "readelem", - "UID" , TL_MSG_PARAM_UID, uid, - "GID" , TL_MSG_PARAM_GID, gid, - "ClientHost", TL_MSG_PARAM_STR, rqst_context->clienthost ); /* Unmarshall and ignore the loader field as it is no longer used */ { char smc_ldr[CA_MAXRBTNAMELEN+1]; @@ -451,12 +414,6 @@ int rmc_srv_unmount(struct rmc_srv_rqst_context *const rqst_context) { unmarshall_LONG (rbp, uid); unmarshall_LONG (rbp, gid); rmc_logit (func, RMC92, "unmount", uid, gid, rqst_context->clienthost); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 92, 5, - "func" , TL_MSG_PARAM_STR, "rmc_srv_unmount", - "Type" , TL_MSG_PARAM_STR, "unmount", - "UID" , TL_MSG_PARAM_UID, uid, - "GID" , TL_MSG_PARAM_GID, gid, - "ClientHost", TL_MSG_PARAM_STR, rqst_context->clienthost ); /* Unmarshall and ignore the loader field as it is no longer used */ { char smc_ldr[CA_MAXRBTNAMELEN+1]; diff --git a/mediachanger/castorrmc/rmc/rmc_sendrep.c b/mediachanger/castorrmc/rmc/rmc_sendrep.c index eefee63be6fbeaa655565ed985c1dcd17fa6eee3..28b56af8825ec6eda0f8657ad5077df7d4019560 100644 --- a/mediachanger/castorrmc/rmc/rmc_sendrep.c +++ b/mediachanger/castorrmc/rmc/rmc_sendrep.c @@ -42,9 +42,6 @@ int rmc_sendrep(const int rpfd, const int rep_type, ...) marshall_LONG (rbp, strlen (prtbuf) + 1); marshall_STRING (rbp, prtbuf); rmc_logit (func, "%s", prtbuf); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 103, 2, - "func" , TL_MSG_PARAM_STR, func, - "Message", TL_MSG_PARAM_STR, prtbuf ); break; case MSG_DATA: n = va_arg (args, int); @@ -62,10 +59,6 @@ int rmc_sendrep(const int rpfd, const int rep_type, ...) repsize = rbp - repbuf; if (netwrite (rpfd, repbuf, repsize) != repsize) { rmc_logit (func, RMC02, "send", neterror()); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 2, 3, - "func" , TL_MSG_PARAM_STR, func, - "On" , TL_MSG_PARAM_STR, "send", - "Error", TL_MSG_PARAM_STR, neterror() ); if (rep_type == RMC_RC) close (rpfd); return (-1); diff --git a/mediachanger/castorrmc/rmc/rmc_serv.c b/mediachanger/castorrmc/rmc/rmc_serv.c index d2cff293f36ea496490cf038509bc44af59be0b1..b2a92d8b8807a4ce566e2e1a5fb4eca5411f0152 100644 --- a/mediachanger/castorrmc/rmc/rmc_serv.c +++ b/mediachanger/castorrmc/rmc/rmc_serv.c @@ -72,33 +72,13 @@ int rmc_main(struct main_args *main_args) strncpy (func, "rmc_serv", sizeof(func)); func[sizeof(func) - 1] = '\0'; - /* init the tplogger interface */ - { - const mode_t save_mask = umask(0); - - /* only syslog support */ - tl_init_handle( &tl_rmcdaemon, "syslog" ); - tl_rmcdaemon.tl_init( &tl_rmcdaemon, 2 ); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 109, 2, - "func" , TL_MSG_PARAM_STR, "rmc_main", - "Message", TL_MSG_PARAM_STR, "Logging initialized" ); - - umask(save_mask); - } - jid = getpid(); rmc_logit (func, "started\n"); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 109, 2, - "func" , TL_MSG_PARAM_STR, "rmc_main", - "Message", TL_MSG_PARAM_STR, "Daemon started" ); gethostname (localhost, CA_MAXHOSTNAMELEN+1); if (strchr (localhost, '.') == NULL) { if (Cdomainname (domainname, sizeof(domainname)) < 0) { rmc_logit (func, "Unable to get domainname\n"); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 103, 2, - "func" , TL_MSG_PARAM_STR, "rmc_main", - "Message", TL_MSG_PARAM_STR, "Unable to get domainname" ); } strcat (localhost, "."); strcat (localhost, domainname); @@ -106,17 +86,12 @@ int rmc_main(struct main_args *main_args) if (main_args->argc != 2) { rmc_logit (func, RMC01); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 1, 1, - "func", TL_MSG_PARAM_STR, "rmc_main" ); exit (USERR); } robot = main_args->argv[1]; if (*robot == '\0' || (strlen (robot) + (*robot == '/') ? 0 : 5) > CA_MAXRBTNAMELEN) { rmc_logit (func, RMC06, "robot"); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 6, 2, - "func", TL_MSG_PARAM_STR, "rmc_main", - "For" , TL_MSG_PARAM_STR, "robot" ); exit (USERR); } if (*robot == '/') @@ -134,24 +109,9 @@ int rmc_main(struct main_args *main_args) &extended_robot_info.robot_info))) { c = smc_lasterror (&smc_status, &msgaddr); rmc_logit (func, RMC02, "get_geometry", msgaddr); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 2, 4, - "func" , TL_MSG_PARAM_STR, "rmc_main", - "On" , TL_MSG_PARAM_STR, "get_geometry", - "Message" , TL_MSG_PARAM_STR, msgaddr, - "NextStep", TL_MSG_PARAM_STR, "Retry" ); - - rmc_logit (func,"trying again get_geometry\n"); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 110, 2, - "func" , TL_MSG_PARAM_STR, "rmc_main", - "Message", TL_MSG_PARAM_STR, "trying again get_geometry" ); n++; if (n==2) { rmc_logit (func, RMC02, "get_geometry", msgaddr); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 2, 4, - "func" , TL_MSG_PARAM_STR, "rmc_main", - "On" , TL_MSG_PARAM_STR, "get_geometry", - "Message" , TL_MSG_PARAM_STR, msgaddr, - "NextStep", TL_MSG_PARAM_STR, "Exiting" ); exit(c); } } else { @@ -177,11 +137,6 @@ int rmc_main(struct main_args *main_args) extended_robot_info.smc_support_voltag = 0; } else { rmc_logit (func, RMC02, "find_cartridge", msgaddr); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 2, 4, - "func" , TL_MSG_PARAM_STR, "rmc_main", - "On" , TL_MSG_PARAM_STR, "find_cartridge", - "Message" , TL_MSG_PARAM_STR, msgaddr, - "NextStep", TL_MSG_PARAM_STR, "Exiting/SYERR" ); exit (SYERR); } } @@ -194,11 +149,6 @@ int rmc_main(struct main_args *main_args) if ((s = socket (AF_INET, SOCK_STREAM, 0)) < 0) { rmc_logit (func, RMC02, "socket", neterror()); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 2, 4, - "func" , TL_MSG_PARAM_STR, "rmc_main", - "On" , TL_MSG_PARAM_STR, "socket", - "Message" , TL_MSG_PARAM_STR, msgaddr, - "NextStep", TL_MSG_PARAM_STR, "Exiting/CONFERR" ); exit (CONFERR); } memset ((char *)&sin, 0, sizeof(struct sockaddr_in)) ; @@ -216,18 +166,9 @@ int rmc_main(struct main_args *main_args) sin.sin_addr.s_addr = htonl(INADDR_ANY); if (setsockopt (s, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)) < 0) { rmc_logit (func, RMC02, "setsockopt", neterror()); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 2, 3, - "func" , TL_MSG_PARAM_STR, "rmc_main", - "On" , TL_MSG_PARAM_STR, "setsockopt", - "Message" , TL_MSG_PARAM_STR, msgaddr ); } if (bind (s, (struct sockaddr *) &sin, sizeof(sin)) < 0) { rmc_logit (func, RMC02, "bind", neterror()); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 2, 4, - "func" , TL_MSG_PARAM_STR, "rmc_main", - "On" , TL_MSG_PARAM_STR, "bind", - "Message" , TL_MSG_PARAM_STR, msgaddr, - "NextStep", TL_MSG_PARAM_STR, "Exiting/CONFERR" ); exit (CONFERR); } listen (s, 5) ; @@ -310,20 +251,12 @@ static int getreq( unmarshall_LONG (rbp, msglen); if (msglen > RMC_REQBUFSZ) { rmc_logit (func, RMC46, RMC_REQBUFSZ); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 46, 2, - "func" , TL_MSG_PARAM_STR, "getreq", - "MaxSize", TL_MSG_PARAM_INT, RMC_REQBUFSZ); return (-1); } l = msglen - sizeof(req_hdr); n = netread_timeout (s, req_data, l, RMC_TIMEOUT); if (getpeername (s, (struct sockaddr *) &from, &fromlen) < 0) { rmc_logit (func, RMC02, "getpeername", neterror()); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 2, 4, - "func" , TL_MSG_PARAM_STR, "getreq", - "On" , TL_MSG_PARAM_STR, "getpeername", - "Message", TL_MSG_PARAM_STR, neterror(), - "Return" , TL_MSG_PARAM_STR, "ERMCUNREC" ); return (ERMCUNREC); } hp = gethostbyaddr ((char *)(&from.sin_addr), @@ -336,17 +269,8 @@ static int getreq( } else { if (l > 0) { rmc_logit (func, RMC04, l); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 4, 3, - "func" , TL_MSG_PARAM_STR, "getreq", - "netread", TL_MSG_PARAM_INT, l, - "Return" , TL_MSG_PARAM_STR, "ERMCUNREC" ); } else if (l < 0) { rmc_logit (func, RMC02, "netread", strerror(errno)); - tl_rmcdaemon.tl_log( &tl_rmcdaemon, 2, 4, - "func" , TL_MSG_PARAM_STR, "getreq", - "On" , TL_MSG_PARAM_STR, "netread", - "Message", TL_MSG_PARAM_STR, strerror(errno) , - "Return" , TL_MSG_PARAM_STR, "ERMCUNREC" ); } return (ERMCUNREC); }