src/filed/job.c
static int job_cmd(JCR *jcr)
{
   BSOCK *dir = jcr->dir_bsock;
   POOL_MEM sd_auth_key(PM_MESSAGE);
   sd_auth_key.check_size(dir->msglen);

   if (sscanf(dir->msg, jobcmd,  &jcr->JobId, jcr->Job,
              &jcr->VolSessionId, &jcr->VolSessionTime,
              sd_auth_key.c_str()) != 5) {
      pm_strcpy(jcr->errmsg, dir->msg);
      Jmsg(jcr, M_FATAL, 0, _("Bad Job Command: %s"), jcr->errmsg);
      dir->fsend(BADjob);
      return 0;
   }
   set_jcr_in_tsd(jcr);
   set_storage_auth_key(jcr, sd_auth_key.c_str());
   Dmsg2(120, "JobId=%d Auth=%s\n", jcr->JobId, jcr->sd_auth_key);
   Mmsg(jcr->errmsg, "JobId=%d Job=%s", jcr->JobId, jcr->Job);
   new_plugins(jcr);                  /* instantiate plugins for this jcr */
   generate_plugin_event(jcr, bEventJobStart, (void *)jcr->errmsg);
#ifdef HAVE_WIN32
   return dir->fsend(OKjob, VERSION, LSMDATE, win_os, DISTNAME, DISTVER);
#else
    return dir->fsend(OKjob, VERSION, LSMDATE, HOST_OS, DISTNAME, DISTVER);
#endif
}
/**
 * Get JobId and Storage Daemon Authorization key from Director
 */
Get JobId and Storage Daemon Authorization key from Director
Get JobId and Storage Daemon Authorization key from Director
static int job_cmd(JCR *jcr)
{
   BSOCK *dir = jcr->dir_bsock;
   POOL_MEM sd_auth_key(PM_MESSAGE);
   sd_auth_key.check_size(dir->msglen);
   if (sscanf(dir->msg, jobcmd,  &jcr->JobId, jcr->Job,
              &jcr->VolSessionId, &jcr->VolSessionTime,
              sd_auth_key.c_str()) != 5) {
      pm_strcpy(jcr->errmsg, dir->msg);
      Jmsg(jcr, M_FATAL, 0, _("Bad Job Command: %s"), jcr->errmsg);
      dir->fsend(BADjob);
      return 0;
   }
   set_jcr_in_tsd(jcr);
   set_storage_auth_key(jcr, sd_auth_key.c_str());
   Dmsg2(120, "JobId=%d Auth=%s\n", jcr->JobId, jcr->sd_auth_key);
   Mmsg(jcr->errmsg, "JobId=%d Job=%s", jcr->JobId, jcr->Job);
   new_plugins(jcr);                  
   generate_plugin_event(jcr, bEventJobStart, (void *)jcr->errmsg);
#ifdef HAVE_WIN32
   return dir->fsend(OKjob, VERSION, LSMDATE, win_os, DISTNAME, DISTVER);
#else
    return dir->fsend(OKjob, VERSION, LSMDATE, HOST_OS, DISTNAME, DISTVER);
#endif
}
static int job_cmd ( JCR * jcr ) { BSOCK * dir = jcr -> dir_bsock ; POOL_MEM sd_auth_key ( PM_MESSAGE ) ; sd_auth_key . check_size ( dir -> msglen ) ; if ( sscanf ( dir -> msg , jobcmd , & jcr -> JobId , jcr -> Job , & jcr -> VolSessionId , & jcr -> VolSessionTime , sd_auth_key . c_str ( ) ) != 5 ) { pm_strcpy ( jcr -> errmsg , dir -> msg ) ; Jmsg ( jcr , M_FATAL , 0 , _ ( " " ) , jcr -> errmsg ) ; dir -> fsend ( BADjob ) ; return 0 ; } set_jcr_in_tsd ( jcr ) ; set_storage_auth_key ( jcr , sd_auth_key . c_str ( ) ) ; Dmsg2 ( 120 , " \n " , jcr -> JobId , jcr -> sd_auth_key ) ; Mmsg ( jcr -> errmsg , " " , jcr -> JobId , jcr -> Job ) ; new_plugins ( jcr ) ; generate_plugin_event ( jcr , bEventJobStart , ( void * ) jcr -> errmsg ) ; #ifdef HAVE_WIN32 return dir -> fsend ( OKjob , VERSION , LSMDATE , win_os , DISTNAME , DISTVER ) ; #else return dir -> fsend ( OKjob , VERSION , LSMDATE , HOST_OS , DISTNAME , DISTVER ) ; #endif }
Get JobId and Storage Daemon Authorization key from Director
Get JobId and Storage Daemon Authorization key from Director
/* instantiate plugins for this jcr */