Bug 266901

Summary: Backup gpart script runs even it is disabled in periodic.conf inside jails
Product: Base System Reporter: sgubdsbeerf
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Unable to Reproduce    
Severity: Affects Some People CC: john.grafton
Priority: ---    
Version: 13.1-RELEASE   
Hardware: Any   
OS: Any   

Description sgubdsbeerf 2022-10-08 09:51:47 UTC
What is happening?
I get daily mails from inside my jails with content like "Backup of
partitions information for" or "Backup of MBR record" with the error
message "No such file or directory". I think this is because there is
no MBR to backup inside a jail. I disabled backing up MBR in
periodic.conf but it seems to run nevertheless. This seems to start
after the last patch level update.

What do I expect to happen?
Not to run if it is disabled.

How to reproduce?
Set daily_backup_gpart_enable to NO in /etc/periodic.conf inside a jail
and monitor the periodic script output.

Further information

$ grep -R "Backup of partitions information for" /etc/periodic/
/etc/periodic/daily/221.backup-gpart: echo "Backup of partitions information for:";

$ grep -R "Backup of MBR record" /etc/periodic/
/etc/periodic/daily/221.backup-gpart: echo "Backup of MBR record:"

$ grep backup_gpart /etc/periodic.conf
daily_backup_gpart_enable="NO"

--- Periodic output --- 
Dump of kern.geom.conftxt:

Backup of partitions information for:
mmcsd0
mmcsd0s2

Backup of MBR record:
mmcsd0
mv: rename /var/backups/boot.mmcsd0.tmp to /var/backups/boot.mmcsd0.bak: No such file or directory
Comment 1 John Grafton 2022-10-20 17:54:50 UTC
I was unable to reproduce this issue.  Setting daily_backup_gpart_enable="NO" in /etc/periodic.conf on a 13.1-p2 jail worked as expected.  However, setting it to YES caused the backup to run and fail similar to the experience of the reporter.

/etc/defaults/periodic.conf checks to see if it's in a jail before executing the gpart backup.  I wonder if you removed daily_backup_gpart_enable="NO" from your /etc/periodic.conf in the jail altogether if that would resolve the issue?
Comment 2 sgubdsbeerf 2022-10-23 08:26:27 UTC
(In reply to John Grafton from comment #1)

I removed daily_backup_gpart_enable="NO" but the behavior is still the same. That /etc/defaults/periodic.conf checks if it is inside a jail would explain that I didn't have this before. I checked also if something went wrong with the jail creation but everything seems to be right.
Comment 3 sgubdsbeerf 2022-12-02 14:42:58 UTC
I managed to solve this after experimenting with etcupdate in one jail, but I can't really reproduce it on the others. It seems that this completely to blame on me. Sorry for that. I will close this bug.