I had a a 502 error while removing just one customer with 12 domains and many files.
We should first use httpd -t before restarting Apache. If an error occurs it should be delayed a bit to prevent downtime.
Example:
23:38 May/20/2015: 0: (No message) [(__system__) 'userdel' 'zbyszek353']
23:38 May/20/2015: 0: (No message) [(__system__) ''rm'' '-rf' '/home/kloxo/client/zbyszek353']
23:40 May/20/2015: 0: (No message) [(__system__) ''rm'' '-rf' '/home/zbyszek353']
23:46 May/20/2015: 0: (No message) [(__system__) 'chmod' '0744' '/etc/webalizer/webalizer.automoto.info-24.pl.conf']
23:46 May/20/2015: 0: (No message) [(__system__) 'chmod' '0744' '/etc/awstats/awstats.automoto.info-24.pl.conf']
23:46 May/20/2015: 0: (No message) [(__system__) '/home/vpopmail/bin/vdeldomain' '-f' 'automoto.info-24.pl']
23:47 May/20/2015: Closed Exec /usr/local/lxlabs/kloxo/cexe/closeallinput 'sh /script/restart-web' >/dev/null 2>&1 & - this is wrong - it shouldn't restart at this point !
23:47 May/20/2015: 0: (No message) [(__system__) 'sh' '/script/fix-outgoingips']
23:47 May/20/2015: 0: (No message) [(__system__) 'chmod' '0744' '/etc/webalizer/webalizer.erotyczny.sklep.pl.conf']
23:47 May/20/2015: 0: (No message) [(__system__) 'chmod' '0744' '/etc/awstats/awstats.erotyczny.sklep.pl.conf']
23:47 May/20/2015: 0: (No message) [(__system__) '/home/vpopmail/bin/vdeldomain' '-f' 'erotyczny.sklep.pl']
23:47 May/20/2015: 0: (No message) [(__system__) 'sh' '/script/fix-outgoingips']
23:47 May/20/2015: 0: (No message) [(__system__) 'chmod' '0744' '/etc/webalizer/webalizer.figuraidealna.pl.conf']
23:47 May/20/2015: 0: (No message) [(__system__) 'chmod' '0744' '/etc/awstats/awstats.figuraidealna.pl.conf']
23:47 May/20/2015: 0: (No message) [(__system__) '/home/vpopmail/bin/vdeldomain' '-f' 'figuraidealna.pl']
23:47 May/20/2015: 0: (No message) [(__system__) 'sh' '/script/fix-outgoingips']
23:47 May/20/2015: 0: (No message) [(__system__) 'chmod' '0744' '/etc/webalizer/webalizer.film.info-24.pl.conf']
23:47 May/20/2015: 0: (No message) [(__system__) 'chmod' '0744' '/etc/awstats/awstats.film.info-24.pl.conf']
23:47 May/20/2015: 0: (No message) [(__system__) '/home/vpopmail/bin/vdeldomain' '-f' 'film.info-24.pl']