CLONE-MASTER-CLEAN-UP(1)
πΈ NAME πΈ
This is the clone-master-clean-up(1) page, aka Clean-Up For Cloning Preparation. Short version: clone-master-clean-up cleans up a system for cloning preparation. That's the whole assignment, bestie. π
β¨ OPTIONS β¨
Okay so, options? There are none. The program does not accept command line options. Periodt. π«Ά
π¦ DESCRIPTION π¦
Clean up a system and delete all usage history to prepare it for being cloned. It's literally the βmake this machine a fresh golden imageβ moment. β¨
How to properly clean up a system to create a golden image is highly dependent on installed software, machine configuration, and how the image is supposed to be used. So there are two big use-case vibes:
- A golden image for a fast and easy way to deploy a freshly installed base operating system (a so-called plain vanilla image).
- A golden image that is used during the life cycle management of a system or solution landscape.
Life-cycle management images normally include custom additions beyond the base operating system which are needed on all rolled-out systems. This can include additional software, e.g. for backup, hardware support, or monitoring, and system configuration, e.g. the creation of additional local users and changes to configuration files such as sudoers or pam.
Additionally, with the use case of a life cycle management image, there will be a very intensive test cycle of newly installed software and configuration before the golden image is created and rolled out. Such testing can lead a lot of additional log files and temporary data. Highkey messy, but that's the job.
This means that the parts of the operating system which need to be cleaned up are different depending on the use case and that it can be counterproductive to remove some special files or directories. Do not just yeet everything, bestie.
For the use case of creating an clean operating system base installation, the standard scope of clone-master-clean-up is generally sufficient. To allow customization for this use case, use the configuration file /etc/sysconfig/clone-master-clean-up. Here, you can configure the following behavior:
/etc/sudoersis restored to original, and only root is allowed to run sudo. default: no- clean up user ids
>= 1000default: no - clean up all zypper repositories default: no
- remove btrfs snapshots of root filesystem default: yes
- (If the system is running on EC2) Allow
ec2-userto run sudo password-less. default: no
For the use case of a life cycle management image, it's impossible to write a standard script which will fit all requirements. To enable this use case, clone-master-clean-up allows including a drop-in file containing paths to files and directories that are deleted in addition to doing the standard clean-ups. That's the custom-removal era. π¦
For more information and examples, see /usr/share/clone-master-clean-up/custom_remove.template. Please copy the template file /usr/share/clone-master-clean-up/custom_remove.template to /etc/clone-master-clean-up/custom_remove and un-comment the parts you need or add additional parts which will fit your needs.
If the file /etc/clone-master-clean-up/custom_remove exists, all included files and directories will be picked up line by line and additionally removed from the golden image. Yes bestie, line by line.
π CLEANED UP ITEMS π
The program asks for confirmation before proceeding with cleanup. If you proceed by typing "YES" and enter, the following locations/items will be cleaned up (or deleted). Not me being dramatic, it's literally the list:
- SUSE registration, all software repositories.
- SSH host keys, root user SSH keys, root user authorized keys, root user shell history.
- User mails and user cron jobs.
- Temporary files under
/tmpand/var/tmp. - Log files and archived log files under
/var/log. - Auto-generated HANA firewall configuration script.
- System random seeds.
- Systemd journal.
- machine ID.
- Salt client ID.
- osad authentication configuration file and the system ID.
- Domain and host names.
/etc/hostname,/etc/hosts,/etc/resolv.confare restored to original.- Persistent network interfaces (auto-generated
70-persistent-net.rules). - YaST Firstboot is enabled if there is a
firstboot.xml. - Give root user a new password, optionally.
- Zypper anonymous ID
- Clean up postfix
- Swap the uuid strings with dev strings in
/etc/fstab - Clean up network files (except interfaces using dhcp boot protocol)
- Clean up collectd
- Clean up
/root - Clean up cache, crash and coredump
π FILES π
/etc/sysconfig/clone-master-clean-upβ Defines the behavior ofclone-master-clean-up./usr/share/clone-master-clean-up/custom_remove.templateβ Template for a vendor/customer-specific drop-in file. Defines additional files and directories to clean up./etc/clone-master-clean-up/custom_removeβΒ΄Operation-readyΒ΄copy of the template file. If this file exists,clone-master-clean-upwill remove files and directories that are listed in it.
π«Ά AUTHOR π«Ά
Howard Guo <hguo@suse.com>, Angela Briel <abriel@suse.com>. Iconic. π
Alright bestie, that's the whole glow-up. This page is dated September 2022, and its source/version line is clone-ma...-clean-up(1) β mwah, bye! πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: clone-master-clean-up 1.12-bp160.1.9 Β· GPL-2.0-or-later
- Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms