[SUCS Devel] New delete script

Tim eclipse at sucs.org
Sun Jul 12 17:52:13 BST 2015

On 12/07/15 16:52, Imran Hussain wrote:
> This is more of a todo list for myself but if anyone has any feedback, 
> go for it. Or if anyone wants to do it, help yourself!
> 1. need to be able to set criteria for selecting users to be deleted 
> (the expiry year, specific users, exclude specific users)
> 2. needs to be able to email users warning them of upcoming deletion 
> (be able to set dates in the warning emails, change warning email 
> text, control exactly who to send warning emails to)
> 3. needs to be able to generate a list of who to be deleted based on 1
> 4. remove user ldap account
> 5. move user home dir to /home/deleted
> 6. move mailbox from /var/mail to /home/deleted/user/user.mailbox
> 7. unsubscribe user from all mailing lists on lists.sucs.org
You don't want to blindly remove their non sucs address from all the 
lists, as some of the lists are run for other societies, e.g. 
> 8. remove user from all ldap groups they are in
Does ldap not do this for you when you delete the user?
> 9. remove user (roles and privs) from postgres and msql dbs
> 10. remove user info from the members table in the sucs db
> 11. remove user from sudoers file
Really not a fan of any script mutilating the sudoers file, and is there 
an automatable version of visudo to do it with anyway? Better 
alternative is to just check and notify the person running the script 
that they need to do it.
> 12. remove user vhost
> 13. remove user from /etc/aliases
> 14. remove users ejabberd privs
> 15. remove user from pykta db
> 16. something else i'm probably forgetting about
> The script also shouldn't be stupid, it should know if they are logged 
> in and if they are kill them, it shouldn't let you delete the account 
> you're running the script from and other things.

Otherwise sounds good.
There are various scripts round that do a lot of those bits already, but 
they are all in dire need of a rewrite, still probably a good starting 
point for how to go about the various things.


More information about the Devel mailing list