Bug 1229305

Summary: virt-sysprep at cleanup deletes /var/spool/at/.SEQ which results in failing at
Product: Red Hat Enterprise Linux 6 Reporter: Martin Schuppert <mschuppe>
Component: libguestfsAssignee: Pino Toscano <ptoscano>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact: Jiri Herrmann <jherrman>
Priority: medium    
Version: 6.6CC: huzhan, jherrman, leiwang, linl, ptoscano, rkratky, sherold, wshi, xchen
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.20.11-16.el6 Doc Type: Release Note
Doc Text:
The "at" program works correctly with "virt-sysprep" When using the "virt-sysprep" utility to create a Red Hat Enterprise Linux guest template, the "at" program in the resulting guest could not be used. This update ensures that "virt-sysprep" does not delete `/var/spool/at/.SEQ` files in these guests, and "at" now works as expected.
Story Points: ---
Clone Of:
: 1238579 (view as bug list) Environment:
Last Closed: 2016-05-10 19:56:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1172231, 1275757, 1301844, 1309862    

Description Martin Schuppert 2015-06-08 12:30:51 UTC
Description of problem:

virt-sysprep's cron-spool operations removes /var/spool/at/.SEQ . .SEQ contains at job counter (5 digit hex)
/var/spool/at]$ cat .SEQ 
00001

# virt-sysprep --list-operations
..
cron-spool * Remove user at-jobs and cron-jobs

Removing this file results in that at can not be used afterwards without manual create of this file:

[root@localhost /var/spool/at]$ at now + 1 minute
Cannot open lockfile /var/spool/at/.SEQ: No such file or directory

.SEQ file needs to be recreated to fix this. We should reset the counter manually by changing the /var/spool/at/.SEQ file to 00000, or recreate after deleted by virt-sysprep.

Version-Release number of selected component (if applicable):
* libguestfs-tools-c-1.20.11-11.el6.x86_64
* # virt-sysprep -V
virt-sysprep 1.20.11

How reproducible:
always

Steps to Reproduce:
1. [root@localhost /var/spool/at]$ rm -f .SEQ 
2. [root@localhost /var/spool/at]$ at now + 1 minute
Cannot open lockfile /var/spool/at/.SEQ: No such file or directory

Actual results:
[root@localhost /var/spool/at]$ at now + 1 minute
Cannot open lockfile /var/spool/at/.SEQ: No such file or directory

Expected results:
at works without manual action after virt-sysprep

Additional info:

Comment 3 Pino Toscano 2015-07-02 07:21:25 UTC
Fixed upstream with:
775e68c4613fabaa3b48ea3dc8d45ac74b93682b (minor refactoring)
a614f3451d1e2cc4f29b1bc7f0d88519c432b2c8 (minor refactoring)
261be1f952aa984b460ff8d88d962c490df4ffcf

Comment 5 Xianghua Chen 2015-12-07 02:54:57 UTC
Verified with the packages:
libguestfs-1.20.11-16.el6.x86_64
libguestfs-tools-c-1.20.11-16.el6.x86_64
# virt-sysprep -V
virt-sysprep 1.20.11


Verify steps:
1. # cd  /var/spool/at/

2.# cat .SEQ
00001

3. # virt-sysprep --list-operations
abrt-data * Remove the crash data generated by ABRT
bash-history * Remove the bash history in the guest
blkid-tab * Remove blkid tab in the guest
......

4. # at now +1 minute
at>

No error occurs.


So verified.

Comment 7 errata-xmlrpc 2016-05-10 19:56:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0762.html