Thanks to Ticho for mentioning the idea
Thanks to Vagabond for quickly implementing support in his rirc
If you don't have/want xinetd/inetd check out spinetd

Note that this is a ridiculous idea. Note that there is no authentication yet, so you're simply allowing everyone to connect to your irssi2 instance! So if you're going to try this, make sure the port is firewalled well.
To resolve the latter, I recommend you follow the SshInetdHowto afterwards. (:

This is a quick guide on how to run irssi2 under inetd or xinetd, instead of ssh / local socket / whatnot.
Includes inetd configuration, xinetd configuration and the rest. :)

Setting up inetd

  1. Edit /etc/services and add:

    irssi2 1027/tcp
  2. Create a, make it executable by your user, and put this in it:

    ###, by daxxar.
    ## Simple wrapper to make irssi2 run under inetd
    ## Please, if anyone knows a better way; lemme know. (:
    # Check that the user (rather; inetd/xinetd) passed a proper binary.
    if [ -z "$BIN" ]; then
        echo " you didn't pass a path to the real irssi2 binary. exiting."
        exit 1
    if [ ! -r "$BIN" ] || [ ! -x "$BIN" ] || [ ! -f "$BIN" ]; then
        echo " you didn't pass the path ($BIN) to a readable, executable file. exiting."
        exit 1
    # Better safe than sorry! :)
    for v in `export|awk '{ sub(/^declare -x /, ""); sub(/=.*$/, ""); print $0 }'`; do unset $v; done
    # Set up the needed stuff.
    export PATH="/usr/local/bin:/usr/bin:/bin"
    export USER="`id -un`"
    # If you haven't got getent, use this instead:
    # export HOME="`grep ^$USER: /etc/passwd|cut -f6 -d:`" instead.
    export HOME="`getent passwd $USER|cut -f6 -d:`"
    # Execute the binary itself. (=
  3. Edit /etc/inetd.conf and add: (NOTICE THE STANDALONE ""; IMPORTANT)

    irssi2  stream  tcp  nowait  username_here  /path/to/ /path/to/irssi2-binary
  4. Restart inetd.

Setting up xinetd

  1. Add irssi2 as a service as above
  2. Edit /etc/xinetd.d/irssi2 and add:

    service irssi2
            socket_type     = stream
            protocol        = tcp
            wait            = no
            user            = username_here
            server          = /path/to/irssi2-binary
            passenv         = 
            env             = PATH=/usr/local/bin:/usr/bin:/bin USER=username_here HOME=/path/to/homedir
            port            = 1027
  3. Restart xinetd.


There's one "problem":

  • you have to make a wrapper script to get it to run as non-root (for inetd)

The reason for the script is related to the environment that irssi2 is run in under inetd, and no way to change it via the inetd.conf.
If you try replacing the inetd.conf line that has the wrapper with the real binary, you get an error about /root/.irssi2 not being writeable. This is due to the environment that it sets up, i.e. HOME, is obviously not updated.

I hope this helps, it's really easy as pie.

InetdHowto (last edited 2009-03-15 22:42:40 by localhost)