Previous Section  < Day Day Up >  Next Section

Hack 96 Install Services

figs/moderate.gif figs/hack96.gif

You've used the so-called "Services" on various IRC networks, but have you ever wondered how to set them up for your own IRC server?

A Services package provides the NickServ, ChanServ, MemoServ, and OperServ features found on many IRC networks. This hack assumes that you already have an ircd set up, such as that shown in the previous hack. Just as there are many different types of ircds, there are lots of different Services packages, although they vary much more than ircds. The NickServ and ChanServ formats are probably the most common, but there are also bots such as X on Undernet and Q on QuakeNet that provide similar functionality. See [Hack #9] for more details on using ChanServ.

IRC Services was one of the first open source ChanServ packages. The first ChanServ was actually used on DALnet, but their version hasn't been released. Ever since Version 5 was released, IRC Services has been modular, so you can choose what functionality you want—it even includes the option of a web server to access data.

Although Services are seen as several clients by users (ChanServ, NickServ, etc.), the Services package itself links to the network as another server. This allows it to see all the clients connected to IRC, see the state of the channels, and change modes that normal clients (and usually operators) are unable to change.

IRC Services is really supported only under Unix-like systems, including Linux and FreeBSD. It should compile under the Cygwin Unix emulation environment on Windows, but the README states it isn't supported.

IRC Services can be downloaded from Once you have downloaded the archive file, extract it with the following command:

% tar zxvf ircservices-5.0.23.tar.gz

You may need to change the version number if you have a more recent version. Now change to the new directory that has appeared and run the configure script:

% cd ircservices-5.0.23

% ./configure

The configure script asks some questions and configures the Services ready to be compiled. It will ask you the path where the sbin directory should be placed. Unless you have root access, you'll need to put this in your home directory, for example in /home/user/services/sbin/. It will ask you if you want to create the directory if it doesn't already exist. The path for the data should automatically update, so just press Enter. After this, the configure script will check your system for various features. It will then tell you to edit defs.h and run make. You shouldn't need to edit defs.h, as the default settings will suffice. To compile Services, run:

% make

It will then tell you to run make install to install Services:

% make install

15.3.1 Configuring the IRC Server

The ircd that you are going to link the Services to must be configured to allow this and to also allow Services to change the channel modes. On Unreal 3.2, the configuration blocks are link and ulines. On other ircds, the lines are C: and N: for linking and U: for ulines. For example, if your Services are called (you'll be able to set this later), then you need a link for them and a uline for them.

If you are using Unreal, you will need to add something like this to the configuration file, unrealircd.conf:

link {

    username *;


    bind-ip *;

    hub *;

    password-connect "password";

    password-receive "password";


ulines {;


The important thing here is the hostname of Services. This should match the setting you used in the services-server setting in unrealircd.conf. The IP address is localhost—if you run Services on the same machine as the ircd, this is fine as it is. The password should be changed to something better than "password". If you compare this to another link block, you will notice the lack of the options section. This is because Services does not support any extra options and is not actually an IRC server, so it cannot be connected to. You don't need to restart the ircd to apply these changes. Simply type /rehash when connected to the server as an IRC operator, and it will reread the configuration file.

15.3.2 Configuring Services

The next step is to edit the configuration files for Services. To do this, change into the lib/ircservices directory where you installed IRC Services:

% cd ~/services/lib/ircservices

There are two configuration files. One is the main configuration for Services, including the server to connect to and the modules to load. The modules configuration file has the settings for each of the modules. These two files are provided as example-ircservices.conf and example-modules.conf, respectively. A lot of the configuration is up to personal preference and the features you need—this hack will show you how to change only the settings that are needed to get Services running.

Copy example-ircservices.conf to ircservices.conf and open it in a plain text editor. Lines that start with a # character are comments. There are a lot of useful comments, but some of the settings you will need are also commented out. Each option is described with a word such as REQUIRED or RECOMMENDED. For any setting that is not required, the default value will normally work.

Find the line that sets the option RemoteServer. It will be commented out, so you should remove the # and change the password to the password you used in the link block earlier. ServerName is the hostname that Services should use and should match the name used in the link and ulines blocks. ServiceUser is the username that Services will appear to have when it's on IRC. This should be something like services@domain, where domain is the domain you chose to use.

Finally, find the line that reads #LoadModule protocol/(insert protocol name here). The protocol name is the type of IRC server in use; this should be changed to unreal if you are using Unreal. The comments explain what to use for other ircds. Remember to remove the # from this line as well. Now save ircservices.conf.

The next file that needs editing is example-modules.conf. Copy it to modules.conf and open it in your text editor. The main aspect is the protocol module. Change the module name where it says Module protocol/(insert protocol name here) to unreal. Each of the protocol options explains the protocols it works with. If you set an option that is not needed for a protocol, you will get an error. On Unreal, you should set the ServerNumeric option. This is the same as the numeric in the "me" block discussed in the previous IRC server hack. Uncomment the ServerNumeric and NSRequireEmail settings by removing the # character from the start of both lines. You will also need to uncomment one of the ListenTo lines so that it reads something like:

ListenTo *:80

Services can send emails to allow users to retrieve passwords and so on, so you will need to set various email options. The FromAddress and FromName should be changed to values suitable for your domain name. RelayHost should be changed to the name of an SMTP server, and SMTPName should be changed to the hostname of the machine running Services.

Finally the ServicesRoot option should be set to your nickname on IRC. The person who registers this nickname will get full control over Services.

15.3.3 Running the Services

To start Services, run:

% ~/services/sbin/ircservices

Services will start and connect to the IRC server. If you get any errors, there is most likely a configuration option problem. Check ~/services/lib/ircservices/ircservices.log to see if it sheds any light on the problem. A common problem is setting an option without loading the required module. If Services doesn't link but appears to start correctly, there may be an error reported in the Services log file, too. You may also get some messages from the IRC server if there is a problem linking.

Now that Services is linked, you must register your nickname with NickServ. You should now have full access to OperServ, allowing you to change settings, add networkwide bans (akills), and exercise various other powers. You can get a list of the various options by typing /msg OperServ help.

David Leadbeater

    Previous Section  < Day Day Up >  Next Section