Autofs State Machine

state machine diagram

Autofs uses 5 states:
 
State Enter Trigger Leave Trigger Behaviour
ST_READY SIGTERM, SIGUSR1, SIGUSR2, SIGALRM Reads from kernel pipe and state-change pipe.  All signals enabled
ST_PRUNE SIGUSR1 SIGCHLD: prune process finishes Prune unused autofs filesystems; reads from kernel and state pipe. All signals but SIGCHLD are blocked.
ST_EXPIRE SIGALRM SIGCHLD: expire process finishes Expire idle autofs filesystems; reads from kernel and state pipe. All signals but SIGCHLD are blocked.
ST_SHUTDOWN_PENDING SIGTERM, SIGUSR2 SIGCHLD: prune process finishes.  If successful, goes to ST_SHUTDOWN; otherwise returns to ST_READY Prunes unused autofs filesystems.  Reads from kernel message pipe. All  signals but SIGCHLD are blocked. Kills whole process group (all children) with SIGTERM to abort any pending mounts.
ST_SHUTDOWN ST_SHUTDOWN_PENDING expires all filesystems All child processes die Daemon exits

Back to autofs