quasselcore.service systemd unit does not depend on PostgreSQL, causing the core to fail to start if it is configured to use PostgreSQL

Bug #1432161 reported by Michael Marley
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
quassel (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

quasselcore's current systemd unit file does not have Wants or After entries for PostgreSQL, so Quassel will usually/always be started before PostgreSQL is running. If the core is configured to use PostgreSQL for storage, this causes the core to fail to start.

I have attached a debdiff that fixes the problem. The systemd documentation indicates (and I have proven with experimentation) that a Wants or After entry on a non-existent unit will not keep the unit from starting, so this won't cause any problems for people who don't have PostgreSQL installed.

Tags: patch
Revision history for this message
Michael Marley (mamarley) wrote :
Revision history for this message
Michael Marley (mamarley) wrote :

Here is a new patch that fixes a couple more issues I found.

First, the systemd unit file did not have Restart=on-failure, which differed from the behavior of the upstart script.

Second, neither the systemd unit file nor the upstart script had support for the DAEMON_OPTS variable from /etc/default/quasselcore. This made it difficult for administrators to add extra arguments, which is especially true on systemd since the unit file is silently overwritten every time the package is updated.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "init.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Felix Geyer (debfx) wrote :

We should probably also add mysql.service next to postgres.

> Second, neither the systemd unit file nor the upstart script had support for the
> DAEMON_OPTS variable from /etc/default/quasselcore. This made it difficult for
> administrators to add extra arguments, which is especially true on systemd since
> the unit file is silently overwritten every time the package is updated.

Using default files is discouraged so we shouldn't add new options, see:
https://wiki.debian.org/systemd/Packaging#overriding_options_and_.2Fetc.2Fdefault_handling

Changes to systemd units aren't overwritten if you do it right.
You want to call: systemctl edit quasselcore.service
And type something like:
[Service]
ExecStart=...

Revision history for this message
Michael Marley (mamarley) wrote :

Ah, OK, I hadn't read that. Makes sense, here is another debdiff that only has the PostgreSQL and Restart=on-failure changes. Quassel doesn't support MySQL, so I don't think adding mysql.service is necessary.

Revision history for this message
Michael Marley (mamarley) wrote :

After further reading and experimentation, it seems that the ExecStart= directive cannot be overridden because the contents of the override file are appended to the contents of the main unit file. This results in two ExecStart= directives being present, which is illegal and prevents systemd from using the script. The only way to work around that would be to override the entire unit, but that would mask any upstream changes, so that doesn't seem like a good idea.

Revision history for this message
Felix Geyer (debfx) wrote :

I'm not sure where you read this. Multiple ExecStart are allowed (but of course not what you actually want).
https://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F says you can add an empty ExecStart= line and then the ExecStart=... you want.

The man page says the same:
If the empty string is assigned to this option, the list of commands to start is reset, prior assignments of this option will have no effect.

[Service]
ExecStart=
ExecStart=...

Anyway the debdiff looks good. I'll incorporate it into the next upload.

Revision history for this message
Michael Marley (mamarley) wrote :

Oops, I hadn't read that either. Sorry for the trouble.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package quassel - 0.12~rc1-0ubuntu1

---------------
quassel (0.12~rc1-0ubuntu1) vivid; urgency=medium

  * New upstream release. (LP: #1431008)

  [ Michael Marley ]
  * Add Wants and After on postgresql for systemd (LP: #1432161)
  * Add Restart=on-failure for systemd

  [ Felix Geyer ]
  * Drop kubuntu_02_enable_message_indicator.diff as there is no
    message indicator widget in Kubuntu anymore.
 -- Felix Geyer <email address hidden> Wed, 18 Mar 2015 17:21:10 +0100

Changed in quassel (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.