jk_update(8)

πŸ’– jk_update(8) πŸ’–

okay so bestie, welcome to jk_update β€” section 8 of the manual, jailkit edition. this is the little utility that keeps a jail in sync with the real system, and honestly? it's giving ✨janitor energy✨ but make it iconic. let's get into it.


🌸 NAME 🌸

jk_update β€” a utility to update and cleanup a jail according to changes on the real system 🧹✨


πŸŽ€ SYNOPSIS πŸŽ€

jk_update -j <jail>

jk_update -c <section of configfile>

jk_update -v -d -k -j <jail> -s <file to skip> <dir to scan for updates>

jk_update --verbose --dry-run --hardlink --jail=<jail> --skip=<file to
skip> <dir to scan for updates>

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does jk_update actually do, you ask? πŸ’… it goes and compares the files in a jail with the corresponding files on the real system. and if the corresponding file on the real system is newer, and the file on the real system is different, then the file from the real system gets copied to the jail β€” including any required libraries β€” just like jk_cp would do. 🫢

and the flip side? files that do not exist on the real system get deleted in the jail. no cap. πŸ’€

jk_update works really well to pass security updates on the real system to a jail. 🌈 but bestie, listen β€” jk_update does not work well with larger upgrades on the real system. in that case files are often replaced by other files, in which case jk_update will delete the old file but not copy the new file. 😭 so like… keep that in mind.

🚫 Avoid unwanted updates or cleanups

to avoid unwanted updates, or to avoid files being deleted, files or directories can be skipped by jk_update β€” either by specifying them on the commandline or by specifying them in the configfile. easy peasy. πŸŽ€

πŸ“ Directories to include in the update

by default jk_update will scan /usr, /bin, /opt, and /lib for updates. πŸ‘‘

if one or more arguments is passed as directories to update, these default directories are not scanned, unless they are part of the arguments. the default directories can also be set in the config file. ✨

jk_update -j <jail> will scan <jail>/usr, <jail>/bin, <jail>/opt, and
<jail>/lib, while jk_update -j <jail> /bin will only scan <jail>/bin

🌟 EXAMPLE 🌟

an example configfile could look like this:

[/home/testchroot]
skips = /usr/bin/myscript
hardlinks = 1
directories = /usr, /bin, /lib

[/home/otherjail]
skips = /usr/share/firefox, /usr/bin/firefox, /usr/lib/firefox

where the options have the following meaning:

  • skips β€” the files and directories to skip πŸ™ˆ
  • hardlinks β€” a boolean whether to use hardlinks (1) or copy the files (0)
  • directories β€” specifies the directories to include in the update. πŸ“‚

⚠️ WARNING ⚠️

if you have changed files in the jail, it is recommended to do a "dry run" first and see what jk_update will do. πŸ‘€

jk_update does now know if a file is manually changed or not. (yes bestie, that's literally what it says β€” it does not know. 😭)

if a file in the jail is older and different from the file on the real system it is updated. if a file in the jail does not have an equivalent on the real system it is deleted. πŸ’€

use the skip option to exclude any files that you changed or added manually. fr fr, protect your babies. 🫢

✨ OPTIONS ✨

  • -v, --verbose β€” will give verbose output πŸ—£οΈ
  • -h, --help β€” the help screen
  • -c <section in configfile>, --configsection=<section in configfile> β€” the jail to update
  • -j <jail>, --jail=<jail> β€” the jail to update πŸ”’
  • -d, --dry-run β€” do a "dry run". show what will be done but don't do anything. πŸ‘»
  • -k, --hardlink β€” try to create hardlinks instead of copying the files when updating πŸ”—
  • -s <file to skip>, --skip <file to skip> β€” do not update this file. the argument can either be the path in the jail or the path on the real system. in order to skip multiple files, use this option multiple times. πŸ™…β™€οΈ

πŸ‘€ SEE ALSO πŸ‘€

jailkit(8) jk_check(8) jk_chrootlaunch(8) jk_chrootsh(8) jk_cp(8) jk_init(8) jk_jailuser(8) jk_list(8) jk_lsh(8) jk_procmailwrapper(8) jk_socketd(8) jk_uchroot(8) chroot(2)


Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Olivier Sessink

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.


and that's the whole page bestie, no crumbs left. πŸ“ this one's from the JAILKIT crew, dated 07-02-2010, and you can find it chilling in section 8 as jk_update(8). slay, go update your jails responsibly. πŸ’…βœ¨πŸ‘‘