Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / bin / dbiproxy
CommitLineData
86530b38
AT
1#!/import/bw/tools/local/perl-5.8.0/bin/perl
2
3eval 'exec /import/bw/tools/local/perl-5.8.0/bin/perl -S $0 ${1+"$@"}'
4 if 0; # not running under some shell
5
6use strict;
7
8require DBI::ProxyServer;
9
10# XXX these should probably be moved into DBI::ProxyServer
11delete $ENV{IFS};
12delete $ENV{CDPATH};
13delete $ENV{ENV};
14delete $ENV{BASH_ENV};
15
16if ($ARGV[0] eq '--test') {
17 require RPC::PlServer::Test;
18 shift @ARGV;
19 @DBI::ProxyServer::ISA = qw(RPC::PlServer::Test DBI);
20}
21
22DBI::ProxyServer::main(@ARGV);
23exit(0);
24
25
26__END__
27
28=head1 NAME
29
30dbiproxy - A proxy server for the DBD::Proxy driver
31
32
33=head1 SYNOPSIS
34
35 dbiproxy <options> --port <port>
36
37
38=head1 DESCRIPTION
39
40This tool is just a front end for the DBI::ProxyServer package. All it
41does is picking options from the command line and calling
42DBI::ProxyServer::main(). See L<DBI::ProxyServer(3)> for details.
43
44Available options include:
45
46=over 4
47
48=item B<--chroot=dir>
49
50(UNIX only) After doing a bind(), change root directory to the given
51directory by doing a chroot(). This is usefull for security, but it
52restricts the environment a lot. For example, you need to load DBI
53drivers in the config file or you have to create hard links to Unix
54sockets, if your drivers are using them. For example, with MySQL, a
55config file might contain the following lines:
56
57 my $rootdir = '/var/dbiproxy';
58 my $unixsockdir = '/tmp';
59 my $unixsockfile = 'mysql.sock';
60 foreach $dir ($rootdir, "$rootdir$unixsockdir") {
61 mkdir 0755, $dir;
62 }
63 link("$unixsockdir/$unixsockfile",
64 "$rootdir$unixsockdir/$unixsockfile");
65 require DBD::mysql;
66
67 {
68 'chroot' => $rootdir,
69 ...
70 }
71
72If you don't know chroot(), think of an FTP server where you can see a
73certain directory tree only after logging in. See also the --group and
74--user options.
75
76=item B<--configfile=file>
77
78Config files are assumed to return a single hash ref that overrides the
79arguments of the new method. However, command line arguments in turn take
80precedence over the config file. See the L<"CONFIGURATION FILE"> section
81below for details on the config file.
82
83=item B<--debug>
84
85Turn debugging mode on. Mainly this asserts that logging messages of
86level "debug" are created.
87
88=item B<--facility=mode>
89
90(UNIX only) Facility to use for L<Sys::Syslog (3)>. The default is
91B<daemon>.
92
93=item B<--group=gid>
94
95After doing a bind(), change the real and effective GID to the given.
96This is usefull, if you want your server to bind to a privileged port
97(<1024), but don't want the server to execute as root. See also
98the --user option.
99
100GID's can be passed as group names or numeric values.
101
102=item B<--localaddr=ip>
103
104By default a daemon is listening to any IP number that a machine
105has. This attribute allows to restrict the server to the given
106IP number.
107
108=item B<--localport=port>
109
110This attribute sets the port on which the daemon is listening. It
111must be given somehow, as there's no default.
112
113=item B<--logfile=file>
114
115Be default logging messages will be written to the syslog (Unix) or
116to the event log (Windows NT). On other operating systems you need to
117specify a log file. The special value "STDERR" forces logging to
118stderr. See L<Net::Daemon::Log(3)> for details.
119
120=item B<--mode=modename>
121
122The server can run in three different modes, depending on the environment.
123
124If you are running Perl 5.005 and did compile it for threads, then the
125server will create a new thread for each connection. The thread will
126execute the server's Run() method and then terminate. This mode is the
127default, you can force it with "--mode=threads".
128
129If threads are not available, but you have a working fork(), then the
130server will behave similar by creating a new process for each connection.
131This mode will be used automatically in the absence of threads or if
132you use the "--mode=fork" option.
133
134Finally there's a single-connection mode: If the server has accepted a
135connection, he will enter the Run() method. No other connections are
136accepted until the Run() method returns (if the client disconnects).
137This operation mode is usefull if you have neither threads nor fork(),
138for example on the Macintosh. For debugging purposes you can force this
139mode with "--mode=single".
140
141=item B<--pidfile=file>
142
143(UNIX only) If this option is present, a PID file will be created at the
144given location.
145
146=item B<--user=uid>
147
148After doing a bind(), change the real and effective UID to the given.
149This is usefull, if you want your server to bind to a privileged port
150(<1024), but don't want the server to execute as root. See also
151the --group and the --chroot options.
152
153UID's can be passed as group names or numeric values.
154
155=item B<--version>
156
157Supresses startup of the server; instead the version string will
158be printed and the program exits immediately.
159
160=back
161
162
163=head1 AUTHOR
164
165 Copyright (c) 1997 Jochen Wiedmann
166 Am Eisteich 9
167 72555 Metzingen
168 Germany
169
170 Email: joe@ispsoft.de
171 Phone: +49 7123 14881
172
173The DBI::ProxyServer module is free software; you can redistribute it
174and/or modify it under the same terms as Perl itself. In particular
175permission is granted to Tim Bunce for distributing this as a part of
176the DBI.
177
178
179=head1 SEE ALSO
180
181L<DBI::ProxyServer(3)>, L<DBD::Proxy(3)>, L<DBI(3)>
182