3 # * (c) Copyright 1998-2001 by Rob Braun
4 # * All rights reserved. The file named COPYRIGHT specifies the terms
5 # * and conditions for redistribution.
8 # $RCSid = "$Id: xconv.pl,v 1.3 2005/03/29 15:50:34 bbraun Exp $";
21 # Remove comment lines
28 if( !defined $command[0] ) {
32 if( grep /rpc/, $command[2] ) {
33 print STDERR "Warning: Service $command[0] not added because\n";
34 print STDERR "xinetd does not handle rpc services well\n";
38 print "service $command[0]\n";
40 print "\tflags = NAMEINARGS\n";
41 print "\tsocket_type = $command[1]\n";
42 print "\tprotocol = $command[2]\n";
43 if( grep /no/, $command[3] ) {
44 print "\twait = no\n";
46 print "\twait = yes\n";
48 @user = split /[:\.]/, $command[4];
49 print "\tuser = $user[0]\n";
50 if( defined $user[1] ) {
51 print "\tgroup = $user[1]\n";
53 if( grep /internal/, $command[5] ) {
54 print "\ttype = INTERNAL\n";
55 print "\tid = $command[0]-$command[1]\n";
57 print "\tserver = $command[5]\n";
58 print "\tserver_args = ";
61 while( defined $command[$i] ) {
62 print "$command[$i] ";
74 print "# The defaults section sets some information for all services\n";
77 print "\t#The maximum number of requests a particular service may handle\n";
78 print "\t# at once.\n";
79 print "\tinstances = 25\n";
81 print "\t# The type of logging. This logs to a file that is specified.\n";
82 print "\t# Another option is: SYSLOG syslog_facility [syslog_level]\n";
83 print "\tlog_type = FILE /var/log/servicelog\n";
85 print "\t# What to log when the connection succeeds.\n";
86 print "\t# PID logs the pid of the server processing the request.\n";
87 print "\t# HOST logs the remote host's ip address.\n";
88 print "\t# USERID logs the remote user (using RFC 1413)\n";
89 print "\t# EXIT logs the exit status of the server.\n";
90 print "\t# DURATION logs the duration of the session.\n";
91 print "\tlog_on_success = HOST PID\n";
93 print "\t# What to log when the connection fails. Same options as above\n";
94 print "\tlog_on_failure = HOST\n";
96 print "\t# The maximum number of connections a specific IP address can\n";
97 print "\t# have to a specific service. \n";
98 print "\tper_source = 5\n";
106 print "# This file generated by xconv.pl, included with the xinetd\n";
107 print "# package. xconv.pl was written by Rob Braun (bbraun\@synack.net)\n";
109 print "# The file is merely a translation of your inetd.conf file into\n";
110 print "# the equivalent in xinetd.conf syntax. xinetd has many \n";
111 print "# features that may not be taken advantage of with this translation.\n";
112 print "# Please refer to the xinetd.conf man page for more information \n";
113 print "# on how to properly configure xinetd.\n";