cloudfoundry-community / jumpbox-boshrelease

A BOSH release for jumpboxen
MIT License
22 stars 27 forks source link

Issue with removed/deactivate users continually getting empty directory created #85

Closed thehandsomezebra closed 2 years ago

thehandsomezebra commented 3 years ago
##first time it removes the user
[20210701 17H32M.34S] jumpbox[9621]:  Deactivating user abc
[20210701 17H32M.34S] jumpbox[9621]:  Locking abc account (via expiration date)
usermod: no changes
[20210701 17H32M.34S] jumpbox[9621]:  Moving home directory ~abc to /var/vcap/store/jumpbox/home/.abc.20213207/01/21.173234

##and then every time after
[20210701 19H02M.50S] jumpbox[9621]:  Deactivating user abc
[20210701 19H02M.50S] jumpbox[9621]:  Locking abc account (via expiration date)
usermod: no changes
[20210701 19H02M.50S] jumpbox[9621]:  Moving home directory ~abc to /var/vcap/store/jumpbox/home/.abc.20210207/01/21.190250
mv: cannot stat '/var/vcap/store/jumpbox/home/abc': No such file or directory

#and then our user folder becomes littered with empty folders, every 5 minutes.

==[]=[ 19:27:38 ]=[ our-jumpbox jumpbox/0 ]=[ /u ]=[]==
# ls -la
total 948
drwxr-xr-x 235 root         root  12288 Jul  1 17:28 .
drwxrwxr-x   5 root         root   4096 Jan 13 20:56 ..
drwxr-xr-x  11 user1        staff  4096 Feb 23 17:21 user1
drwxr-xr-x   3 user2        staff  4096 Jan 13 20:56 user2
drwxr-xr-x  10 user3        staff  4096 Jun 29 21:49 user3
drwxr-xr-x  21 user4        staff  4096 Jun 25 20:16 user4
drwxr-xr-x  12 root         root   4096 Apr 30 01:00 .abc.20210004
drwxr-xr-x  12 root         root   4096 May 31 19:00 .abc.20210005
drwxr-xr-x  12 root         root   4096 Jun 30 00:00 .abc.20210006
drwxr-xr-x  12 root         root   4096 Jul  1 01:00 .abc.20210007
drwxr-xr-x  12 root         root   4096 Apr 30 08:01 .abc.20210104
drwxr-xr-x  12 root         root   4096 May 30 15:01 .abc.20210105
drwxr-xr-x  12 root         root   4096 Jun 30 05:01 .abc.20210106
drwxr-xr-x  12 root         root   4096 Jul  1 06:01 .abc.20210107
drwxr-xr-x  12 root         root   4096 Apr 30 15:02 .abc.20210204
..........

After modifying the watcher file to remove the user credentials - the watcher restarts itself but the user array does not get emptied & reset. At which point, it will continue to create an empty .${user}.${today} every five minutes. After a while, these empty 12K folders can certainly clog a system.