57.7. The useradmin_update.pl User Synchronization Script

As Section 56.2 “User Update Notification” explains, other Webmin modules can choose to be notified when a user is created, modified, or deleted in the Users and Groups module. This is normally used to keep some other user list in sync (such as the Samba password file), but can be handy for other purposes as well.

The Scheduled Cron Jobs module has a useradmin_update.pl script so that it can detect the renaming and deletion of users, and update their Cron job files, respectively. When a UNIX user is removed, his Cron jobs will normally continue to exist, even though they will no longer work. If a user is renamed, his jobs will still be listed under the old name, which will prevent them from working properly.

Those few modules that make use of a useradmin_update.pl script will probably have it perform different tasks than those in this module. See the script in the samba directory for an example of how to synchronize a separate password file, instead. If your module's script does something similar, it should include options somewhere (perhaps on the Module Config page) that will turn synchronization on or off. Any such options should be off by default, so that other configuration files are not unexpectedly updated when the user is managing UNIX users. To avoid the first problem, the useradmin_delete_user function removes the personal Cron jobs file for any UNIX user who is being deleted. The useradmin_modify_user function checks to see if the user has been renamed and, if so, renames both the user's personal Cron file and any jobs in other files. Any other changes to the user are ignored, as they are not relevant to this module.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.131.142.80