Restart Inetd
sighup_inetd_programs.cfg specifies a simple stand-alone Pikt script to restart inetd. Note how the #if directive customizes the script for different operating systems.
/////////////////////////////////////////////////////////////////////////////// // // sighup_inetd_programs.cfg // /////////////////////////////////////////////////////////////////////////////// SigHupInetd // restart inetd path "=prgdir/SigHupInetd.pkt" mode 750 uid 0 gid 1 #!=pikt init input proc // but what about args to inetd? #if solaris "=ps -e -o pid,comm | =grep inetd" #elif linux "=ps -xc | =grep inetd | =grep -v grep" #endif dat $inetdpid 1 // 'pid' is a reserved var name dat $inetdproc $ // unused rule =exec "=kill -HUP $inetdpid" ///////////////////////////////////////////////////////////////////////////////
On the piktmaster system, we would install the SigHupInetd.pkt script to each PIKT slave system with the command:
# piktc -iv +P SigHupInetd.pkt +H all [or: ... -H down]
For more examples, see Samples.