utlogd

Software

obarun.org

utlogctl

This command handles a script launched at user login/logout process tracked by the utlogd daemon.

Interface

    utlogctl [ -h ] [ -v verbosity ] [ -n ] [ -s ] [ -d ] [ -l ] user|login|logout|skelin|skelout username scriptname

Activate/deactivate a user or a user's scripts which will be launched at user login/logout process tracked by the utlogd daemon. By default, a series of scripts present at /var/lib/utlogd/.skel/log{in,out} (A.K.A skeleton scripts) directories are automatically copied to the corresponding /var/lib/utlogd/<username>/log{in,out} directories at activation process.

Exit codes

Actions

To do the reverse of the following actions, use the -d option.

In case of login, logout, skelin and skelout action, scriptname must be an absolute path. At contrary, if the -d option is used to deactivate a script, the path of the scriptname must be forgotten.

In case of skelin and skelout action, the argument username is replaced by the argument scriptname.

Options

Limits

To optimize the memory resources used by the utlogd daemon, some limitations are applied:

Skeleton files and directories

By default, the skeleton files and directories are empty. It's the responsibility of the system administrator to provide it.

Usage examples

Activate a user:

    utlogctl user oblive

Deactivate a user:

    utlogctl -d user oblive

Activate a user without copying the contents of the skeleton directory:

    utlogctl -n user oblive

Activate a script for a user login time:

    utlogctl login oblive /home/oblive/my_script.sh

Deactivate a script for a user login time:

    utlogctl -d login oblive my_script.sh

Activate a script for a user login time creating a symlink at the /var/lib/utlogd/login/ directory pointing to the location of the script instead of making a copy:

    utlogctl -s login oblive /home/oblive/my_script.sh

Activate a new skeleton script for the logout time:

    utlogctl skelout /usr/share/utlogd/new_script.sh

Deactivate a skeleton script for the logout time:

    utlogctl -d skelout new_script.sh

List the script activated for a user:

    utlogctl -l user obarun

List the script activated at the logout directory for a user:

    utlogctl -l logout obarun

List the skeleton script activated for the login time:

    utlogctl -l skelin