some notes on QMF
by Russell Bryant
Greetings,
I met with Perry, Ted, and Dmitri the other day to discuss various
issues around QMF. I wanted to share some notes from that discussion.
1) Splitting QMF from the Qpid source code
We discussed the idea of splitting out the QMF implementation from the
Qpid source code. It seems to make a lot of sense to make QMF its own
project. It's a framework built on top of Qpid, not so much a core part
of Qpid itself. This will also ensure that there is a clean separation
between QMF and what public Qpid APIs are being used to implement QMF.
This would also help pave the way to allow QMF to eventually work over
any AMQP deployment, and not just Qpid. There are some issues with this
working right now due to different implementations using different
versions of the AMQP protocol, but as these projects converge on AMQP
1.0, QMF can become a framework that can work over any of them.
I'm going to take a stab and getting QMF pulled out and building on its
own in the near future and then we'll go from there.
2) Consider merging parts of Matahari into QMF
From a high level, Matahari provides a couple of things: a set of
agents, and code for making it easier to write agents. We should look
at whether it makes sense to merge the latter into QMF itself. I think
that ideally, something like libvirt-qmf shouldn't be a Matahari agent.
It should be able to get everything it needs from core QMF.
There are some other features that we have implemented that probably
make sense to push into QMF (or Qpid). Some of our DNS SRV support, for
example, may make sense to add there.
3) Security
There isn't much security support at the QMF layer right now. The
current security model is what you get from the AMQP / Qpid layer.
There is encryption, authentication, and ACL support for getting access
to the bus (or a domain within the bus), but once you're connected, at
the QMF layer you can do anything with any agent that is connected.
There is still some more discussion needed to nail down what exactly we
would like to do here. Shorter term, we may be able to implement a
read/only read/write type concept. Longer term, finer grained access
control policies at the agent endpoints using something like PolicyKit
may make a lot of sense.
Those were the biggest items that affect Matahari in the short term.
Let me know if you have any comments or questions.
Thanks,
--
Russell Bryant
12 years, 7 months
few uses cases added to vios-proxy wiki
by Adam Stokes
Start of a few uses cases now on the vios proxy wiki page
https://github.com/matahari/matahari/wiki/Vios-Proxy
The first 2 are pretty straight forward, the big one is the last one.
Doing a federated setup of brokers on several guests could probably
have additional sub points but the main point is to make sure all local
brokers on the guest connect to their federated setup and can
communicate over their defined routes within qpid.
12 years, 7 months
SSL in agents
by Zane Bitter
I've been attempting to get the SSL code in the agents going again, and
some of the things we have on the wiki page are starting to make sense.
This one, for instance:
> At this time the only connection level settings available through the api is ssl-cert-name, the other options need to be specified globally. For example,
>
> QPID_LOG_ENABLE=debug+ QPID_SSL_CERT_DB=src/tests/test_cert_db QPID_SSL_CERT_PASSWORD_FILE=src/tests/cert.password ./matahari-qmf-hostd -N agent -p 5671 -S
Unfortunately, this appears to still be the case. It seems like the code
we had (but #ifdef'd out) was using some private API in qpid-cpp-client
that isn't actually exported in the headers(?).
As far as I can tell there is no way to pass the cert db and password
file options apart from through the environment. To make matters worse,
the qpid client library does its initialisation statically, so the
environment variables have to be set before the library is loaded. Which
happens before main() is run.
An alternative is to set them up in /etc/qpid/qpidc.conf. This clearly
sucks, because the same file is also used by standard qpid client users.
Adam opened a bug against qpid to make this location configurable
(#703563), but it doesn't appear to have been fixed yet. Even then you
will have to configure it through the environment at startup, which is
easily handled by the init/service scripts, but will mean that if you
run the agent manually it will pick up config from the wrong file.
Finally, we can get the user to configure the Qpid environment variables
in /etc/sysconfig/matahari. This is doable for a defined subset of the
Qpid environment variables, since we'd have to explicitly export each
one in the SysVInit script (systemd already makes all the variables in
the EnvironmentFile available in the daemon's environment).
Is anyone aware of any changes to this information? Adam, I think,
mentioned on IRC the other day about some of this having been fixed?
The other question is whether it is even worthwhile us supporting SSL on
the agents. Perhaps we should recommend that agents should connect to a
local broker (without SSL) and that access to them from outside the box
should be by connecting to or federating with that broker, preferably
over SSL.
Thoughts?
cheers,
Zane.
12 years, 7 months
[PATCH] - Do not accept filenames prefixed with .. or /
by Adam Stokes
There is basically no limitation on how the key name
is defined. With that said we should at least make sure
the keys do not start with a '/' or '..'. This will
eliminate accidental typos and also intentional ones.
Signed-off-by: Adam Stokes <astokes(a)fedoraproject.org>
---
src/lib/sysconfig.c | 8 +++++++-
src/tests/mh_api_sysconfig.h | 5 +++++
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/lib/sysconfig.c b/src/lib/sysconfig.c
index 0301734..b494e7d 100644
--- a/src/lib/sysconfig.c
+++ b/src/lib/sysconfig.c
@@ -71,7 +71,13 @@ set_key(const char *key, const char *contents)
if (mh_strlen_zero(key)) {
mh_err("key cannot be empty");
- return -1;
+ return FALSE;
+ }
+
+ if (g_str_has_prefix(key, "..") ||
+ g_str_has_prefix(key, "/")) {
+ mh_err("Invalid key filename %s", key);
+ return FALSE;
}
if (!g_file_test(keys_dir_get(), G_FILE_TEST_IS_DIR) &&
diff --git a/src/tests/mh_api_sysconfig.h b/src/tests/mh_api_sysconfig.h
index 0bab713..69408d0 100644
--- a/src/tests/mh_api_sysconfig.h
+++ b/src/tests/mh_api_sysconfig.h
@@ -29,6 +29,8 @@ class MhApiSysconfigSuite : public CxxTest::TestSuite
void testIsConfigured(void)
{
const char key[] = "org.matahariproject.test.unittest"; // Unimportant key defined
+ const char invalid_key[] = "../etc/passwd"; // Unimportant invalid key defined
+ const char invalid_key2[] = "/etc/passwd"; // Unimportant invalid key defined
char *key_res;
mh_sysconfig_keys_dir_set("/tmp/matahari-sysconfig-keys/");
@@ -36,6 +38,9 @@ class MhApiSysconfigSuite : public CxxTest::TestSuite
TS_ASSERT((mh_sysconfig_set_configured(key, "OK")) == TRUE);
TS_ASSERT(((key_res = mh_sysconfig_is_configured(key))) != NULL);
TS_ASSERT(!strcmp("OK", key_res));
+ // Double check invalid key names are supported
+ TS_ASSERT((mh_sysconfig_set_configured(invalid_key, "ownage password")) == FALSE);
+ TS_ASSERT((mh_sysconfig_set_configured(invalid_key2, "another ownage password")) == FALSE);
free(key_res);
}
--
1.7.6.2
12 years, 7 months
Matahari Tests
by Dave Johnson
Hey, here are the first commits of the automated tests that I have been working on. Its a work in progress but a good start.
-Dave Johnson
12 years, 7 months
[PATCH 1/2] Implement augeas support in Sysconfig agent
by Radek Novacek
---
src/CMakeLists.txt | 9 +++
src/lib/CMakeLists.txt | 2 +-
src/lib/sysconfig_linux.c | 108 +++++++++++++++++++++++++++++++++++++--
src/sysconfig/sysconfig-qmf.cpp | 2 +-
4 files changed, 114 insertions(+), 7 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e3a7e38..bd31326 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -109,6 +109,15 @@ if(NOT WIN32)
endif(CURL STREQUAL "CURL-NOTFOUND")
endif(NOT WIN32)
+# Augeas
+# At least version 0.9.0 - we need aug_srun command
+if(NOT WIN32)
+ pkg_check_modules(augeas REQUIRED augeas>=0.9.0)
+ if(NOT augeas_FOUND)
+ message(FATAL_ERROR "Augeas headers/library >= 0.9.0 not found.")
+ endif(NOT augeas_FOUND)
+endif(NOT WIN32)
+
# Include QMF and DBus generation macros
include(MatahariMacros)
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 4b2326c..260c9b1 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -28,7 +28,7 @@ target_link_libraries(mservice ${pcre_LIBRARIES} mcommon ${SIGAR} ${glib_LIBRARI
add_library (msysconfig SHARED sysconfig.c sysconfig_${VARIANT}.c)
set_target_properties(msysconfig PROPERTIES SOVERSION 1.0.0)
-target_link_libraries(msysconfig ${pcre_LIBRARIES} mcommon mservice ${glib_LIBRARIES})
+target_link_libraries(msysconfig ${pcre_LIBRARIES} mcommon mservice ${glib_LIBRARIES} ${augeas_LIBRARIES})
if(WIN32)
foreach (lib ${LIBS})
diff --git a/src/lib/sysconfig_linux.c b/src/lib/sysconfig_linux.c
index 9a87288..7e06bc9 100644
--- a/src/lib/sysconfig_linux.c
+++ b/src/lib/sysconfig_linux.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <glib.h>
#include <curl/curl.h>
+#include <augeas.h>
#include "matahari/logging.h"
#include "matahari/utilities.h"
@@ -292,18 +293,113 @@ return_failure:
}
static int
-run_augeas(const char *query, const char *data, const char *key,
+run_augeas(const char *uri, const char *data, const char *key,
mh_sysconfig_result_cb result_cb, void *cb_data)
{
- mh_warn("not implemented\n");
- return -1;
+ int fd;
+ FILE *fp;
+ char *text = NULL;
+ char filename[PATH_MAX];
+ GError *err = NULL;
+
+
+ if (uri) {
+ snprintf(filename, sizeof(filename), "%s", "augeas_conf_XXXXXX");
+
+ fd = mkstemp(filename);
+ if (fd < 0) {
+ mh_err("Unable to create temporary file");
+ return -1;
+ }
+
+ fp = fdopen(fd, "w+b");
+ if (fp == NULL) {
+ close(fd);
+ unlink(filename);
+ mh_err("Unable to open temporary file");
+ return -1;
+ }
+
+ if ((sysconfig_os_download(uri, fp)) != 0) {
+ fclose(fp);
+ unlink(filename);
+ mh_err("Unable to download file from uri %s", uri);
+ return -1;
+ }
+
+ fclose(fp);
+
+ if (!g_file_get_contents(filename, &text, NULL, &err)) {
+ mh_err("Unable to read downloaded file: %s", err ? err->message : "Unknown error");
+ unlink(filename);
+ return -1;
+ }
+
+ unlink(filename);
+
+ } else if (data) {
+ text = g_strdup(data);
+ } else {
+ mh_err("No uri/data provided for augeas");
+ return -1;
+ }
+
+ snprintf(filename, sizeof(filename), "%s", "augeas_conf_XXXXXX");
+
+ fd = mkstemp(filename);
+ if (fd < 0) {
+ mh_err("Unable to create temporary file");
+ return -1;
+ }
+
+ fp = fdopen(fd, "w+b");
+ if (fp == NULL) {
+ close(fd);
+ unlink(filename);
+ mh_err("Unable to open temporary file");
+ return -1;
+ }
+
+ augeas *aug = aug_init("", "", AUG_SAVE_BACKUP);
+ int result = aug_srun(aug, fp, text);
+
+ mh_info("run_augeas for key \"%s\" exited with status %d and data \"%s\"", key, result, text);
+
+ aug_close(aug);
+
+ g_free(text);
+ fclose(fp);
+
+ if (result < 0) {
+ unlink(filename);
+ mh_err("Augeas command failed");
+ return -1;
+ }
+
+ char *value = NULL;
+ if (!g_file_get_contents(filename, &value, NULL, &err)) {
+ mh_err("Unable to read augeas results: %s", err->message);
+ unlink(filename);
+ return -1;
+ }
+
+ mh_sysconfig_set_configured(key, value);
+ result_cb(cb_data, result);
+
+ unlink(filename);
+
+ return 0;
}
static const char *
sysconfig_os_query_augeas(const char *query)
{
- const char *data = NULL;
- mh_warn("not implemented\n");
+ const char *data = NULL, *value = NULL;
+ augeas *aug = aug_init("", "", 0);
+ aug_get(aug, query, &value);
+ if (value)
+ data = strdup(value);
+ aug_close(aug);
return data;
}
@@ -348,6 +444,8 @@ sysconfig_os_run_string(const char *string, uint32_t flags, const char *scheme,
if (!strcasecmp(scheme, "puppet")) {
rc = run_puppet(NULL, string, key, result_cb, cb_data);
+ } else if (strcasecmp(scheme, "augeas") == 0) {
+ rc = run_augeas(NULL, string, key, result_cb, cb_data);
} else {
rc = -1;
}
diff --git a/src/sysconfig/sysconfig-qmf.cpp b/src/sysconfig/sysconfig-qmf.cpp
index 1ffaa59..f04b123 100644
--- a/src/sysconfig/sysconfig-qmf.cpp
+++ b/src/sysconfig/sysconfig-qmf.cpp
@@ -154,7 +154,7 @@ ConfigAgent::invoke(qmf::AgentSession session, qmf::AgentEvent event, gpointer u
}
} else if (methodName == "query") {
const char *data = NULL;
- data = mh_sysconfig_query(args["query"].asString().c_str(),
+ data = mh_sysconfig_query(args["text"].asString().c_str(),
args["flags"].asUint32(),
args["scheme"].asString().c_str());
event.addReturnArgument("data", data ? data : "unknown");
--
1.7.6.2
12 years, 7 months
Application for port-number: matahari-tls
by Zane Bitter
Assignee Name (REQUIRED): Matahari Project
Assignee E-mail (REQUIRED): matahari(a)lists.fedorahosted.org
(The Assignee is the organization, company or individual person
responsible for the initial assignment.)
Contact Name (REQUIRED): Zane Bitter
Contact E-mail (REQUIRED): zbitter(a)redhat.com
Transport Protocol(s) (REQUIRED): (Please indicate which protocols are
currently required.)
[ X ] TCP [ ] UDP [ ] SCTP [ ] DCCP
Service Code (REQUIRED for DCCP only)
A: ____________________________
Service Name (REQUIRED, 15 character maximum):
A: matahari-tls
Desired Port Number (OPTIONAL, for Port Number only)
A: 49001
NOTE: It is *inappropriate* to use a port number until your application
has been approved for assignment. Leave it blank if no number preference.
Description (REQUIRED) (For example: Super User Messaging)
A: Matahari Broker over TLS/SSL
Reference (REQUIRED): Please provide a brief and basic technical
description of the protocol that will use the service name or port
number, including message formats, types, sequences, functionalities, of
your protocol. In addition, please address the specific questions
included below to the extent possible.
A: Matahari (http://matahariproject.org/) is a service to provide remote
access to system management APIs over QMF. Existing APIs support system
configuration and querying of system parameters for virtual servers,
however the protocol is extensible so users can add their own custom APIs.
Matahari uses the Advanced Message Queueing Protocol (AMQP) to convey
messages. On the matahari-tls port, traffic is encrpyted with TLS or
SSL. The Matahari server is an implementation of an AMQP broker.
Matahari sits on top of the Qpid Management Framework (QMF), which in
turn sits on top of AMQP 0.10 (Apache Qpid is an implementation of
AMQP). AMQP is an open standard which is documented here:
http://www.amqp.org/confluence/download/attachments/720900/amqp.0-10.pdf
In short, AMQP is a generic protocol for handling message queues. Client
applications can create and subscribe to queues and publish messages to
them. However, Matahari is a specialised use of AMQP which is a very
different service from an Enterprise Service Bus which runs on the
existing AMQP/AMQPS ports.
Q: If broadcast/multicast is used, how and what for?
A: Not applicable.
Q: If UDP is requested, please explain how traffic is limited, and
whether the protocol reacts to congestion.
A:
___________________________________________________________________________
Q: If UDP is requested, please indicate whether the service is solely
for the discovery of hosts supporting this protocol.
A:
___________________________________________________________________________
Q: Please explain how your protocol supports versioning.
A: All AMQP messages begin with a version field, and AMQP defines a
method for the client and server to negotiate a mutually compatible
protocol version. QMF objects have a schema which can be queried over
the protocol.
Q: If your request is for more than one transport, please explain in
detail how the protocol differs over each transport.
A:
__________________________________________________________________________
Q: Please describe how your protocol supports security. Please note that
there is current debate as to whether additional future ports will be
allocated for newly assigned services that lack security, e.g., solely
for the addition of a secure variant. Applicants are strongly advised to
address this issue as early as possible in the design of their protocols.
A: This application is for an AMQPS (AMQP over TLS) port to supplement
the existing AMQP port assigned to the matahari service (49000).
Q: Please explain the state of development of your protocol.
A: AMQP is a published open standard with four published versions since
2006 and multiple available implementations. Version 1.0 has been
finalised and is in the processed of being accepted.
Q: If SCTP is requested, please describe the following: Is there an
existing TCP and/or UDP service name or port number assignment?
If so, please indicate the details below:
Service Name: _______________; Port number: _______________
What specific SCTP capability is used by the application such that a
user who has the choice of both TCP (and/or UDP) and SCTP ports for
this application would choose SCTP? See [RFC4960 section 7.1]
(http://tools.ietf.org/html/rfc4960#section-7.1)
A:
_____________________________________________________________________________
________________________________________________________________________________
Please provide any other information that would be helpful in
understanding how this protocol differs from existing assigned services.
A: The forthcoming version 1.0 of AMQP provides a mechanism to negotiate
the use of TLS on a connection. However this is not supported in the
current version 0.10 of AMQP, or by the existing implementations.
There are also a number of reasons why a separate port may be required
for TLS-secured communication, such as packet-inspecting firewalls that
would not recognise the AMQP handshake as a TLS connection, or the need
to configure separate firewall policies for secure and unsecure
connections to the service.
This application is for a TLS-secured port with an equivalent
relationship to the matahari service port (49000) as the existing AMQPS
port for Enterprise Message Bus applications (5671) has to the
equivalent AMQP port (5672).
Matahari cannot use the AMQPS port assigned for Enterprise Message Buses
because it is an entirely different service; it just happens to share
the same messaging protocol.
12 years, 7 months
[PATCH] build: remove cxxtest from spec.
by Russell Bryant
cxxtest is not used in the RPM build process, so don't include it in the
spec file.
Signed-off-by: Russell Bryant <rbryant(a)redhat.com>
---
matahari.spec.in | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/matahari.spec.in b/matahari.spec.in
index 039e120..381a977 100644
--- a/matahari.spec.in
+++ b/matahari.spec.in
@@ -53,7 +53,6 @@ BuildRequires: pcre-devel
BuildRequires: glib2-devel
BuildRequires: sigar-devel > 1.6.5-0.2
BuildRequires: libcurl-devel
-BuildRequires: cxxtest
BuildRequires: help2man
%if %{with qmf}
--
1.7.6.2
12 years, 7 months
[PATCH] build: add systemd var to spec file.
by Russell Bryant
Instead of checking whether _unitdir is defined throughout the spec
file, do that check once at the top and have a "systemd" variable that
is used throught the rest of the file to make it a little bit more clear
that the checks are for whether or not systemd is in use.
Signed-off-by: Russell Bryant <rbryant(a)redhat.com>
---
matahari.spec.in | 52 +++++++++++++++++++++++++++++-----------------------
1 files changed, 29 insertions(+), 23 deletions(-)
diff --git a/matahari.spec.in b/matahari.spec.in
index 6e89967..039e120 100644
--- a/matahari.spec.in
+++ b/matahari.spec.in
@@ -8,6 +8,12 @@
# Choose a versioning scheme
%bcond_without pre_release
+%if %{defined _unitdir}
+%global systemd 1
+%else
+%global systemd 0
+%endif
+
%if %{with pre_release}
%global mh_release 0.%{specversion}.%{upstream_version}.git
%else
@@ -193,7 +199,7 @@ make %{?_smp_mflags}
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
-%if %{defined _unitdir}
+%if %{systemd}
rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/matahari-service
rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/matahari-network
rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/matahari-host
@@ -214,7 +220,7 @@ rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/matahari-broker
#== Host
%post host
-%if %{defined _unitdir}
+%if %{systemd}
systemctl --system daemon-reload
%endif
/sbin/service matahari-host condrestart
@@ -222,7 +228,7 @@ systemctl --system daemon-reload
%preun host
if [ $1 = 0 ]; then
/sbin/service matahari-host stop >/dev/null 2>&1 || :
-%if %{undefined _unitdir}
+%if !%{systemd}
chkconfig --del matahari-host
%endif
fi
@@ -235,7 +241,7 @@ fi
#== Network
%post network
-%if %{defined _unitdir}
+%if %{systemd}
systemctl --system daemon-reload
%endif
/sbin/service matahari-network condrestart
@@ -243,7 +249,7 @@ systemctl --system daemon-reload
%preun network
if [ $1 = 0 ]; then
/sbin/service matahari-network stop >/dev/null 2>&1 || :
-%if %{undefined _unitdir}
+%if !%{systemd}
chkconfig --del matahari-network
%endif
fi
@@ -256,7 +262,7 @@ fi
#== Services
%post service
-%if %{defined _unitdir}
+%if %{systemd}
systemctl --system daemon-reload
%endif
/sbin/service matahari-service condrestart
@@ -264,7 +270,7 @@ systemctl --system daemon-reload
%preun service
if [ $1 = 0 ]; then
/sbin/service matahari-service stop >/dev/null 2>&1 || :
-%if %{undefined _unitdir}
+%if !%{systemd}
chkconfig --del matahari-service
%endif
fi
@@ -277,7 +283,7 @@ fi
#== sysconfig
%post sysconfig
-%if %{defined _unitdir}
+%if %{systemd}
systemctl --system daemon-reload
%endif
/sbin/service matahari-sysconfig condrestart
@@ -285,7 +291,7 @@ systemctl --system daemon-reload
%preun sysconfig
if [ $1 = 0 ]; then
/sbin/service matahari-sysconfig stop >/dev/null 2>&1 || :
-%if %{undefined _unitdir}
+%if !%{systemd}
chkconfig --del matahari-sysconfig
%endif
fi
@@ -298,7 +304,7 @@ fi
#== Broker
%post broker
-%if %{defined _unitdir}
+%if %{systemd}
systemctl --system daemon-reload
%endif
/sbin/service matahari-broker condrestart
@@ -306,7 +312,7 @@ systemctl --system daemon-reload
%preun broker
if [ $1 = 0 ]; then
/sbin/service matahari-broker stop >/dev/null 2>&1 || :
-%if %{undefined _unitdir}
+%if !%{systemd}
chkconfig --del matahari-broker
%endif
fi
@@ -365,12 +371,12 @@ test "x%{buildroot}" != "x" && rm -rf %{buildroot}
%defattr(644, root, root, 755)
%doc AUTHORS COPYING
-%if %{defined _unitdir}
+%if %{systemd}
%{_unitdir}/matahari-network.service
%endif
%if %{with qmf}
-%if %{undefined _unitdir}
+%if !%{systemd}
%attr(755, root, root) %{_initddir}/matahari-network
%endif
%attr(755, root, root) %{_sbindir}/matahari-qmf-networkd
@@ -389,12 +395,12 @@ test "x%{buildroot}" != "x" && rm -rf %{buildroot}
%defattr(644, root, root, 755)
%doc AUTHORS COPYING
-%if %{defined _unitdir}
+%if %{systemd}
%{_unitdir}/matahari-host.service
%endif
%if %{with qmf}
-%if %{undefined _unitdir}
+%if !%{systemd}
%attr(755, root, root) %{_initddir}/matahari-host
%endif
%attr(755, root, root) %{_sbindir}/matahari-qmf-hostd
@@ -413,12 +419,12 @@ test "x%{buildroot}" != "x" && rm -rf %{buildroot}
%defattr(644, root, root, 755)
%doc AUTHORS COPYING
-%if %{defined _unitdir}
+%if %{systemd}
%{_unitdir}/matahari-service.service
%endif
%if %{with qmf}
-%if %{undefined _unitdir}
+%if !%{systemd}
%attr(755, root, root) %{_initddir}/matahari-service
%endif
%attr(755, root, root) %{_sbindir}/matahari-qmf-serviced
@@ -438,12 +444,12 @@ test "x%{buildroot}" != "x" && rm -rf %{buildroot}
%defattr(644, root, root, 755)
%doc AUTHORS COPYING
-%if %{defined _unitdir}
+%if %{systemd}
%{_unitdir}/matahari-sysconfig.service
%endif
%if %{with qmf}
-%if %{undefined _unitdir}
+%if !%{systemd}
%attr(755, root, root) %{_initddir}/matahari-sysconfig
%endif
%attr(755, root, root) %{_sbindir}/matahari-qmf-sysconfigd
@@ -455,7 +461,7 @@ test "x%{buildroot}" != "x" && rm -rf %{buildroot}
%doc AUTHORS COPYING
%if %{with qmf}
-%if %{undefined _unitdir}
+%if !%{systemd}
%attr(755, root, root) %{_initddir}/matahari-sysconfig-console
%endif
%attr(755, root, root) %{_sbindir}/matahari-qmf-sysconfig-consoled
@@ -463,7 +469,7 @@ test "x%{buildroot}" != "x" && rm -rf %{buildroot}
%attr(755, root, root) %{_sbindir}/matahari-qmf-service-cli
%{_mandir}/man8/matahari-qmf-service-cli.8*
-%if %{defined _unitdir}
+%if %{systemd}
%{_unitdir}/matahari-sysconfig-console.service
%endif
%endif
@@ -471,7 +477,7 @@ test "x%{buildroot}" != "x" && rm -rf %{buildroot}
%if %{with qmf}
%files broker
%defattr(644, root, root, 755)
-%if %{undefined _unitdir}
+%if !%{systemd}
%attr(755, root, root) %{_initddir}/matahari-broker
%endif
%config(noreplace) %{_sysconfdir}/sysconfig/matahari-broker
@@ -480,7 +486,7 @@ test "x%{buildroot}" != "x" && rm -rf %{buildroot}
%{_mandir}/man8/matahari-brokerd.8*
%doc AUTHORS COPYING
-%if %{defined _unitdir}
+%if %{systemd}
%{_unitdir}/matahari-broker.service
%else
%ghost %dir %attr(0775, root, qpidd) %{_localstatedir}/run/%{name}
--
1.7.6.2
12 years, 7 months