Resource icon

Installing Quassel Core (with PostgreSQL) in a FreeNAS jail

Create the jail
  • Create a new jail, give it a name (in this case quassel and click on Advanced Mode. When in advanced mode, scroll down to Sysctls and enter allow.raw_sockets=true,allow.sysvipc=1 and then select OK (See http://doc.freenas.org/11/jails.html#adding-jails for more details).
  • SSH to your FreeNAS box and run: jexec <jailname> csh (replace <jailname> with your jail's name)
  • Update pkgs: pkg update && pkg upgrade -y
Install PostgreSQL 9.5
Do not be tempted to install PostgreSQL 9.6, as Qt5 PostgreSQL database driver requires PostgreSQL 9.5.
  • Install PostgreSQL 9.5 server: pkg install postgresql95-server
  • Edit /etc/login.conf and at the bottom of the file insert the following lines:
Code:
postgres:\
	:lang=en_US.UTF-8:\
	:setenv=LC_COLLATE=C:\
	:tc=default:

  • Run: cap_mkdb /etc/login.conf
  • Set PostgreSQL to use the postgres login class at boot: sysrc postgresql_class="postgres"
  • Set PostgreSQL to start at boot: sysrc postgresql_enable="YES"
  • Initialize the PostgrSQL database: service postgresql initdb
  • Start PostgrsSQL: service postgresql start
  • Switch to the pgsql user and create a database for itself:
Code:
# su - pgsql
# createdb pgsql

Now that the PostgreSQL database server is setup, we ca now move on to installing Quassel Core.

Install Quassel Core
  • Install Quassel Core and the Qt5 PostgreSQL database driver: pkg install quassel-core qt5-sqldrivers-pgsql
  • At this stage, you will have to create a directory for Quassel Core under /var/db/quasselcore. The package does not create this directory automatically, however if you'd prefer to do this via ports, the directory is created for you. Run the following: mkdir /var/db/quasselcore && chown quasselcore:quasselcore /var/db/quasselcore
  • Set Quassel Core to start at boot: sysrc quasselcore_enable=YES
  • Create a self-signed SSL certificate: service quasselcore keygen
  • Start Quassel Core: service quasselcore start
Configure the Quassel Core SQL database
  • Switch to the pgsql user: su - pgsql
  • Run psql and copy/paste the following SQL script (Replace somepassword with your own password.):
Code:
CREATE USER quassel ENCRYPTED PASSWORD 'somepassword';
CREATE DATABASE quassel WITH OWNER quassel ENCODING 'UTF8';

To exit psql, press Ctrl+D and this will drop you back to the shell. Press Ctrl+D again to return to the root user.

Now that the Quassel Core database has been created, simply connect to the Quassel Core jail using the Quassel client and step through the wizard, selecting the PostgreSQL backend and the Quassel Core database name and password.

What did I just do?

If you followed the instructions correctly, you have just installed PostgreSQL 9.5 and Quassel Core. As part of the process, you also successfully configured the PostgreSQL database server and create a SQL database for Quassel Core.

Upgrading to the latest version
  • SSH to your FreeNAS box and run: jexec <jailname> csh
  • Update from pkg: pkg update && pkg upgrade
  • Restart both PostgreSQL and Quassel Core: service postgres restart && service quasselcore restart
Author
m0nkey_
Views
2,554
First release
Last update
Rating
5.00 star(s) 1 ratings

More resources from m0nkey_

Latest reviews

Perfect! Quassel is excellent way to have an always connected IRC client available from anywhere.
Top