Hi Rich, What I felt at using virt-sysprep is that all things are done in silent and there is no log what's done. Please consider to add logging feature what was done at virt-sysprep. For example, deleted /var/log/utmp deleted /etc/..... modified /etc/sysconfing/network... ... What do you think? Thanks, Wanlong Gao Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> --- sysprep/sysprep_operation_cron_spool.ml | 2 ++ sysprep/sysprep_operation_dhcp_client_state.ml | 2 ++ sysprep/sysprep_operation_dhcp_server_state.ml | 2 ++ sysprep/sysprep_operation_hostname.ml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/sysprep/sysprep_operation_cron_spool.ml b/sysprep/sysprep_operation_cron_spool.ml index e67688b..cec18e0 100644 --- a/sysprep/sysprep_operation_cron_spool.ml +++ b/sysprep/sysprep_operation_cron_spool.ml @@ -16,12 +16,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *) +open Printf open Sysprep_operation module G = Guestfs let cron_spool_perform g root Array.iter g#rm_rf (g#glob_expand "/var/spool/cron/*"); + eprintf "Deleted /var/spool/cron/*\n"; [] let cron_spool_op = { diff --git a/sysprep/sysprep_operation_dhcp_client_state.ml b/sysprep/sysprep_operation_dhcp_client_state.ml index e3e87cb..18415c5 100644 --- a/sysprep/sysprep_operation_dhcp_client_state.ml +++ b/sysprep/sysprep_operation_dhcp_client_state.ml @@ -16,6 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *) +open Printf open Sysprep_operation module G = Guestfs @@ -27,6 +28,7 @@ let dhcp_client_state_perform g root fun glob -> Array.iter g#rm_rf (g#glob_expand glob) ) [ "/var/lib/dhclient/*"; "/var/lib/dhcp/*" (* RHEL 3 *) ] ); + eprintf "Deleted /var/lib/dhclient/* /var/lib/dhcp/*\n"; [] let dhcp_client_state_op = { diff --git a/sysprep/sysprep_operation_dhcp_server_state.ml b/sysprep/sysprep_operation_dhcp_server_state.ml index c5251ce..87cb2ed 100644 --- a/sysprep/sysprep_operation_dhcp_server_state.ml +++ b/sysprep/sysprep_operation_dhcp_server_state.ml @@ -16,12 +16,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *) +open Printf open Sysprep_operation module G = Guestfs let dhcp_server_state_perform g root Array.iter g#rm_rf (g#glob_expand "/var/lib/dhcpd/*"); + eprintf "Deleted /var/lib/dhcpd/*\n"; [] let dhcp_server_state_op = { diff --git a/sysprep/sysprep_operation_hostname.ml b/sysprep/sysprep_operation_hostname.ml index 1472a1c..6caf8d7 100644 --- a/sysprep/sysprep_operation_hostname.ml +++ b/sysprep/sysprep_operation_hostname.ml @@ -42,10 +42,12 @@ let hostname_perform g root String.concat "\n" lines ^ sprintf "\nHOSTNAME=%s\n" !hostname in g#write filename file; + eprintf "Modified HOSTNAME to %s\n" !hostname; [ `Created_files ] | "linux", ("debian"|"ubuntu") -> g#write "/etc/hostname" !hostname; + eprintf "Modified HOSTNAME to %s\n" !hostname; [ `Created_files ] | _ -> [] -- 1.7.10.rc3
Richard W.M. Jones
2012-Apr-03 08:45 UTC
[Libguestfs] [PATCH RFC] sysprep:add logging feature
On Tue, Apr 03, 2012 at 04:20:28PM +0800, Wanlong Gao wrote:> Hi Rich, > > What I felt at using virt-sysprep is that all things are done in silent and > there is no log what's done. Please consider to add logging feature what was done > at virt-sysprep. For example,If we do logging, let's allow it to be enabled and disabled on the command line, and add a generic "log" function to utils.ml. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Maybe Matching Threads
- [PATCH] virt-sysprep:add logging feature
- [PATCH] sysprep: flag the system for reconfiguration
- [PATCH] sysprep: remove the bash history of users
- [PATCH 1/2] sysprep: remove ca certificates in the guest
- Re: [PATCH 1/3] sysprep, get-kernel: explicit the Guestfs parameter