I have noticed a few issues with 221.backup-gpart and this is a note so they are not forgotten. 1) The backup is not very useful for jailed environment and should be skipped there. 2) The current implementation is quite chatty. When there is no change to partition table, it's better to remain silent instead of printing messages in the output.
Ditto what Xin Li said about jails. This script emails an error every night in every jail. The command that fails is "rotate boot.vtbd0p1". But really, the entire script should be skipped in jailed environments. It doesn't do anything useful there.
(In reply to Alan Somers from comment #1) Where should it be handled? I don't think the script 221.backup-gpart is the right place to unconditionally skip something just because it is in jail. I think the better place is to change default if jailed. For example in /etc/defaults/periodic.conf do something like this if [ $(sysctl -n security.jail.jailed) = 0 ]; then daily_backup_gpart_enable="YES" else daily_backup_gpart_enable="NO" fi
Miroslav, that could work. It would have the advantage of allowing somebody to enable the periodic script in a jail, if he really wanted to for some weird reason.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=fcf2227a557552e45646bbcf2422a98baab5c8a8 commit fcf2227a557552e45646bbcf2422a98baab5c8a8 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2021-06-18 14:33:08 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2021-06-18 14:36:09 +0000 periodic: by default, skip 221.backup-gpart in jails It can still be enabled as usual in /etc/periodic.conf PR: 256253 Reported by: delphij Submitted by: Miroslav Lachman <000.fbsd@quip.cz> MFC after: 2 weeks usr.sbin/periodic/periodic.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=fd5b08977630dc8279cfa7ab955f90c4d723a1b7 commit fd5b08977630dc8279cfa7ab955f90c4d723a1b7 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2021-06-18 14:33:08 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2021-07-04 02:30:05 +0000 periodic: by default, skip 221.backup-gpart in jails It can still be enabled as usual in /etc/periodic.conf PR: 256253 Reported by: delphij Submitted by: Miroslav Lachman <000.fbsd@quip.cz> (cherry picked from commit fcf2227a557552e45646bbcf2422a98baab5c8a8) usr.sbin/periodic/periodic.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=8461b8f7efa2ea118e19e6702dd3a3f1de9b1a69 commit 8461b8f7efa2ea118e19e6702dd3a3f1de9b1a69 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2021-06-18 14:33:08 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2021-10-07 19:45:32 +0000 periodic: by default, skip 221.backup-gpart in jails It can still be enabled as usual in /etc/periodic.conf PR: 256253 Reported by: delphij Submitted by: Miroslav Lachman <000.fbsd@quip.cz> (cherry picked from commit fcf2227a557552e45646bbcf2422a98baab5c8a8) usr.sbin/periodic/periodic.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)