Bug 971350

Summary: Gears leave around files in /var/spool/mail/ when they are removed
Product: OpenShift Container Platform Reporter: Gaoyun Pei <gpei>
Component: ContainersAssignee: Jason DeTiberus <jdetiber>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.2.0CC: bleanhar, bmeng, jdetiber, libra-onpremise-devel, pmorie, twiest, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 969828 Environment:
Last Closed: 2013-06-28 15:45:37 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: 969828    
Bug Blocks:    

Description Gaoyun Pei 2013-06-06 10:48:37 UTC
This bug could be reproduced on puddle:
http://buildvm-devops.usersys.redhat.com/puddle/build/OpenShiftEnterprise/1.2/2013-06-05.9
So clone it to OSE.

+++ This bug was initially created as a clone of Bug #969828 +++

Description of problem:
When a gear's user account is created, the system creates a file in /var/spool/mail/ for their mail.

However, when a gear is removed, that file is left around.

The list of files in that directory just keep growing as more gears are created and removed.

This also starts to exhaust the number of inodes of the FS (that's how we found this).

In addition to fixing this bug, please also add a check to oo-accept-node that ensures that there aren't any gear files left in /var/spool/mail for removed gears.

This is to ensure this doesn't happen again in the future and also that all of the past gear files have been cleaned up.


Version-Release number of selected component (if applicable):
rhc-node-1.8.7-1.el6oso.x86_64


How reproducible:
very


Steps to Reproduce:
1. Create a gear
2. Remove that gear
3. Notice that that gear left around a file in /var/spool/mail/


Actual results:
leaves around a file when a gear is removed


Expected results:
file should be removed as well

--- Additional comment from openshift-github-bot on 2013-06-04 18:57:50 EDT ---

Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/d1dbdc42ea95955bcf9cbc8ecea7930b6a6ac4a4
Fix bug 969828

Add --remove argument to userdel

--- Additional comment from xiaoli on 2013-06-04 23:36:04 EDT ---

Comments for QE:

We need to update cases to add one more check point for: /var/spool/mail/ after the gear is added or removed.

--- Additional comment from xiaoli on 2013-06-04 23:36:04 EDT ---

Comments for QE:

We need to update cases to add one more check point for: /var/spool/mail/ after the gear is added or removed.

--- Additional comment from Meng Bo on 2013-06-05 04:43:22 EDT ---

Checked on devenv_3321, issue has been fixed.

After gear removed, /var/spool/mail/<gear_uuid> will be removed accordingly.

[root@ip-10-165-2-28 ~]# grep "53d3e746cdb211e29a8a22000aa5021c" /var/log/secure  |grep del
Jun  5 04:34:25 ip-10-165-2-28 userdel[14041]: delete user '53d3e746cdb211e29a8a22000aa5021c'
Jun  5 04:34:25 ip-10-165-2-28 userdel[14041]: removed group '53d3e746cdb211e29a8a22000aa5021c' owned by '53d3e746cdb211e29a8a22000aa5021c'

[root@ip-10-165-2-28 ~]# ls /var/spool/mail/ |grep 53d3e746cdb211e29a8a22000aa5021c
[root@ip-10-165-2-28 ~]# 

Move bug to verified.

Comment 3 Gaoyun Pei 2013-06-07 01:58:06 UTC
This bug is fixed on puddle:
http://buildvm-devops.usersys.redhat.com/puddle/build/OpenShiftEnterprise/1.2/2013-06-06.1

Create an app with a uuid is 51b1381d0f5b150c2b0000a4
[root@node1 ~]# ls /var/spool/mail/ |grep 51b1381d0f5b150c2b0000a4
51b1381d0f5b150c2b0000a4

Delete this app
[root@node1 ~]# grep 51b1381d0f5b150c2b0000a4 /var/log/secure |grep del
Jun  6 18:51:12 node1 userdel[6977]: delete user '51b1381d0f5b150c2b0000a4'
Jun  6 18:51:12 node1 userdel[6977]: removed group '51b1381d0f5b150c2b0000a4' owned by '51b1381d0f5b150c2b0000a4'
[root@node1 ~]# ls /var/spool/mail/ |grep 51b1381d0f5b150c2b0000a4
[root@node1 ~]#

Comment 4 Luke Meyer 2013-06-28 15:45:37 UTC
Closing all bugs introduced, fixed, and verified during 1.2 release work (thus never shipped).