Previous: , Up: Inetd-Style Components   [Contents][Index]


3.2.9.4 Exit Actions in Inetd Components

Exit actions (see Exit Actions) work for ‘inet-style’ components. The only difference from ‘respawn’ components is that the ‘restart’ action is essentially ignored, as it makes no sense to start an ‘inet-style’ component without a communication socket.

A common use of return-code statement is to invoke an external program upon the termination of a component. For example, the following configuration snippet configures an FTP server and ensures that a special program is invoked after closing each FTP connection:

component ftp {
    return-code EX_OK {
        exec "/sbin/sweeper --log";
    }
    mode inetd;
    socket "inet://0.0.0.0:21";
    umask 027;
    program /usr/sbin/in.ftpd
    command "ftpd -ll -C -t180";
}

This approach may be used to process FTP uploads in real time.