Oninit® MySQL-2-Informix — Operations
The control script
The m2i shell script wraps process lifecycle for the proxy binaries. It handles PID-file management, picks the right binary based on the M2I_BINARY environment variable, and provides the standard start / stop / restart / status verbs.
./m2i {start|stop|restart|status} [config]
| Verb | Action |
|---|---|
| start | Reads the configured backend binary, daemonises it, writes a PID file. Refuses to start if a PID file already exists for the same binary on the same port. |
| stop | Sends SIGTERM to the PID in the PID file and waits for the process to exit. Removes the PID file. |
| restart | Stop followed by start — useful after a config edit. |
| status | Reports whether the configured backend is running. Returns a non-zero exit status if not running, suitable for monitoring scripts. |
Choosing the backend
The script defaults to ./m2ie. Switch to the SQLI backend by exporting M2I_BINARY:
# ESQL backend (default) ./m2i start # SQLI backend M2I_BINARY=./m2is ./m2i start # Status / stop / restart pick up the same binary M2I_BINARY=./m2is ./m2i status M2I_BINARY=./m2is ./m2i stop
The two binaries can run side by side on different ports. The PID file path is derived from the binary name, so they don't collide.
Listening address
The default bind is 127.0.0.1:3307. Override with M2I_PORT:
M2I_PORT=3308 M2I_BINARY=./m2is ./m2i start
Bind to a non-loopback interface only when downstream MySQL clients need to reach the proxy across the network. Inbound traffic is the MySQL 4.1 wire protocol — secure the path appropriately.
Connecting from a MySQL client
Any MySQL client that speaks the 4.1 protocol works. The standard mysql(1) command is the simplest verification:
mysql -h 127.0.0.1 -P 3307 -u alice -p --database=mydb mysql> SHOW DATABASES; mysql> SHOW TABLES; mysql> SHOW CREATE TABLE customer; mysql> SELECT * FROM customer LIMIT 5;
The same connection works for JDBC, ODBC, the Connector/Python driver, an ORM, or a long-running application: point at 127.0.0.1:3307 and log in with an account defined by auth_user in cfg/ifx.conf. The proxy checks the password itself, then reaches Informix with the backend credentials in the same file.
Access control
Every login is limited by a grant, because all clients share one Informix account. auth_grant=user:role[:dbs] sets the role (ro, rw or admin) and the databases the account may use. An account with no grant is read-only on the configured database.
| Client sees | Meaning |
|---|---|
| ERROR 1045 (28000) | Login refused: unknown user or wrong password. |
| ERROR 1044 (42000) | The account may not use that database (at login or with USE). |
| ERROR 1142 (42000) | The statement is not allowed for the account's role or databases. |
Statements are checked by their leading keywords, with deny as the default; this is a proxy-level control and not a SQL parser. A routine an account may call still does what it does, so give the Informix backend account only the privileges it needs.
Logging and observability
- Standard error carries any handshake / dispatch failures.
- Refused statements and databases are logged to standard error with the account and the reason, never the SQL text.
- A debug build of the proxy logs every SQL statement sent to Informix on standard error — useful when tracing a specific MySQL-side query through the translator.
- For wire-level visibility against the SQLI backend, the Oninit® Snooper can sit between m2is and the IDS server and decode every PFPDU in real time.
Lifecycle and signals
| Signal | Effect |
|---|---|
| SIGTERM | Stops accepting new client connections; in-flight pthreads finish their current request and exit. The PID file is removed. |
| SIGINT | Same as SIGTERM — useful when running in the foreground for development. |
| SIGHUP | Reserved; not currently a runtime config-reload trigger. Restart the proxy to pick up config changes. |
Capacity
The proxy runs one pthread per accepted client connection, plus the acceptor thread. Each connection holds its own Informix backend session (an ESQL/C connection for m2ie, a SQLI socket for m2is). Sizing follows the same rule as any per-connection backend: budget memory and Informix-side connection slots for the peak concurrent client count, not the average.
Several limits bound what one client can hold. hard_max_threads (default 1024) caps concurrent sessions and a license cannot lift it. idle_timeout (default 8 hours), read_timeout (30 s) and write_timeout (60 s) drop stalled clients. A SELECT is buffered in memory before it is sent, so max_result_mb (default 256 MiB per result) and max_result_total_mb (default 1024 MiB across all concurrent results) bound it; a query over budget fails with an error instead of returning a truncated result. The Configuration page lists each key.