Some scripts may be executed as share connection/disconnection time.
This option specifies a command to be run whenever the service is connected to. It takes the usual substitutions.
An interesting example is to send the users a welcome mes sage every time they log in. Maybe a message of the day? Here is an example:
csh -c 'echo \"Welcome to %S!\" | \ /usr/local/samba/bin/smbclient
-M %m -I %I' &
Of course, this could get annoying after a while :-)
See also Cleanup Command.
Default: None (no command executed)
Example: echo \"%u connected to %S from %m (%I)\" >> /tmp/log
This is the same as Setup Command except that the command is run as root. This is useful for mounting filesystems (such as cdroms) before a connection is finalised.
This option specifies a command to be run whenever the service is disconnected. It takes the usual substitutions. The command may be run as the root on some systems.
An interesting example may be do unmount server resources:
/sbin/umount /mnt/cdrom
See also Setup Command.
Default: None (no command executed)
Example: echo \"%u disconnected from %S from %m (%I)\" >> /tmp/log
This is the same as postexec except that the command is run as root. This is useful for unmounting filesystems (such as cdroms) after a connection is closed.