#1991 Issue closed: $RUNTIME_LOGFILE disappears one time after layout changes

Labels: support / question, fixed / solved / done

lrirwin opened issue at 2018-12-03 23:14:

Rear v 2.3,
Ubuntu 18.04.1 x86_64,
DELL T330 SAS Raid5 - RD1000,
BIOS, GRUB2

site.conf:

OUTPUT=USB 
USB_DEVICE_PARTED_LABEL=gpt
BOOTLOADER=GRUB2
USING_UEFI_BOOTLOADER=0
BACKUP=NETFS
BACKUP_PROG=rsync
BACKUP_URL=usb:///dev/disk/by-label/REAR-000
BACKUP_PROG_EXCLUDE=( "${BACKUP_PROG_EXCLUDE[@]}" '/proc/*' '/sys/*' '/media/*' '/tmp/*' '/u/tmp/*' '/dev/shm/*' '/var/lib/rear/output/*' '/var/log/rear/email/*' '/etc/rear/passwords' '/mnt/*' )
USB_RETAIN_BACKUP_NR=10
BACKUP_RSYNC_OPTIONS=( "${BACKUP_RSYNC_OPTIONS[@]}" "--ignore-errors" )

When a change is made that causes "rear -v savelayout" to do something, then the next time you run "rear -d mkbackup", somewhere along the process of creating the boot image, the file "$RUNTIME_LOGFILE" is either renamed or deleted causing line 18 in output/USB/Linux-i386/830_copy_kernel_initrd.sh to fail:

cat "$RUNTIME_LOGFILE" >"$BUILD_DIR/outputfs/$USB_PREFIX/$logfile_basename"

The boot image is OK, but the missing file causes rear to error out and the backup isn't performed.

Running the same commands again, right afterward, works as expected.

From the start of the log when it fails:

2018-12-03 12:43:14.936881398 Including rescue/default/910_copy_logfile.sh
2018-12-03 12:43:14.939780517 Copying logfile /var/log/rear/rear-ccasvr.log into initramfs as '/tmp/rear-ccasvr-partial-2018-12-03T12:43:14-05:00.log'
2018-12-03 12:43:14.944855211 Including rescue/GNU/Linux/950_cfg2html.sh

From the end of the log:

2018-12-03 12:44:09.159587326 Including output/USB/Linux-i386/830_copy_kernel_initrd.sh
2018-12-03 12:44:09.995294784 Copied kernel and initrd.cgz to rear/ccasvr/20181203.1243
cat: /var/log/rear/rear-ccasvr.log: No such file or directory
2018-12-03 12:44:09.998629111 ERROR: Could not copy /var/log/rear/rear-ccasvr.log to /tmp/rear.RWuaFrL88A2TGKg/outputfs/rear/ccasvr/20181203.1243/rear-ccasvr.log
==== Stack trace ====
Trace 0: /usr/sbin/rear:543 main
Trace 1: /usr/share/rear/lib/udev-workflow.sh:45 WORKFLOW_udev
Trace 2: /usr/share/rear/lib/mkrescue-workflow.sh:22 WORKFLOW_mkrescue
Trace 3: /usr/share/rear/lib/framework-functions.sh:101 SourceStage
Trace 4: /usr/share/rear/lib/framework-functions.sh:49 Source
Trace 5: /usr/share/rear/output/USB/Linux-i386/830_copy_kernel_initrd.sh:19 source
Trace 6: /usr/share/rear/lib/_input-output-functions.sh:251 StopIfError
Message: Could not copy /var/log/rear/rear-ccasvr.log to /tmp/rear.RWuaFrL88A2TGKg/outputfs/rear/ccasvr/20181203.1243/rear-ccasvr.log
== End stack trace ==
2018-12-03 12:44:10.003584416 Running exit tasks.

jsmeix commented at 2018-12-04 08:02:

@lrirwin
where are the rear -D savelayout and rear -D mkbackup debug log files?

See
https://github.com/rear/rear/blob/master/.github/ISSUE_TEMPLATE.md
that reads (excerpt)

Attachments, as applicable ("rear -D mkrescue/mkbackup/recover" debug log files):

lrirwin commented at 2018-12-04 20:11:

Figured it out. It was the automatic running of "/usr/sbin/rear udev"
based on udev rules.
When I swapped out an RD1000 and immediately ran my backup script, the
timing of the renaming of log files was causing the issue.
Commenting out the content in /lib/udev/rules.d/60-rear.rules was the
solution.
Thanks for all you do!

--
Larry Irwin
Cell: 864-525-1322
Email: lrirwin@alum.wustl.edu

On 12/4/18 3:02 AM, Johannes Meixner wrote:

@lrirwin https://github.com/lrirwin
where are the |rear -D savelayout| and |rear -D mkbackup| debug log files?

See
https://github.com/rear/rear/blob/master/.github/ISSUE_TEMPLATE.md
that reads (excerpt)

Attachments, as applicable ("rear -D mkrescue/mkbackup/recover" debug log files):


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rear/rear/issues/1991#issuecomment-444006771, or
mute the thread
https://github.com/notifications/unsubscribe-auth/ABZTrByUJtTlnFJimbJ49yQaJA9xwKKqks5u1iwpgaJpZM4Y_mgf.

jsmeix commented at 2018-12-05 09:48:

@lrirwin
thank you for your feedback what the root cause was.
Such explicit feedback is much appreciated.

Regarding the ReaR 'udev' workflow see
https://github.com/rear/rear/issues/840

I think etc/udev/rules.d/62-rear-usb.rules is not installed, cf.
https://raw.githubusercontent.com/rear/rear/master/Makefile
and
https://github.com/rear/rear/issues/838#issuecomment-219724335

I wonder why you still have an automatic running
of /usr/sbin/rear udev based on udev rules?

lrirwin commented at 2018-12-05 15:42:

It was because I installed it from the Ubuntu 18 repository using apt-get.
The dpkg configure portion must have done it. apt list --installed shows:
rear/bionic,now 2.3+dfsg-1 amd64 [installed]
And in /var/lib/dpkg/info/rear:amd64.list it contains:
/lib/udev/rules.d/60-rear.rules

--
Larry Irwin
Cell: 864-525-1322
Email: lrirwin@alum.wustl.edu

On 12/5/18 4:49 AM, Johannes Meixner wrote:

@lrirwin https://github.com/lrirwin
thank you for your feedback what the root cause was.
Such explicit feedback is much appreciated.

Regarding the ReaR 'udev' workflow see
#840 https://github.com/rear/rear/issues/840

I think nowadays |etc/udev/rules.d/62-rear-usb.rules|
is no longer installed, cf.
https://raw.githubusercontent.com/rear/rear/master/Makefile

I wonder why you still have an automatic running
of |/usr/sbin/rear udev| based on udev rules?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rear/rear/issues/1991#issuecomment-444424428, or
mute the thread
https://github.com/notifications/unsubscribe-auth/ABZTrIHQzKY09eN3hP7JEtevKFeyctRfks5u15aPgaJpZM4Y_mgf.


[Export of Github issue for rear/rear.]