3 # $RCSid = "$Id: xconv-new.pl,v 1.2 2003/02/27 22:16:54 steveg Exp $";
12 my ($service, $socket_type, $protocol, $wait, $user, $server,
13 @server_args) = split;
15 my ($cps, $id, $instances, $rpc_version, $type);
17 $service =~ s#^tcpmux/\+?##;
19 $protocol =~ s#^(tcp.*)/.*#$1#;
20 if ($protocol =~ s#^rpc/##) {
21 print STDERR "Warning: Service $service not added because\n";
22 print STDERR "xinetd does not handle rpc services well\n";
25 $rpc_version = $1 if $service =~ s#/(.*)##;
28 if ($wait =~ /\.(\d+)/) { # [no]wait[.maxcpm]
29 $cps = sprintf("%.f", $1/60);
30 } elsif ($wait =~ m#/(\d+)(/(\d+))?#) { # [no]wait[/maxchild[/maxcpm]]
32 $cps = sprintf("%.f", $3/60) if $3;
34 $wait =~ s/^wait.*/yes/;
35 $wait =~ s/^nowait.*/no/;
37 $user =~ s#/.*##; # Strip /login-class
38 my $group = $1 if $user =~ s/[.:](.*)//; # user.group or user:group
41 if ($server =~ m#/tcpd$#) {
42 $flags .= " NAMEINARGS NOLIBWRAP";
45 if ($server eq "internal") {
47 $id = "$service-$socket_type";
52 print "service $service\n";
54 print "\tflags = $flags\n";
55 print "\trpc_version = $rpc_version\n" if $rpc_version;
56 print "\tsocket_type = $socket_type\n";
57 print "\tprotocol = $protocol\n";
58 print "\twait = $wait\n";
59 print "\tinstances = $instances\n" if $instances;
60 print "\tcps = $cps\n" if $cps;
61 print "\tuser = $user\n";
62 print "\tgroup = $group\n" if defined $group;
63 print "\ttype = $type\n" if $type;
64 print "\tid = $id\n" if $id;
65 print "\tserver = $server\n" if $server;
66 print "\tserver_args = @server_args\n" if @server_args;
71 # This file generated by xconv.pl, included with the xinetd
72 # package. xconv.pl was written by Rob Braun (bbraun@synack.net)
74 # The file is merely a translation of your inetd.conf file into
75 # the equivalent in xinetd.conf syntax. xinetd has many
76 # features that may not be taken advantage of with this translation.
77 # Please refer to the xinetd.conf man page for more information
78 # on how to properly configure xinetd.
81 # The defaults section sets some information for all services
84 #The maximum number of requests a particular service may handle
88 # The type of logging. This logs to a file that is specified.
89 # Another option is: SYSLOG syslog_facility [syslog_level]
90 log_type = FILE /var/log/servicelog
92 # What to log when the connection succeeds.
93 # PID logs the pid of the server processing the request.
94 # HOST logs the remote host's ip address.
95 # USERID logs the remote user (using RFC 1413)
96 # EXIT logs the exit status of the server.
97 # DURATION logs the duration of the session.
98 log_on_success = HOST PID
100 # What to log when the connection fails. Same options as above
101 log_on_failure = HOST
103 # The maximum number of connections a specific IP address can
104 # have to a specific service.