From: Kern Sibbald Date: Sat, 26 Mar 2005 16:55:46 +0000 (+0000) Subject: - Remove \a and -e from error echos in most Makefiles. X-Git-Tag: Release-7.0.0~8909 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4e2242ba20cc62e7e11185601fc1fff0f6842536;p=bacula%2Fbacula - Remove \a and -e from error echos in most Makefiles. - Add more debug code when there are errors on the tape to try to find Peter's tape problem. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1901 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/Makefile.in b/bacula/Makefile.in index 02fbdadc4e..c44fe2c86f 100755 --- a/bacula/Makefile.in +++ b/bacula/Makefile.in @@ -38,7 +38,7 @@ MKDIR = $(srcdir)/autoconf/mkinstalldirs all: Makefile @for I in ${all_subdirs}; \ do (cd $$I; echo "==>Entering directory `pwd`"; \ - $(MAKE) $@ || (echo ""; echo ""; echo -e " \a\a ====== Error in `pwd` ======\a\a"; \ + $(MAKE) $@ || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \ echo ""; echo "";)); \ done @@ -49,7 +49,7 @@ depend: bacula-fd: Makefile @for I in ${fd_subdirs}; \ do (cd $$I; echo "==>Entering directory `pwd`"; \ - $(MAKE) all || (echo ""; echo ""; echo -e " \a\a ====== Error in `pwd` ======\a\a"; \ + $(MAKE) all || (echo ""; echo ""; echo " ====== Error in `pwd` ======; \ echo ""; echo "";)); \ done diff --git a/bacula/src/cats/Makefile.in b/bacula/src/cats/Makefile.in index b33dc09f52..e67461dee0 100644 --- a/bacula/src/cats/Makefile.in +++ b/bacula/src/cats/Makefile.in @@ -157,7 +157,7 @@ depend: $(RMF) Makefile.bak; \ else \ $(MV) Makefile.bak Makefile; \ - echo -e "Something went wrong\n\a"; \ + echo " ===== Something went wrong in make depend ====="; \ fi # ----------------------------------------------------------------------- diff --git a/bacula/src/console/Makefile.in b/bacula/src/console/Makefile.in index 838e0a8b83..25f0598869 100644 --- a/bacula/src/console/Makefile.in +++ b/bacula/src/console/Makefile.in @@ -119,7 +119,7 @@ depend: $(RMF) Makefile.bak; \ else \ $(MV) Makefile.bak Makefile; \ - echo -e "Something went wrong\n\a"; \ + echo " ===== Something went wrong in make depend ====="; \ fi # ----------------------------------------------------------------------- diff --git a/bacula/src/dird/Makefile.in b/bacula/src/dird/Makefile.in index b5c6d9f1b2..90b74b31c8 100644 --- a/bacula/src/dird/Makefile.in +++ b/bacula/src/dird/Makefile.in @@ -142,7 +142,7 @@ depend: $(RMF) Makefile.bak; \ else \ $(MV) Makefile.bak Makefile; \ - echo -e "Something went wrong\n\a"; \ + echo " ===== Something went wrong in make depend ====="; \ fi # ----------------------------------------------------------------------- diff --git a/bacula/src/filed/Makefile.in b/bacula/src/filed/Makefile.in index 2ff0648de2..3c0f04d206 100755 --- a/bacula/src/filed/Makefile.in +++ b/bacula/src/filed/Makefile.in @@ -146,7 +146,7 @@ depend: $(RMF) Makefile.bak; \ else \ $(MV) Makefile.bak Makefile; \ - echo -e "Something went wrong\n\a"; \ + echo " ===== Something went wrong in make depend ====="; \ fi # ----------------------------------------------------------------------- diff --git a/bacula/src/findlib/Makefile.in b/bacula/src/findlib/Makefile.in index 2bbdacc573..00bad4adf7 100644 --- a/bacula/src/findlib/Makefile.in +++ b/bacula/src/findlib/Makefile.in @@ -86,7 +86,7 @@ depend: $(RMF) Makefile.bak; \ else \ $(MV) Makefile.bak Makefile; \ - echo -e "Something went wrong\n\a"; \ + echo " ===== Something went wrong in make depend ====="; \ fi # ----------------------------------------------------------------------- diff --git a/bacula/src/stored/Makefile.in b/bacula/src/stored/Makefile.in index 2862e8a4e1..f791977444 100644 --- a/bacula/src/stored/Makefile.in +++ b/bacula/src/stored/Makefile.in @@ -195,7 +195,7 @@ depend: $(RMF) Makefile.bak; \ else \ $(MV) Makefile.bak Makefile; \ - echo -e "Something went wrong with make depend\n\a"; \ + echo " ======= Something went wrong with make depend. ======="; \ fi # ----------------------------------------------------------------------- diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index 64053c7e56..303fe650a8 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -248,6 +248,8 @@ DCR *acquire_device_for_read(DCR *dcr) Dmsg1(120, "bstored: open vol=%s\n", dcr->VolumeName); if (open_dev(dev, dcr->VolumeName, OPEN_READ_ONLY) < 0) { if (dev->dev_errno == EIO) { /* no tape loaded */ + Jmsg3(jcr, M_WARNING, 0, _("Open device %s Volume \"%s\" failed: ERR=%s\n"), + dev->print_name(), dcr->VolumeName, strerror_dev(dev)); goto default_path; } @@ -258,7 +260,7 @@ DCR *acquire_device_for_read(DCR *dcr) break; } - Jmsg(jcr, M_FATAL, 0, _("Open device %s Volume \"%s\" failed: ERR=%s\n"), + Jmsg3(jcr, M_FATAL, 0, _("Open device %s Volume \"%s\" failed: ERR=%s\n"), dev->print_name(), dcr->VolumeName, strerror_dev(dev)); goto get_out; } @@ -294,7 +296,7 @@ DCR *acquire_device_for_read(DCR *dcr) } /* Fall through */ default: - Jmsg(jcr, M_WARNING, 0, "%s", jcr->errmsg); + Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg); default_path: tape_previously_mounted = true; @@ -608,11 +610,7 @@ bool release_device(DCR *dcr) if (dev->can_read()) { dev->clear_read(); /* clear read bit */ - /* Close if file or !CAP_ALWAYSOPEN */ - if (!dev->is_tape() || !dev_cap(dev, CAP_ALWAYSOPEN)) { - offline_or_rewind_dev(dev); - close_dev(dev); - } + /******FIXME**** send read volume usage statistics to director */ } else if (dev->num_writers > 0) { @@ -638,16 +636,18 @@ bool release_device(DCR *dcr) Dmsg0(100, "==== write ansi eof label \n"); } - /* If no writers, close if file or !CAP_ALWAYS_OPEN */ - if (dev->num_writers == 0 && (!dev->is_tape() || !dev_cap(dev, CAP_ALWAYSOPEN))) { - offline_or_rewind_dev(dev); - close_dev(dev); - } } else { - Jmsg2(jcr, M_FATAL, 0, _("BAD ERROR: release_device %s, Volume \"%s\" not in use.\n"), - dev->print_name(), NPRT(dcr->VolumeName)); - Jmsg2(jcr, M_ERROR, 0, _("num_writers=%d state=%x\n"), dev->num_writers, dev->state); - ok = false; + /* + * If we reach here, it is most likely because the + * has failed, since the device is not in read mode and + * there are no writers. + */ + } + + /* If no writers, close if file or !CAP_ALWAYS_OPEN */ + if (dev->num_writers == 0 && (!dev->is_tape() || !dev_cap(dev, CAP_ALWAYSOPEN))) { + offline_or_rewind_dev(dev); + close_dev(dev); } /* Fire off Alert command and include any output */ diff --git a/bacula/src/stored/append.c b/bacula/src/stored/append.c index 40db5cd2bb..8904fad771 100644 --- a/bacula/src/stored/append.c +++ b/bacula/src/stored/append.c @@ -266,8 +266,9 @@ bool do_append_data(JCR *jcr) Dmsg0(90, "back from write_end_session_label()\n"); /* Flush out final partial block of this session */ if (!write_block_to_device(dcr)) { + Jmsg2(jcr, M_FATAL, 0, _("Fatal append error on device %s: ERR=%s\n"), + dev->print_name(), strerror_dev(dev)); Dmsg0(100, _("Set ok=FALSE after write_block_to_device.\n")); - set_jcr_job_status(jcr, JS_ErrorTerminated); ok = false; } } diff --git a/bacula/src/stored/autochanger.c b/bacula/src/stored/autochanger.c index a1f36eeaf6..43755e4e6d 100644 --- a/bacula/src/stored/autochanger.c +++ b/bacula/src/stored/autochanger.c @@ -261,7 +261,7 @@ bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd) loaded = get_autochanger_loaded_slot(dcr); if (loaded > 0) { bnet_fsend(dir, - _("3305 Issuing autochanger \"unload slot %d, drive %d\" command.\n"), + _("3307 Issuing autochanger \"unload slot %d, drive %d\" command.\n"), loaded, drive); slot = dcr->VolCatInfo.Slot; dcr->VolCatInfo.Slot = loaded; diff --git a/bacula/src/stored/spool.c b/bacula/src/stored/spool.c index e3e4cf3fa7..f38839a4bd 100644 --- a/bacula/src/stored/spool.c +++ b/bacula/src/stored/spool.c @@ -243,6 +243,10 @@ static bool despool_data(DCR *dcr, bool commit) break; } ok = write_block_to_device(dcr); + if (!ok) { + Jmsg2(jcr, M_FATAL, 0, _("Fatal append error on device %s: ERR=%s\n"), + dcr->dev->print_name(), strerror_dev(dcr->dev)); + } Dmsg3(800, "Write block ok=%d FI=%d LI=%d\n", ok, block->FirstIndex, block->LastIndex); } dcr->block = block; /* reset block */ diff --git a/bacula/src/tools/Makefile.in b/bacula/src/tools/Makefile.in index f19a0d41cd..0c912213d6 100644 --- a/bacula/src/tools/Makefile.in +++ b/bacula/src/tools/Makefile.in @@ -104,7 +104,7 @@ depend: $(RMF) Makefile.bak; \ else \ $(MV) Makefile.bak Makefile; \ - echo -e "Something went wrong\n\a"; \ + echo " ===== Something went wrong in make depend ====="; \ fi # -----------------------------------------------------------------------