Olaf Hering
2012-Sep-21 19:04 UTC
[Libguestfs] [PATCH] sysprep: handle at jobs in cron-spool operation
cron-spool claims to remove at jobs, but it has no code to actually do that. Add patterns to remove files in known at spool locations. Signed-off-by: Olaf Hering <olaf at aepfle.de> --- This patch is only compile tested! sysprep/sysprep_operation_cron_spool.ml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sysprep/sysprep_operation_cron_spool.ml b/sysprep/sysprep_operation_cron_spool.ml index 5284660..e96832c 100644 --- a/sysprep/sysprep_operation_cron_spool.ml +++ b/sysprep/sysprep_operation_cron_spool.ml @@ -23,6 +23,12 @@ module G = Guestfs let cron_spool_perform g root Array.iter g#rm_rf (g#glob_expand "/var/spool/cron/*"); + Array.iter g#rm (g#glob_expand "/var/spool/atjobs/*"); + Array.iter g#rm (g#glob_expand "/var/spool/atjobs/.SEQ"); + Array.iter g#rm (g#glob_expand "/var/spool/atspool/*"); + Array.iter g#rm (g#glob_expand "/var/spool/at/*"); + Array.iter g#rm (g#glob_expand "/var/spool/at/.SEQ"); + Array.iter g#rm (g#glob_expand "/var/spool/at/spool/*"); [] let cron_spool_op = { -- 1.7.12
Richard W.M. Jones
2012-Sep-22 11:58 UTC
[Libguestfs] [PATCH] sysprep: handle at jobs in cron-spool operation
On Fri, Sep 21, 2012 at 09:04:43PM +0200, Olaf Hering wrote:> cron-spool claims to remove at jobs, but it has no code to actually do > that. Add patterns to remove files in known at spool locations. > > Signed-off-by: Olaf Hering <olaf at aepfle.de> > --- > > This patch is only compile tested! > > sysprep/sysprep_operation_cron_spool.ml | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/sysprep/sysprep_operation_cron_spool.ml b/sysprep/sysprep_operation_cron_spool.ml > index 5284660..e96832c 100644 > --- a/sysprep/sysprep_operation_cron_spool.ml > +++ b/sysprep/sysprep_operation_cron_spool.ml > @@ -23,6 +23,12 @@ module G = Guestfs > > let cron_spool_perform g root > Array.iter g#rm_rf (g#glob_expand "/var/spool/cron/*"); > + Array.iter g#rm (g#glob_expand "/var/spool/atjobs/*"); > + Array.iter g#rm (g#glob_expand "/var/spool/atjobs/.SEQ"); > + Array.iter g#rm (g#glob_expand "/var/spool/atspool/*"); > + Array.iter g#rm (g#glob_expand "/var/spool/at/*"); > + Array.iter g#rm (g#glob_expand "/var/spool/at/.SEQ"); > + Array.iter g#rm (g#glob_expand "/var/spool/at/spool/*"); > [] > > let cron_spool_op = { > -- > 1.7.12Thanks -- I pushed both the patches. I made a small rearrangement of the first patch, but the code is functionally (pun?) equivalent. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
Seemingly Similar Threads
- [PATCH 3/3] sysprep: rework and fix cron-spool operation (RHBZ#1229305)
- [PATCH 2/2] sysprep: rework and fix cron-spool operation (RHBZ#1229305)
- [PATCH 1/2] mllib: add and use last_part_of
- [PATCH 1/3] mllib: add an optional filter for rm_rf_only_files
- [PATCH] virt-sysprep:add logging feature