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.

Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2019-01-12.   This site is PIKT® powered.
Copyright © 1998-2019 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
View sample
DNS revols.conf
config file