Re: ircd Issue
By: Dream Master to All on Fri Jan 22 2021 10:30 am
Interesting little issue. If running ircd from within Synchronet as a non-standalone service, it binds to the properly defined interface in sbbs.ini. On the other hand, when running ircd as a standalone service from systemd, it binds to 0.0.0.0.
Please note, my BBS interface is 172.31.1.184 and my management interface is 172.31.5.242.
ircd from within Synchronet:
tcp 0 0 172.31.1.184:6667 0.0.0.0:* LISTEN tcp 0 0 172.31.1.184:36197 71.95.196.34:6667
ESTABLISHED
ircd when started from systemd:
tcp 0 0 0.0.0.0:6667 0.0.0.0:* LISTEN tcp 0 0 172.31.5.242:35327 71.95.196.34:6667
ESTABLISHED tcp6 0 0 :::6667 :::*
LISTEN
From the looks of it, the standalone initialization of it comes from ircd.js, lines 168 through 181:
if(this.server==undefined) { // Running from JSexec?
if (!jsexec_revision_detail)
jsexec_revision_detail = "JSexec";
if (cmdline_port)
default_port = cmdline_port;
else if (mline_port)
default_port = mline_port;
server = { socket: false, terminated: false,
version_detail: jsexec_revision_detail, interface_ip_addr_list: ["0.0.0.0","::"] };
server.socket = create_new_socket(default_port)
if (!server.socket)
exit();
}
Yet, from lines 626 to 646, the else statement to utilize the sbbs.ini defined interface will likely never get called:
function connect_to_server(this_cline,the_port) {
var connect_sock;
var new_id;
if (!the_port && this_cline.port)
the_port = this_cline.port;
else if (!the_port)
the_port = default_port; // try a safe default.
if (js.global.ConnectedSocket != undefined) {
try {
connect_sock = new ConnectedSocket(this_cline.host, the_port, {timeout:ob_sock_timeout, bindaddrs:server.interface_ip_addr_list});
}
catch(e) {
connect_sock = new Socket();
}
}
else {
connect_sock = new Socket();
connect_sock.bind(0,server.interface_ip_address);
connect_sock.connect(this_cline.host,the_port,ob_sock_timeout);
}
I'm a little stumped on how to fix this. I can obviously tweak interface_ip_addr_list and put the correct interface in it, but that would make the solution only work for me and I don't want that.
Thoughts?
There may be a setting in ircd.conf that is (or is supposed to) control the local interface IP address to bind to, but looking at that code you pasted, it certainly appears to be hard-coded to 0.0.0.0. Note: sbbs.ini is intentionally not used by JSexec.
The person to talk to about this stuff would be either cyan or deuce in #synchronet at irc.synchro.net (Cyan wrote the ircd.js). I saw you attempted to get Deuce's attention regarding your BinkIT 100% CPU utilization issue and didn't get any response. Sometimes you've got to ping him multiple times. echicken or nelgin might also have some helpful input on the ircd local interface issue (and those 2 monitor DOVE-Net usually, so maybe they're reply here).
--
digital man
Sling Blade quote #14:
Karl Childers: Some folks call it a sling blade, I call it a kaiser blade. Norco, CA WX: 63.9øF, 57.0% humidity, 1 mph W wind, 0.00 inches rain/24hrs
--- SBBSecho 3.12-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)