Bug 191187 - irc/inspircd startup may fail if compiled with postgresql support
Summary: irc/inspircd startup may fail if compiled with postgresql support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Mark Felder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-19 14:58 UTC by Kurt Lidl
Modified: 2014-09-12 17:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Lidl freebsd_committer freebsd_triage 2014-06-19 14:58:14 UTC
I have been using the inspircd daemon to run an internal IRC server.
It's been working great.

I have compiled it with the PGSQL support, so I can authenticate
against users whose data is in the database, so I don't have to
restart the IRC server to add new users.  This has also been
working great.

I noticed today, when rebooting the machine, after applying the
latest binary updates from 'freebsd-update', that the inspircd daemon
failed to restart properly.

In /var/log/messages, I see:
Jun 19 14:27:08 XXXX postgres[1055]: [2-1] FATAL:  the database system is starting up
Jun 19 14:27:08 XXXX kernel: pid 1041 (inspircd), uid 72: exited on signal 11

The basic problem is that inspircd can be started before the postgresql
daemon, or before the postgresql daemon is ready to serve data.  And when
that heppens, inspircd just core dumps.

I was able to edit the /usr/local/etc/rc.d/inspircd file to list
postgresql as a prerequisite for inspircd, and now it starts properly:

*** /tmp/inspircd.orig	Thu Jun 19 14:56:02 2014
--- inspircd	Thu Jun 19 14:30:58 2014
***************
*** 3,9 ****
  # $FreeBSD: head/irc/inspircd/files/inspircd.in 343571 2014-02-10 01:46:33Z feld $
  #
  # PROVIDE: inspircd
! # REQUIRE: DAEMON
  # BEFORE: LOGIN
  # KEYWORD: shutdown
  
--- 3,9 ----
  # $FreeBSD: head/irc/inspircd/files/inspircd.in 343571 2014-02-10 01:46:33Z feld $
  #
  # PROVIDE: inspircd
! # REQUIRE: DAEMON postgresql
  # BEFORE: LOGIN
  # KEYWORD: shutdown


It would be nice if the inspircd port would adjust the startup file if PGSQL was set as an option.  I would guess that a similar problem exists for MYSQL support too.

Thanks!
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-06-25 02:27:46 UTC
Over to maintainer.
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-09-12 17:25:11 UTC
A commit references this bug:

Author: feld
Date: Fri Sep 12 17:24:45 UTC 2014
New revision: 368050
URL: http://svnweb.freebsd.org/changeset/ports/368050

Log:
  Alter rc script startup ordering.

  In the event the user is running Inspircd with a MySQL or Postgres
  backend it will fail to start on boot if it comes up before the database
  does.

  PR:		191187

Changes:
  head/irc/inspircd/Makefile
  head/irc/inspircd/files/inspircd.in
Comment 3 Mark Felder freebsd_committer freebsd_triage 2014-09-12 17:32:09 UTC
bdrewery confirmed for me that items in the BEFORE: don't have to be installed; it's just for ordering.