Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 558194 - net-misc/quagga has non-functioning systemd unit files. permissions on /run/quagga are wrong
Summary: net-misc/quagga has non-functioning systemd unit files. permissions on /run/q...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sergey Popov
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-19 19:12 UTC by Olipro
Modified: 2015-08-25 11:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olipro 2015-08-19 19:12:07 UTC
If you compare the systemd unit files for Quagga to the OpenRC ones, you'll note that a number of required parameters are not actually being passed to zebra - namely the path to its configuration file and PID file.

Additionally, the /run/quagga folder does not get chown'd to quagga:quagga so this also results in it failing to startup.

As an example, the Zebra systemd unit file should have the ExecStart like so:

ExecStart=/usr/sbin/zebra -d -f /etc/quagga/zebra.conf -i /run/quagga/zebra.pid
Comment 1 Sergey Popov gentoo-dev 2015-08-25 08:55:17 UTC
(In reply to Olipro from comment #0)
> If you compare the systemd unit files for Quagga to the OpenRC ones, you'll
> note that a number of required parameters are not actually being passed to
> zebra - namely the path to its configuration file and PID file.

As you can not run two zebra daemons on the same system, i omit them, defaults are used.
 
> Additionally, the /run/quagga folder does not get chown'd to quagga:quagga
> so this also results in it failing to startup.

Can not reproduce this on my systemd system(i rebooted to make sure that /run/quagga, remaining in RAM, will vanish). Directory ownership are controlled by systemd tmpfiles. With next release i plan to remove support of /run/quagga management from initscripts too, as tmpfiles are also supported by OpenRC - no need to duplicate the code.

Closing as WORKSFORME. Reopen if issue still happens for you, but, please, attach actual logs with error messages.
Comment 2 Olipro 2015-08-25 10:05:25 UTC
I don't think you're making a valid test then. I don't see anywhere that makes quagga magically just "find" its config and pidfile, and indeed, if that were the case, why does OpenRC specify them?

If your assertion is correct, please go ahead and delete the directives from the OpenRC init scripts and let's see what happens.

As for the logs with error messages... they're the relatively obvious ones "unit failed to start" etc, which I resolved by doing what I originally said needed to be done (namely, passing the needed arguments to the daemon in the unit file)
Comment 3 Olipro 2015-08-25 10:08:13 UTC
As an addendum... maybe your systemd unit worked *by virtue* of you rebooting? is it possible for the files to fail if you emerge quagga and then immediately try to start the unit?
Comment 4 Sergey Popov gentoo-dev 2015-08-25 10:42:31 UTC
(In reply to Olipro from comment #2)
> I don't think you're making a valid test then. I don't see anywhere that
> makes quagga magically just "find" its config and pidfile, and indeed, if
> that were the case, why does OpenRC specify them?

Look at src_configure and in source code. Removing paths for pid file and config from OpenRC initscripts works for me as well. They were put there as an extra safety measure.

>maybe your systemd unit worked *by virtue* of you rebooting? is it possible for the files to fail if you emerge quagga and then immediately try to start the unit?

Nice catch, will try that
Comment 5 Sergey Popov gentoo-dev 2015-08-25 11:03:55 UTC
Your suggestion about PID directory was right. Commited with revbump(due to change of installed files)

commit 2fe4a3a6e01fed2b08daeb8a16d6104ab03d2a41
Author: Sergey Popov <pinkbyte@gentoo.org>
Date:   Tue Aug 25 14:02:22 2015 +0300

    net-misc/quagga: create directory for PID files during src_install
    
    Directory for PID files was not created during src_install, which
    makes impossible to use Quagga daemons before first reboot
    for systemd users
    
    Reported-by: Olipro <olipro+gentoopub@gmail.com>
    Gentoo-Bug: 558194
    
    Package-Manager: portage-2.2.20