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 $";
19 $disable = 0; # Default to 'enable'
23 # Check for disable before we check for comments
29 # Remove comment lines
36 if( !defined $command[0] ) {
40 if( grep /rpc/, $command[2] ) {
41 print STDERR "Warning: Service $command[0] not added because\n";
42 print STDERR "xinetd does not handle rpc services well\n";
46 print "service $command[0]\n";
48 print "\tsocket_type = $command[1]\n";
49 print "\tprotocol = $command[2]\n";
50 if( $command[0] =~ /^\d+$/ ) {
51 print "\tport = $command[0]\n";
52 print "\ttype = UNLISTED\n";
54 if( grep /no/, $command[3] ) {
55 print "\twait = no\n";
57 print "\twait = yes\n";
59 @user = split /[:\.]/, $command[4];
60 print "\tuser = $user[0]\n";
61 if( defined $user[1] ) {
62 print "\tgroup = $user[1]\n";
64 # Amanda is a special case, it needs this, see
65 # http://www.amanda.org/docs/install.html and
67 if ( $command[6] =~ /(amandad|amindexd|amidxtaped)/ ) {
68 print "\tgroups = yes\n";
70 if( grep /internal/, $command[5] ) {
71 print "\ttype = INTERNAL\n";
72 print "\tid = $command[0]-$command[1]\n";
73 } elsif ( $command[5] =~ /\/usr\/sbin\/tcpd/ ){
74 # Tcp wrapping is already implemented in xinetd
75 print "\tserver = $command[6]\n";
76 if ( defined $command[7] ) {
77 print "\tserver_args = ";
79 while( defined $command[$i] ) {
80 print "$command[$i] ";
87 print "\tserver = $command[5]\n";
88 print "\tserver_args = ";
91 while( defined $command[$i] ) {
92 print "$command[$i] ";
100 print "\tdisable = yes\n";
109 print "# The defaults section sets some information for all services\n";
112 print "\t#The maximum number of requests a particular service may handle\n";
113 print "\t# at once.\n";
114 print "\tinstances = 25\n";
116 print "\t# The type of logging. This logs to a file that is specified.\n";
117 print "\t# Another option is: SYSLOG syslog_facility [syslog_level]\n";
118 print "\tlog_type = FILE /var/log/servicelog\n";
120 print "\t# What to log when the connection succeeds.\n";
121 print "\t# PID logs the pid of the server processing the request.\n";
122 print "\t# HOST logs the remote host's ip address.\n";
123 print "\t# USERID logs the remote user (using RFC 1413)\n";
124 print "\t# EXIT logs the exit status of the server.\n";
125 print "\t# DURATION logs the duration of the session.\n";
126 print "\tlog_on_success = HOST PID\n";
128 print "\t# What to log when the connection fails. Same options as above\n";
129 print "\tlog_on_failure = HOST\n";
131 print "\t# The maximum number of connections a specific IP address can\n";
132 print "\t# have to a specific service. \n";
133 print "\tper_source = 5\n";
141 print "# This file generated by xconv.pl, included with the xinetd\n";
142 print "# package. xconv.pl was written by Rob Braun (bbraun\@synack.net)\n";
144 print "# The file is merely a translation of your inetd.conf file into\n";
145 print "# the equivalent in xinetd.conf syntax. xinetd has many \n";
146 print "# features that may not be taken advantage of with this translation.\n";
147 print "# Please refer to the xinetd.conf man page for more information \n";
148 print "# on how to properly configure xinetd.\n";