Password setting policies: User defined account management commands

Next Previous Contents

## 4. User defined account management commands

When linuxconf creates or deletes user accounts, it calls various scripts. You can override these scripts by entering the path to your own versions. You can also disable this process by erasing the path. Linuxconf provides default values for some of these scripts.

## 4.1 Command line arguments

Linuxconf always calls the scripts with the same command line. It is built with the following arguments.

- --uid userid This is the userid of the new account
- --name full name This is the full name (the gecos field) of the account.
- --basehome dir This is the directory where new accounts are created. This can be used by archiving commands to create archives. The sample accountarchive.sh (see Pre-delete command below) is using that to reach the oldaccounts sub-directory.
- --home home_directory This is the home directory of the account. Note that the home is supplied without the first /. It is supplied as a relative path. This helps commands such as tar which complain when supplied with an absolute path. So doing a `cd /` at the beginning of your command is recommended..
- --domain domain This is either / or the virtual email domain. From this the proper in-box mail file may be computed.

## 4.2 Delete account command

This command (if non empty) is used to delete the account data: the HOME directory and the mail inbox folder. When you delete an account, a pop-up dialog lets you pick the proper action: Archive the data, delete or leave in place. A default delete command is supplied, but you can define a new one.

## 4.3 Archive account command

A default archiving command is supplied. It preserves the HOME directory and the mail inbox folder in a compressed tar file. This file is stored in /home/oldaccounts. The name of the file has the following format

> `

>             user-YYYY-MM-DD-PID.tar.gz

> `

The PID is simply the process ID of the archive command. This is used to make the name fully unique.

Files archived in /home/oldaccounts are left there forever. You may want to clean out the old ones from time to time, according to the administration policies applying to your organization.

You can use this field to specify your own archiving command.

## 4.4 Post-create command

Each time you create a user account, a command may be executed. You must specify here the absolute path of the command as well as any arguments.

Note that this command is called after the account has been created and committed in the password database (`/etc/passwd`). The output and error codes of the command are logged in the "Linuxconf's logs".

## 4.5 Pre-delete command

You can specify a command which is executed before the account is removed from the password database (`/etc/passwd`). Output and error codes are also logged. If any error is detected, the user will be allowed to see the logs and will be asked if the accounts should be deleted.

Next Previous Contents