PIKT

Samples: Restart Inetd

PIKT Logo
Home FAQ News Intro Samples Tutorial Reference Software Authors Licensing SiteSearch


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 downsys]

[For more examples, see Samples.]

Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software | Authors | Licensing | SiteSearch
Links | SiteIndex | Pikt-Users | Pikt-Workers | Contribute | ContactUs | Top of Page
Page best viewed at 1024x768.   Page last updated 2005-06-22.
This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.
Copyright © 1998-2005 Robert Osterlund.  All rights reserved.

Computer Books at Amazon.com

Hacking Exposed: Network Security Secrets & Solutions
Hacking Exposed: Network Security Secrets & Solutions

IPv6 Network Administration
IPv6 Network Administration

Linux iptables Pocket Reference
Linux iptables Pocket Reference

Computer Networks: A Systems Approach
Computer Networks: A Systems Approach

The Best Damn Firewall Book Period
The Best Damn Firewall Book Period