Signed-off-by: Zane Bitter <zbitter(a)redhat.com>
---
.gitignore | 22 ++----
99-matahari-guest-agent.rules | 2 -
CMakeLists.txt | 63 ----------------
matahari-broker.conf.in | 25 ------
matahari-broker.init.in | 120 ------------------------------
matahari-broker.service.in | 23 ------
matahari-broker.sysconf.in | 21 -----
matahari-vios-proxy-guest.init.in | 96 ------------------------
matahari-vios-proxy-guest.service.in | 12 ---
matahari-vios-proxy-host.init.in | 96 ------------------------
matahari-vios-proxy-host.service.in | 21 -----
matahari-vios-proxy.sysconf.in | 7 --
matahari.init.in | 117 -----------------------------
matahari.service.in | 18 -----
matahari.sysconf.in | 24 ------
src/broker/CMakeLists.txt | 15 ++++
src/cmake/modules/MatahariMacros.cmake | 4 +
src/unittests/.gitignore | 3 +
sys/.gitignore | 5 +
sys/CMakeLists.txt | 71 ++++++++++++++++++
sys/matahari-broker.conf.in | 25 ++++++
sys/matahari-broker.init.in | 120 ++++++++++++++++++++++++++++++
sys/matahari-broker.service.in | 23 ++++++
sys/matahari-broker.sysconf.in | 21 +++++
sys/matahari-guest-agent.rules | 2 +
sys/matahari-vios-proxy-guest.init.in | 96 ++++++++++++++++++++++++
sys/matahari-vios-proxy-guest.service.in | 12 +++
sys/matahari-vios-proxy-host.init.in | 96 ++++++++++++++++++++++++
sys/matahari-vios-proxy-host.service.in | 21 +++++
sys/matahari-vios-proxy.sysconf.in | 7 ++
sys/matahari.init.in | 117 +++++++++++++++++++++++++++++
sys/matahari.service.in | 18 +++++
sys/matahari.sysconf.in | 24 ++++++
33 files changed, 686 insertions(+), 661 deletions(-)
delete mode 100644 99-matahari-guest-agent.rules
delete mode 100644 matahari-broker.conf.in
delete mode 100755 matahari-broker.init.in
delete mode 100644 matahari-broker.service.in
delete mode 100644 matahari-broker.sysconf.in
delete mode 100644 matahari-vios-proxy-guest.init.in
delete mode 100644 matahari-vios-proxy-guest.service.in
delete mode 100644 matahari-vios-proxy-host.init.in
delete mode 100644 matahari-vios-proxy-host.service.in
delete mode 100644 matahari-vios-proxy.sysconf.in
delete mode 100644 matahari.init.in
delete mode 100644 matahari.service.in
delete mode 100644 matahari.sysconf.in
create mode 100644 sys/.gitignore
create mode 100644 sys/CMakeLists.txt
create mode 100644 sys/matahari-broker.conf.in
create mode 100755 sys/matahari-broker.init.in
create mode 100644 sys/matahari-broker.service.in
create mode 100644 sys/matahari-broker.sysconf.in
create mode 100644 sys/matahari-guest-agent.rules
create mode 100644 sys/matahari-vios-proxy-guest.init.in
create mode 100644 sys/matahari-vios-proxy-guest.service.in
create mode 100644 sys/matahari-vios-proxy-host.init.in
create mode 100644 sys/matahari-vios-proxy-host.service.in
create mode 100644 sys/matahari-vios-proxy.sysconf.in
create mode 100644 sys/matahari.init.in
create mode 100644 sys/matahari.service.in
create mode 100644 sys/matahari.sysconf.in
diff --git a/.gitignore b/.gitignore
index 4ba3e43..33b2db7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,3 @@
-*.patch
-*.orig
-*.rej
-*.rpm
-*~
*.cmake
Makefile
build.counter
@@ -11,19 +6,16 @@ matahari*.tgz
matahari-matahari-*
CMakeFiles
CMakeCache.txt
+install_manifest.txt
mock
-matahari.init
-matahari.sysconf
-matahari-brokerd
-matahari-broker
-matahari-broker.conf
-matahari-broker.sysconf
-matahari-broker.service
*.build
*.check
+*.spec
*.spec.sed
+*~
+*.patch
+*.orig
+*.rej
+*.rpm
tags
TAGS
-install_manifest.txt
-matahari.spec
-mingw32-matahari.spec
diff --git a/99-matahari-guest-agent.rules b/99-matahari-guest-agent.rules
deleted file mode 100644
index 8cfacee..0000000
--- a/99-matahari-guest-agent.rules
+++ /dev/null
@@ -1,2 +0,0 @@
-SUBSYSTEM=="virtio-ports",
ATTR{name}}=="org.matahariproject.vios_proxy.0", \
- TAG+="systemd"
ENV{SYSTEMD_WANTS}="matahari-vios-proxy-guest.service"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 077687d..256ceba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,12 +41,6 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Matahari QMF Agent")
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "matahari-${CPACK_PACKAGE_VERSION}")
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari.sysconf.in
- ${CMAKE_CURRENT_BINARY_DIR}/matahari.sysconf)
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-broker.conf.in
- ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.conf)
-
if(WIN32)
set (CPACK_GENERATOR "NSIS")
@@ -114,62 +108,7 @@ else(WIN32)
set (CPACK_GENERATOR "TGZ")
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari.init.in
- ${CMAKE_CURRENT_BINARY_DIR}/matahari.init)
-
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-broker.init.in
- ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker @ONLY)
-
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-broker.sysconf.in
- ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.sysconf @ONLY)
-
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-vios-proxy-host.init.in
- ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-host.init @ONLY)
-
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-vios-proxy-guest.init.in
- ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-guest.init @ONLY)
-
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-vios-proxy.sysconf.in
- ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy.sysconf @ONLY)
-
- install(DIRECTORY DESTINATION ${localstatedir}/lib/matahari
- DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_WRITE GROUP_EXECUTE)
-
-
- install(CODE "execute_process(COMMAND chown root:qpidd
${localstatedir}/lib/matahari)")
-
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker DESTINATION ${initdir})
-
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari.sysconf DESTINATION
${sysconfdir}/sysconfig RENAME matahari)
-
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.sysconf DESTINATION
${sysconfdir}/sysconfig RENAME matahari-broker)
-
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.conf DESTINATION
${sysconfdir})
-
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy.sysconf DESTINATION
${sysconfdir}/sysconfig RENAME matahari-vios-proxy)
-
- # Check for systemd
- include(FindPkgConfig)
- pkg_check_modules(systemd systemd)
-
- if(systemd_FOUND)
- set(systemdunitdir "/lib/systemd/system")
-
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-broker.service.in
- ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.service)
-
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-vios-proxy-host.service.in
- ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-host.service)
-
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-vios-proxy-guest.service.in
- ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-guest.service)
-
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.service DESTINATION
${systemdunitdir})
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-host.service
DESTINATION ${systemdunitdir})
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-guest.service
DESTINATION ${systemdunitdir})
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/99-matahari-guest-agent.rules DESTINATION
${sysconfdir}/udev/rules.d)
- endif(systemd_FOUND)
+ add_subdirectory(sys)
endif(WIN32)
diff --git a/matahari-broker.conf.in b/matahari-broker.conf.in
deleted file mode 100644
index 8aeec38..0000000
--- a/matahari-broker.conf.in
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#
http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# Configuration file for qpidd. Entries are of the form:
-# name=value
-#
-# (Note: no spaces on either side of '='). Using default settings:
-# "qpidd --help" or "man qpidd" for more details.
-cluster-mechanism=ANONYMOUS
-auth=no
diff --git a/matahari-broker.init.in b/matahari-broker.init.in
deleted file mode 100755
index 0f03b44..0000000
--- a/matahari-broker.init.in
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#
http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-# matahari-broker Startup script for the Qpid messaging daemon.
-#
-
-### BEGIN INIT INFO
-# Provides: matahari-broker
-# Required-Start: $local_fs
-# Required-Stop: $local_fs
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Should-Start: matahari-vios-proxy-guest
-# Short-Description: start or stop matahari broker
-# Description: Matahari Broker is an AMQP broker. It receives, stores, routes and
forwards messages using the AMQP protcol.
-### END INIT INFO
-
-# chkconfig: - 85 15
-# description: Matahari Broker is an AMQP broker. It receives, stores, routes and
forwards messages using the AMQP protcol.
-# processname: qpidd
-
-prog="matahari-brokerd --pid-dir @localstatedir@/run/matahari"
-proc=qpidd
-lockfile=@localstatedir@/lock/subsys/matahari-broker
-pidfile=@localstatedir(a)/run/matahari-broker.pid
-
-# Turn off automatic systemd redirects
-#SYSTEMCTL_SKIP_REDIRECT=1
-
-# Source function library.
-. @sysconfdir(a)/rc.d/init.d/functions
-
-if [ -f @sysconfdir@/sysconfig/matahari ]; then
- . @sysconfdir@/sysconfig/matahari
-fi
-if [ -f @sysconfdir@/sysconfig/matahari-broker ]; then
- . @sysconfdir@/sysconfig/matahari-broker
-fi
-
-if [ -f @sysconfdir@/sysconfig/matahari-vios-proxy ]; then
- . @sysconfdir@/sysconfig/matahari-vios-proxy
-fi
-
-RETVAL=0
-
-start() {
- echo -n $"Starting Matahari broker daemon: "
- install -o root -g qpidd -m 775 -d @localstatedir@/run/matahari
- daemon --pidfile $pidfile --check $proc --user qpidd /usr/sbin/$prog $QPIDD_OPTIONS
--daemon
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && touch $lockfile
- if [ $RETVAL = 0 ]; then
- touch $pidfile
- chown qpidd.qpidd $pidfile
- [ -x /sbin/restorecon ] && /sbin/restorecon $pidfile
- runuser -s /bin/sh qpidd -c "/usr/sbin/$prog --check > $pidfile"
- fi
- return $RETVAL
-}
-
-stop() {
- echo -n $"Stopping Matahari broker daemon: "
- killproc -p $pidfile $proc
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && rm -f $lockfile $pidfile
-}
-
-reload() {
- echo 1>&2 $"$0: reload not supported"
- exit 3
-}
-
-restart() {
- stop
- start
-}
-
-# See how we were called.
-case "$1" in
- start)
- status -p $pidfile -l $lockfile $proc >/dev/null || $1
- ;;
- stop|restart|reload)
- $1
- ;;
- status)
- status -p $pidfile -l $lockfile $proc
- RETVAL=$?
- ;;
- force-reload)
- restart
- ;;
- try-restart|condrestart)
- [ -e $lockfile ] && restart || :
- ;;
- *)
- echo 1>&2 $"Usage: $0 {start|stop|restart|condrestart|status}"
- exit 1
-esac
-
-exit $RETVAL
diff --git a/matahari-broker.service.in b/matahari-broker.service.in
deleted file mode 100644
index 5f28f48..0000000
--- a/matahari-broker.service.in
+++ /dev/null
@@ -1,23 +0,0 @@
-[Unit]
-Description=Matahari Broker is an AMQP broker. It receives, stores, routes and forwards
messages using the AMQP protcol.
-After=syslog.target network.target matahari-vios-proxy-guest.service
-Requires=syslog.target network.target
-
-[Install]
-WantedBy=multi-user.target
-
-[Service]
-Type=simple
-NotifyAccess=all
-SysVStartPriority=85
-User=qpidd
-Group=qpidd
-
-EnvironmentFile=-@sysconfdir@/sysconfig/matahari
-EnvironmentFile=-@sysconfdir@/sysconfig/matahari-broker
-EnvironmentFile=-@sysconfdir@/sysconfig/matahari-vios-proxy
-
-ExecStart=/usr/sbin/matahari-brokerd $QPIDD_OPTIONS
-
-# Restart options include: no, on-success, on-failure, on-abort or always
-Restart=on-failure
diff --git a/matahari-broker.sysconf.in b/matahari-broker.sysconf.in
deleted file mode 100644
index cd3d942..0000000
--- a/matahari-broker.sysconf.in
+++ /dev/null
@@ -1,21 +0,0 @@
-# Override the broker port set in @sysconfdir@/sysconfig/matahari
-#MATAHARI_PORT=@MATAHARI_PORT@
-
-QPIDD_OPTIONS="--config @sysconfdir(a)/matahari-broker.conf"
-
-# Federated Broker configuration - list the brokers to federate with
-# The following formats are allowed:
-# Hostname and port
-# <fqdn>:<port>
-# amqp:tcp:<fqdn>:<port>
-# amqp:ssl:<fqdn>:<port>
-# DNS SRV query format ("_matahari._<protocol>" is REQUIRED)
-# _matahari._tcp.<fqdn>
-# _matahari._tls.<fqdn>
-#
-# Note that only the first (highest priority) SRV record returned by the DNS
-# for each given query will be used.
-#
-# Addresses need not all be in the same format.
-#FEDERATED_BROKERS="broker1.example.com:49000, _matahari._tcp.example.com"
-
diff --git a/matahari-vios-proxy-guest.init.in b/matahari-vios-proxy-guest.init.in
deleted file mode 100644
index c85f712..0000000
--- a/matahari-vios-proxy-guest.init.in
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/bin/sh
-
-# the following is chkconfig init header
-# matahari-vios-proxy-guest: Initscript for Matahari specific vios-proxy
-### BEGIN INIT INFO
-# Provides:
-# Required-Start: $local_fs matahari-broker
-# Required-Stop: $local_fs matahari-broker
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Starts and stops vios proxy guest daemon
-# Description: Matahari initscript for Vios Proxy Guest
-### END INIT INFO
-
-# chkconfig: - 99 01
-# description: Matahari initscript for Vios Proxy Guest
-# processname: matahari-vios-proxy-guest
-# pidfile: @localstatedir(a)/run/matahari-vios-proxy-guest.pid
-#
-
-# Turn off automatic systemd redirects
-#SYSTEMCTL_SKIP_REDIRECT=1
-
-# Source function library.
-. @sysconfdir(a)/rc.d/init.d/functions
-
-PROCESS=vios-proxy-guest
-
-RETVAL=0
-
-# Source function library.
-. @sysconfdir(a)/rc.d/init.d/functions
-
-if [ -f @sysconfdir@/sysconfig/matahari-vios-proxy ]; then
- . @sysconfdir@/sysconfig/matahari
-fi
-
-start() {
- echo -n $"Starting the $PROCESS daemon: "
-
- daemon $PROCESS $VP_H_GUEST_DIR $VP_H_SERVICE_DIR
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$PROCESS
-}
-
-stop() {
- echo -n $"Stopping the $PROCESS daemon: "
-
- killproc $PROCESS
- RETVAL=$?
- echo
- if [ $RETVAL -eq 0 ]; then
- rm -f @localstatedir@/lock/subsys/$PROCESS
- rm -f @localstatedir(a)/run/$PROCESS.pid
- fi
-}
-
-restart() {
- stop
- start
-}
-
-reload() {
- echo -n $"Reloading the $PROCESS configuration: "
-
- killproc $PROCESS -HUP
- RETVAL=$?
- echo
- return $RETVAL
-}
-
-# See how we were called.
-case "$1" in
- start)
- status $PROCESS >/dev/null || $1
- ;;
- stop|restart|reload)
- $1
- ;;
- status)
- status $PROCESS
- RETVAL=$?
- ;;
- force-reload)
- reload
- ;;
- condrestart|try-restart)
- [ -f @localstatedir@/lock/subsys/$PROCESS ] && restart || :
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
- exit 1
- ;;
-esac
-exit $RETVAL
diff --git a/matahari-vios-proxy-guest.service.in b/matahari-vios-proxy-guest.service.in
deleted file mode 100644
index b1ec32d..0000000
--- a/matahari-vios-proxy-guest.service.in
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Matahari Vios Proxy Guest
-BindTo=dev-virtio\x2dports-org.matahariproject.vios_proxy.0.device
-After=dev-virtio\x2dports-org.matahariproject.vios_proxy.0.device
-
-[Service]
-EnvironmentFile=@sysconfdir@/sysconfig/matahari-vios-proxy
-ExecStart=-/usr/bin/vios-proxy-guest $VP_G_HOST_DIR $VP_G_SERVICE_PORT
-Restart=always
-RestartSec=0
-
-[Install]
diff --git a/matahari-vios-proxy-host.init.in b/matahari-vios-proxy-host.init.in
deleted file mode 100644
index 098b9bd..0000000
--- a/matahari-vios-proxy-host.init.in
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/bin/sh
-
-# the following is chkconfig init header
-# matahari-vios-proxy-host: Initscript for Matahari specific vios-proxy
-### BEGIN INIT INFO
-# Provides:
-# Required-Start: $local_fs matahari-broker
-# Required-Stop: $local_fs matahari-broker
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Starts and stops vios proxy host daemon
-# Description: Matahari initscript for Vios Proxy Host
-### END INIT INFO
-
-# chkconfig: - 99 01
-# description: Matahari initscript for Vios Proxy Host
-# processname: matahari-vios-proxy-host
-# pidfile: @localstatedir(a)/run/matahari-vios-proxy-host.pid
-#
-
-# Turn off automatic systemd redirects
-#SYSTEMCTL_SKIP_REDIRECT=1
-
-# Source function library.
-. @sysconfdir(a)/rc.d/init.d/functions
-
-PROCESS=vios-proxy-host
-
-RETVAL=0
-
-# Source function library.
-. @sysconfdir(a)/rc.d/init.d/functions
-
-if [ -f @sysconfdir@/sysconfig/matahari-vios-proxy ]; then
- . @sysconfdir@/sysconfig/matahari
-fi
-
-start() {
- echo -n $"Starting the $PROCESS daemon: "
-
- daemon $PROCESS $VP_H_GUEST_DIR $VP_H_SERVICE_DIR
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$PROCESS
-}
-
-stop() {
- echo -n $"Stopping the $PROCESS daemon: "
-
- killproc $PROCESS
- RETVAL=$?
- echo
- if [ $RETVAL -eq 0 ]; then
- rm -f @localstatedir@/lock/subsys/$PROCESS
- rm -f @localstatedir(a)/run/$PROCESS.pid
- fi
-}
-
-restart() {
- stop
- start
-}
-
-reload() {
- echo -n $"Reloading the $PROCESS configuration: "
-
- killproc $PROCESS -HUP
- RETVAL=$?
- echo
- return $RETVAL
-}
-
-# See how we were called.
-case "$1" in
- start)
- status $PROCESS >/dev/null || $1
- ;;
- stop|restart|reload)
- $1
- ;;
- status)
- status $PROCESS
- RETVAL=$?
- ;;
- force-reload)
- reload
- ;;
- condrestart|try-restart)
- [ -f @localstatedir@/lock/subsys/$PROCESS ] && restart || :
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
- exit 1
- ;;
-esac
-exit $RETVAL
diff --git a/matahari-vios-proxy-host.service.in b/matahari-vios-proxy-host.service.in
deleted file mode 100644
index aa4a77d..0000000
--- a/matahari-vios-proxy-host.service.in
+++ /dev/null
@@ -1,21 +0,0 @@
-[Unit]
-Description=Matahari specific requirements for a Vios proxy host
-After=syslog.target
-Requires=syslog.target
-
-[Install]
-WantedBy=multi-user.target
-
-[Service]
-Type=simple
-NotifyAccess=all
-SysVStartPriority=85
-User=root
-Group=root
-
-EnvironmentFile=@sysconfdir@/sysconfig/matahari-vios-proxy
-
-ExecStart=/usr/bin/vios-proxy-host $VP_H_GUEST_DIR $VP_H_SERVICE_PORT
-
-# Restart options include: no, on-success, on-failure, on-abort or always
-Restart=on-failure
diff --git a/matahari-vios-proxy.sysconf.in b/matahari-vios-proxy.sysconf.in
deleted file mode 100644
index abe83c0..0000000
--- a/matahari-vios-proxy.sysconf.in
+++ /dev/null
@@ -1,7 +0,0 @@
-# VIOS Proxy Host configuration
-VP_H_GUEST_DIR=/var/lib/libvirt
-VP_H_SERVICE_PORT=49000
-
-# VIOS Proxy Guest configuration
-VP_G_HOST_DIR=/dev/virtio-ports
-VP_G_SERVICE_PORT=48999
diff --git a/matahari.init.in b/matahari.init.in
deleted file mode 100644
index 18bd572..0000000
--- a/matahari.init.in
+++ /dev/null
@@ -1,117 +0,0 @@
-#!/bin/sh
-
-# the following is chkconfig init header
-# matahari-@BASE@@BASE_SUB@: Matahari QMF @BASE@@BASE_SUB@ daemon
-### BEGIN INIT INFO
-# Provides: matahari-@BASE@@BASE_SUB@
-# Required-Start: $local_fs
-# Required-Stop: $local_fs
-# Should-Start: matahari-broker
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Starts and stops the @BASE@@BASE_SUB@ matahari daemon
-# Description: Matahari @BASE@@BASE_SUB@ daemon using the AMQP protocol.
-### END INIT INFO
-
-# chkconfig: - 99 01
-# description: Matahari @BASE@@BASE_SUB@ daemon using the AMQP protocol.
-# processname: matahari-@BASE@@BASE_SUB@d
-# pidfile: @localstatedir@/run/matahari-@BASE@@BASE_SUB@.pid
-#
-
-# Turn off automatic systemd redirects
-#SYSTEMCTL_SKIP_REDIRECT=1
-
-# Source function library.
-. @sysconfdir(a)/rc.d/init.d/functions
-
-SERVICE=matahari-@BASE@@BASE_SUB@
-PROCESS=matahari-qmf-@BASE@@BASE_SUB@d
-# Old process naming convention, this is here
-# for compability sake when starting/stopping the
-# service from an upgrade of 0.4.0 > 0.4.2
-OLDPROCESS=matahari-@BASE@@BASE_SUB@d
-
-RETVAL=0
-
-test -f @sysconfdir@/sysconfig/matahari && . @sysconfdir@/sysconfig/matahari
-
-start() {
- echo -n $"Starting the $SERVICE daemon: "
-
- MATAHARI_ARGS="$MATAHARI_@DAEMON_TYPE@_ARGS $@BASE@_@DAEMON_TYPE@_ARGS"
- if [ -n "$MATAHARI_PORT" ]; then
- MATAHARI_ARGS="--port $MATAHARI_PORT $MATAHARI_ARGS"
- fi
- if [ -n "$MATAHARI_BROKER" ]; then
- MATAHARI_ARGS="--broker $MATAHARI_BROKER $MATAHARI_ARGS"
- fi
-
-
- export QPID_SSL_CERT_DB
- export QPID_SSL_CERT_PASSWORD_FILE
-
- daemon $PROCESS $MATAHARI_ARGS --daemon
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE
-}
-
-stop() {
- echo -n $"Stopping the $SERVICE daemon: "
-
- # Check for OLDPROCESS for pre 0.4.2 compat
- pidofproc $OLDPROCESS >/dev/null
- RETVAL=$?
- if [ $RETVAL -lt 3 ]; then
- killproc $OLDPROCESS
- RETVAL=$?
- else
- killproc $PROCESS
- RETVAL=$?
- fi
- echo
- if [ $RETVAL -eq 0 ]; then
- rm -f @localstatedir@/lock/subsys/$SERVICE
- rm -f @localstatedir(a)/run/$SERVICE.pid
- fi
-}
-
-restart() {
- stop
- start
-}
-
-reload() {
- echo -n $"Reloading the $SERVICE configuration: "
-
- killproc $PROCESS -HUP
- RETVAL=$?
- echo
- return $RETVAL
-}
-
-# See how we were called.
-case "$1" in
- start)
- status $PROCESS >/dev/null || $1
- ;;
- stop|restart|reload)
- $1
- ;;
- status)
- status $PROCESS
- RETVAL=$?
- ;;
- force-reload)
- reload
- ;;
- condrestart|try-restart)
- [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || :
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
- exit 1
- ;;
-esac
-exit $RETVAL
diff --git a/matahari.service.in b/matahari.service.in
deleted file mode 100644
index 2a7a741..0000000
--- a/matahari.service.in
+++ /dev/null
@@ -1,18 +0,0 @@
-[Unit]
-Description=Matahari @BASE@@BASE_SUB@ daemon using the AMQP protocol.
-After=syslog.target network.target matahari-broker.service
-Requires=syslog.target network.target
-
-[Install]
-WantedBy=multi-user.target
-
-[Service]
-Type=simple
-NotifyAccess=main
-SysVStartPriority=99
-
-EnvironmentFile=-@sysconfdir@/sysconfig/matahari
-ExecStart=/usr/sbin/matahari-qmf-@BASE@@BASE_SUB@d $MATAHARI_@DAEMON_TYPE@_ARGS
$@BASE@_@DAEMON_TYPE@_ARGS
-
-# Restart options include: no, on-success, on-failure, on-abort or always
-Restart=on-failure
diff --git a/matahari.sysconf.in b/matahari.sysconf.in
deleted file mode 100644
index e84e0cc..0000000
--- a/matahari.sysconf.in
+++ /dev/null
@@ -1,24 +0,0 @@
-# Connect to a broker on the named host
-# If this is not defined, agents will attempt to connect to the server specified
-# by the _matahari._tcp SRV record in DNS if that exists, otherwise to localhost
-MATAHARI_BROKER=@MATAHARI_BROKER@
-
-# Connect to a broker on a non-standard port
-#MATAHARI_PORT=@MATAHARI_PORT@
-
-# Other options that all agents should observe
-MATAHARI_AGENT_ARGS="--reconnect=yes"
-
-# SSL client options
-#QPID_SSL_CERT_DB=
-#QPID_SSL_CERT_PASSWORD_FILE=
-
-# Other options that all consoles should observe
-#MATAHARI_CONSOLE_ARGS=
-
-# Per agent options
-#host_AGENT_ARGS=
-#network_AGENT_ARGS=
-
-# Per console options
-#sysconfig_CONSOLE_ARGS=
diff --git a/src/broker/CMakeLists.txt b/src/broker/CMakeLists.txt
index d6e4728..07ddbef 100644
--- a/src/broker/CMakeLists.txt
+++ b/src/broker/CMakeLists.txt
@@ -19,6 +19,21 @@ if(NOT WIN32)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${MAN_PAGE}.gz
DESTINATION share/man/man${AGENT_MAN_SECTION})
+ configure_file(${CMAKE_SOURCE_DIR}/sys/matahari-broker.init.in
+ ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.init @ONLY)
+
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.init
+ DESTINATION ${initdir} RENAME matahari-broker)
+
+ pkg_check_modules(systemd systemd)
+
+ if(systemd_FOUND)
+ configure_file(${CMAKE_SOURCE_DIR}/sys/matahari-broker.service.in
+ ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.service)
+
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.service DESTINATION
${systemdunitdir})
+ endif(systemd_FOUND)
+
endif(NOT WIN32)
endif(WITH-QMF)
diff --git a/src/cmake/modules/MatahariMacros.cmake
b/src/cmake/modules/MatahariMacros.cmake
index 232799f..d0b5af4 100644
--- a/src/cmake/modules/MatahariMacros.cmake
+++ b/src/cmake/modules/MatahariMacros.cmake
@@ -121,12 +121,12 @@ endmacro(create_manpage)
macro(create_service_scripts BASE)
if(NOT WIN32)
- configure_file(${CMAKE_SOURCE_DIR}/matahari.init.in
${CMAKE_CURRENT_BINARY_DIR}/matahari-${BASE})
+ configure_file(${CMAKE_SOURCE_DIR}/sys/matahari.init.in
${CMAKE_CURRENT_BINARY_DIR}/matahari-${BASE})
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/matahari-${BASE} DESTINATION
${initdir})
endif(NOT WIN32)
if(systemd_FOUND)
- configure_file(${CMAKE_SOURCE_DIR}/matahari.service.in
${CMAKE_CURRENT_BINARY_DIR}/matahari-${BASE}.service)
+ configure_file(${CMAKE_SOURCE_DIR}/sys/matahari.service.in
${CMAKE_CURRENT_BINARY_DIR}/matahari-${BASE}.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-${BASE}.service DESTINATION
${systemdunitdir})
endif(systemd_FOUND)
endmacro(create_service_scripts)
diff --git a/src/unittests/.gitignore b/src/unittests/.gitignore
index ef1880e..dac5325 100644
--- a/src/unittests/.gitignore
+++ b/src/unittests/.gitignore
@@ -1,2 +1,5 @@
# Note that directives from the parent .gitignore files will be inherited
testhostapis
+libmh_tester.so
+*_unittest.cpp
+*_unittest
diff --git a/sys/.gitignore b/sys/.gitignore
new file mode 100644
index 0000000..29916b3
--- /dev/null
+++ b/sys/.gitignore
@@ -0,0 +1,5 @@
+# Note that directives from the root .gitignore file will be inherited
+*.sysconf
+*.conf
+*.init
+*.service
diff --git a/sys/CMakeLists.txt b/sys/CMakeLists.txt
new file mode 100644
index 0000000..babd6e4
--- /dev/null
+++ b/sys/CMakeLists.txt
@@ -0,0 +1,71 @@
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-broker.conf.in
+ ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.conf @ONLY)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-broker.sysconf.in
+ ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.sysconf @ONLY)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari.sysconf.in
+ ${CMAKE_CURRENT_BINARY_DIR}/matahari.sysconf @ONLY)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-vios-proxy-host.init.in
+ ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-host.init @ONLY)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-vios-proxy-guest.init.in
+ ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-guest.init @ONLY)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-vios-proxy.sysconf.in
+ ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy.sysconf @ONLY)
+
+install(DIRECTORY DESTINATION ${localstatedir}/lib/matahari
+ DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_WRITE GROUP_EXECUTE)
+
+
+install(CODE "execute_process(COMMAND chown root:qpidd
${localstatedir}/lib/matahari)")
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari.sysconf
+ DESTINATION ${sysconfdir}/sysconfig RENAME matahari)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.sysconf
+ DESTINATION ${sysconfdir}/sysconfig RENAME matahari-broker)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.conf
+ DESTINATION ${sysconfdir})
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy.sysconf
+ DESTINATION ${sysconfdir}/sysconfig RENAME matahari-vios-proxy)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-host.init
+ DESTINATION ${initdir} RENAME matahari-vios-proxy-host)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-guest.init
+ DESTINATION ${initdir} RENAME matahari-vios-proxy-guest)
+
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/matahari-guest-agent.rules
+ DESTINATION ${sysconfdir}/udev/rules.d
+ RENAME 99-matahari-guest-agent.rules)
+
+
+# Check for systemd
+include(FindPkgConfig)
+pkg_check_modules(systemd systemd)
+
+if(systemd_FOUND)
+ set(systemdunitdir "/lib/systemd/system")
+
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-vios-proxy-host.service.in
+ ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-host.service)
+
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matahari-vios-proxy-guest.service.in
+ ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-guest.service)
+
+
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-host.service
+ DESTINATION ${systemdunitdir})
+
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-vios-proxy-guest.service
+ DESTINATION ${systemdunitdir})
+
+endif(systemd_FOUND)
+
diff --git a/sys/matahari-broker.conf.in b/sys/matahari-broker.conf.in
new file mode 100644
index 0000000..da050c0
--- /dev/null
+++ b/sys/matahari-broker.conf.in
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# Configuration file for qpidd. Entries are of the form:
+# name=value
+#
+# (Note: no spaces on either side of '='). Using default settings:
+# "qpidd --help" or "man qpidd" for more details.
+cluster-mechanism=ANONYMOUS
+auth=no
diff --git a/sys/matahari-broker.init.in b/sys/matahari-broker.init.in
new file mode 100755
index 0000000..0f03b44
--- /dev/null
+++ b/sys/matahari-broker.init.in
@@ -0,0 +1,120 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#
+# matahari-broker Startup script for the Qpid messaging daemon.
+#
+
+### BEGIN INIT INFO
+# Provides: matahari-broker
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Should-Start: matahari-vios-proxy-guest
+# Short-Description: start or stop matahari broker
+# Description: Matahari Broker is an AMQP broker. It receives, stores, routes and
forwards messages using the AMQP protcol.
+### END INIT INFO
+
+# chkconfig: - 85 15
+# description: Matahari Broker is an AMQP broker. It receives, stores, routes and
forwards messages using the AMQP protcol.
+# processname: qpidd
+
+prog="matahari-brokerd --pid-dir @localstatedir@/run/matahari"
+proc=qpidd
+lockfile=@localstatedir@/lock/subsys/matahari-broker
+pidfile=@localstatedir(a)/run/matahari-broker.pid
+
+# Turn off automatic systemd redirects
+#SYSTEMCTL_SKIP_REDIRECT=1
+
+# Source function library.
+. @sysconfdir(a)/rc.d/init.d/functions
+
+if [ -f @sysconfdir@/sysconfig/matahari ]; then
+ . @sysconfdir@/sysconfig/matahari
+fi
+if [ -f @sysconfdir@/sysconfig/matahari-broker ]; then
+ . @sysconfdir@/sysconfig/matahari-broker
+fi
+
+if [ -f @sysconfdir@/sysconfig/matahari-vios-proxy ]; then
+ . @sysconfdir@/sysconfig/matahari-vios-proxy
+fi
+
+RETVAL=0
+
+start() {
+ echo -n $"Starting Matahari broker daemon: "
+ install -o root -g qpidd -m 775 -d @localstatedir@/run/matahari
+ daemon --pidfile $pidfile --check $proc --user qpidd /usr/sbin/$prog $QPIDD_OPTIONS
--daemon
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch $lockfile
+ if [ $RETVAL = 0 ]; then
+ touch $pidfile
+ chown qpidd.qpidd $pidfile
+ [ -x /sbin/restorecon ] && /sbin/restorecon $pidfile
+ runuser -s /bin/sh qpidd -c "/usr/sbin/$prog --check > $pidfile"
+ fi
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Stopping Matahari broker daemon: "
+ killproc -p $pidfile $proc
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && rm -f $lockfile $pidfile
+}
+
+reload() {
+ echo 1>&2 $"$0: reload not supported"
+ exit 3
+}
+
+restart() {
+ stop
+ start
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ status -p $pidfile -l $lockfile $proc >/dev/null || $1
+ ;;
+ stop|restart|reload)
+ $1
+ ;;
+ status)
+ status -p $pidfile -l $lockfile $proc
+ RETVAL=$?
+ ;;
+ force-reload)
+ restart
+ ;;
+ try-restart|condrestart)
+ [ -e $lockfile ] && restart || :
+ ;;
+ *)
+ echo 1>&2 $"Usage: $0 {start|stop|restart|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/sys/matahari-broker.service.in b/sys/matahari-broker.service.in
new file mode 100644
index 0000000..5f28f48
--- /dev/null
+++ b/sys/matahari-broker.service.in
@@ -0,0 +1,23 @@
+[Unit]
+Description=Matahari Broker is an AMQP broker. It receives, stores, routes and forwards
messages using the AMQP protcol.
+After=syslog.target network.target matahari-vios-proxy-guest.service
+Requires=syslog.target network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=simple
+NotifyAccess=all
+SysVStartPriority=85
+User=qpidd
+Group=qpidd
+
+EnvironmentFile=-@sysconfdir@/sysconfig/matahari
+EnvironmentFile=-@sysconfdir@/sysconfig/matahari-broker
+EnvironmentFile=-@sysconfdir@/sysconfig/matahari-vios-proxy
+
+ExecStart=/usr/sbin/matahari-brokerd $QPIDD_OPTIONS
+
+# Restart options include: no, on-success, on-failure, on-abort or always
+Restart=on-failure
diff --git a/sys/matahari-broker.sysconf.in b/sys/matahari-broker.sysconf.in
new file mode 100644
index 0000000..cd3d942
--- /dev/null
+++ b/sys/matahari-broker.sysconf.in
@@ -0,0 +1,21 @@
+# Override the broker port set in @sysconfdir@/sysconfig/matahari
+#MATAHARI_PORT=@MATAHARI_PORT@
+
+QPIDD_OPTIONS="--config @sysconfdir(a)/matahari-broker.conf"
+
+# Federated Broker configuration - list the brokers to federate with
+# The following formats are allowed:
+# Hostname and port
+# <fqdn>:<port>
+# amqp:tcp:<fqdn>:<port>
+# amqp:ssl:<fqdn>:<port>
+# DNS SRV query format ("_matahari._<protocol>" is REQUIRED)
+# _matahari._tcp.<fqdn>
+# _matahari._tls.<fqdn>
+#
+# Note that only the first (highest priority) SRV record returned by the DNS
+# for each given query will be used.
+#
+# Addresses need not all be in the same format.
+#FEDERATED_BROKERS="broker1.example.com:49000, _matahari._tcp.example.com"
+
diff --git a/sys/matahari-guest-agent.rules b/sys/matahari-guest-agent.rules
new file mode 100644
index 0000000..8cfacee
--- /dev/null
+++ b/sys/matahari-guest-agent.rules
@@ -0,0 +1,2 @@
+SUBSYSTEM=="virtio-ports",
ATTR{name}}=="org.matahariproject.vios_proxy.0", \
+ TAG+="systemd"
ENV{SYSTEMD_WANTS}="matahari-vios-proxy-guest.service"
diff --git a/sys/matahari-vios-proxy-guest.init.in
b/sys/matahari-vios-proxy-guest.init.in
new file mode 100644
index 0000000..c85f712
--- /dev/null
+++ b/sys/matahari-vios-proxy-guest.init.in
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+# the following is chkconfig init header
+# matahari-vios-proxy-guest: Initscript for Matahari specific vios-proxy
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $local_fs matahari-broker
+# Required-Stop: $local_fs matahari-broker
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Starts and stops vios proxy guest daemon
+# Description: Matahari initscript for Vios Proxy Guest
+### END INIT INFO
+
+# chkconfig: - 99 01
+# description: Matahari initscript for Vios Proxy Guest
+# processname: matahari-vios-proxy-guest
+# pidfile: @localstatedir(a)/run/matahari-vios-proxy-guest.pid
+#
+
+# Turn off automatic systemd redirects
+#SYSTEMCTL_SKIP_REDIRECT=1
+
+# Source function library.
+. @sysconfdir(a)/rc.d/init.d/functions
+
+PROCESS=vios-proxy-guest
+
+RETVAL=0
+
+# Source function library.
+. @sysconfdir(a)/rc.d/init.d/functions
+
+if [ -f @sysconfdir@/sysconfig/matahari-vios-proxy ]; then
+ . @sysconfdir@/sysconfig/matahari
+fi
+
+start() {
+ echo -n $"Starting the $PROCESS daemon: "
+
+ daemon $PROCESS $VP_H_GUEST_DIR $VP_H_SERVICE_DIR
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$PROCESS
+}
+
+stop() {
+ echo -n $"Stopping the $PROCESS daemon: "
+
+ killproc $PROCESS
+ RETVAL=$?
+ echo
+ if [ $RETVAL -eq 0 ]; then
+ rm -f @localstatedir@/lock/subsys/$PROCESS
+ rm -f @localstatedir(a)/run/$PROCESS.pid
+ fi
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ echo -n $"Reloading the $PROCESS configuration: "
+
+ killproc $PROCESS -HUP
+ RETVAL=$?
+ echo
+ return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ status $PROCESS >/dev/null || $1
+ ;;
+ stop|restart|reload)
+ $1
+ ;;
+ status)
+ status $PROCESS
+ RETVAL=$?
+ ;;
+ force-reload)
+ reload
+ ;;
+ condrestart|try-restart)
+ [ -f @localstatedir@/lock/subsys/$PROCESS ] && restart || :
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
+ exit 1
+ ;;
+esac
+exit $RETVAL
diff --git a/sys/matahari-vios-proxy-guest.service.in
b/sys/matahari-vios-proxy-guest.service.in
new file mode 100644
index 0000000..b1ec32d
--- /dev/null
+++ b/sys/matahari-vios-proxy-guest.service.in
@@ -0,0 +1,12 @@
+[Unit]
+Description=Matahari Vios Proxy Guest
+BindTo=dev-virtio\x2dports-org.matahariproject.vios_proxy.0.device
+After=dev-virtio\x2dports-org.matahariproject.vios_proxy.0.device
+
+[Service]
+EnvironmentFile=@sysconfdir@/sysconfig/matahari-vios-proxy
+ExecStart=-/usr/bin/vios-proxy-guest $VP_G_HOST_DIR $VP_G_SERVICE_PORT
+Restart=always
+RestartSec=0
+
+[Install]
diff --git a/sys/matahari-vios-proxy-host.init.in b/sys/matahari-vios-proxy-host.init.in
new file mode 100644
index 0000000..098b9bd
--- /dev/null
+++ b/sys/matahari-vios-proxy-host.init.in
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+# the following is chkconfig init header
+# matahari-vios-proxy-host: Initscript for Matahari specific vios-proxy
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $local_fs matahari-broker
+# Required-Stop: $local_fs matahari-broker
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Starts and stops vios proxy host daemon
+# Description: Matahari initscript for Vios Proxy Host
+### END INIT INFO
+
+# chkconfig: - 99 01
+# description: Matahari initscript for Vios Proxy Host
+# processname: matahari-vios-proxy-host
+# pidfile: @localstatedir(a)/run/matahari-vios-proxy-host.pid
+#
+
+# Turn off automatic systemd redirects
+#SYSTEMCTL_SKIP_REDIRECT=1
+
+# Source function library.
+. @sysconfdir(a)/rc.d/init.d/functions
+
+PROCESS=vios-proxy-host
+
+RETVAL=0
+
+# Source function library.
+. @sysconfdir(a)/rc.d/init.d/functions
+
+if [ -f @sysconfdir@/sysconfig/matahari-vios-proxy ]; then
+ . @sysconfdir@/sysconfig/matahari
+fi
+
+start() {
+ echo -n $"Starting the $PROCESS daemon: "
+
+ daemon $PROCESS $VP_H_GUEST_DIR $VP_H_SERVICE_DIR
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$PROCESS
+}
+
+stop() {
+ echo -n $"Stopping the $PROCESS daemon: "
+
+ killproc $PROCESS
+ RETVAL=$?
+ echo
+ if [ $RETVAL -eq 0 ]; then
+ rm -f @localstatedir@/lock/subsys/$PROCESS
+ rm -f @localstatedir(a)/run/$PROCESS.pid
+ fi
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ echo -n $"Reloading the $PROCESS configuration: "
+
+ killproc $PROCESS -HUP
+ RETVAL=$?
+ echo
+ return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ status $PROCESS >/dev/null || $1
+ ;;
+ stop|restart|reload)
+ $1
+ ;;
+ status)
+ status $PROCESS
+ RETVAL=$?
+ ;;
+ force-reload)
+ reload
+ ;;
+ condrestart|try-restart)
+ [ -f @localstatedir@/lock/subsys/$PROCESS ] && restart || :
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
+ exit 1
+ ;;
+esac
+exit $RETVAL
diff --git a/sys/matahari-vios-proxy-host.service.in
b/sys/matahari-vios-proxy-host.service.in
new file mode 100644
index 0000000..aa4a77d
--- /dev/null
+++ b/sys/matahari-vios-proxy-host.service.in
@@ -0,0 +1,21 @@
+[Unit]
+Description=Matahari specific requirements for a Vios proxy host
+After=syslog.target
+Requires=syslog.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=simple
+NotifyAccess=all
+SysVStartPriority=85
+User=root
+Group=root
+
+EnvironmentFile=@sysconfdir@/sysconfig/matahari-vios-proxy
+
+ExecStart=/usr/bin/vios-proxy-host $VP_H_GUEST_DIR $VP_H_SERVICE_PORT
+
+# Restart options include: no, on-success, on-failure, on-abort or always
+Restart=on-failure
diff --git a/sys/matahari-vios-proxy.sysconf.in b/sys/matahari-vios-proxy.sysconf.in
new file mode 100644
index 0000000..abe83c0
--- /dev/null
+++ b/sys/matahari-vios-proxy.sysconf.in
@@ -0,0 +1,7 @@
+# VIOS Proxy Host configuration
+VP_H_GUEST_DIR=/var/lib/libvirt
+VP_H_SERVICE_PORT=49000
+
+# VIOS Proxy Guest configuration
+VP_G_HOST_DIR=/dev/virtio-ports
+VP_G_SERVICE_PORT=48999
diff --git a/sys/matahari.init.in b/sys/matahari.init.in
new file mode 100644
index 0000000..18bd572
--- /dev/null
+++ b/sys/matahari.init.in
@@ -0,0 +1,117 @@
+#!/bin/sh
+
+# the following is chkconfig init header
+# matahari-@BASE@@BASE_SUB@: Matahari QMF @BASE@@BASE_SUB@ daemon
+### BEGIN INIT INFO
+# Provides: matahari-@BASE@@BASE_SUB@
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Should-Start: matahari-broker
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Starts and stops the @BASE@@BASE_SUB@ matahari daemon
+# Description: Matahari @BASE@@BASE_SUB@ daemon using the AMQP protocol.
+### END INIT INFO
+
+# chkconfig: - 99 01
+# description: Matahari @BASE@@BASE_SUB@ daemon using the AMQP protocol.
+# processname: matahari-@BASE@@BASE_SUB@d
+# pidfile: @localstatedir@/run/matahari-@BASE@@BASE_SUB@.pid
+#
+
+# Turn off automatic systemd redirects
+#SYSTEMCTL_SKIP_REDIRECT=1
+
+# Source function library.
+. @sysconfdir(a)/rc.d/init.d/functions
+
+SERVICE=matahari-@BASE@@BASE_SUB@
+PROCESS=matahari-qmf-@BASE@@BASE_SUB@d
+# Old process naming convention, this is here
+# for compability sake when starting/stopping the
+# service from an upgrade of 0.4.0 > 0.4.2
+OLDPROCESS=matahari-@BASE@@BASE_SUB@d
+
+RETVAL=0
+
+test -f @sysconfdir@/sysconfig/matahari && . @sysconfdir@/sysconfig/matahari
+
+start() {
+ echo -n $"Starting the $SERVICE daemon: "
+
+ MATAHARI_ARGS="$MATAHARI_@DAEMON_TYPE@_ARGS $@BASE@_@DAEMON_TYPE@_ARGS"
+ if [ -n "$MATAHARI_PORT" ]; then
+ MATAHARI_ARGS="--port $MATAHARI_PORT $MATAHARI_ARGS"
+ fi
+ if [ -n "$MATAHARI_BROKER" ]; then
+ MATAHARI_ARGS="--broker $MATAHARI_BROKER $MATAHARI_ARGS"
+ fi
+
+
+ export QPID_SSL_CERT_DB
+ export QPID_SSL_CERT_PASSWORD_FILE
+
+ daemon $PROCESS $MATAHARI_ARGS --daemon
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE
+}
+
+stop() {
+ echo -n $"Stopping the $SERVICE daemon: "
+
+ # Check for OLDPROCESS for pre 0.4.2 compat
+ pidofproc $OLDPROCESS >/dev/null
+ RETVAL=$?
+ if [ $RETVAL -lt 3 ]; then
+ killproc $OLDPROCESS
+ RETVAL=$?
+ else
+ killproc $PROCESS
+ RETVAL=$?
+ fi
+ echo
+ if [ $RETVAL -eq 0 ]; then
+ rm -f @localstatedir@/lock/subsys/$SERVICE
+ rm -f @localstatedir(a)/run/$SERVICE.pid
+ fi
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ echo -n $"Reloading the $SERVICE configuration: "
+
+ killproc $PROCESS -HUP
+ RETVAL=$?
+ echo
+ return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ status $PROCESS >/dev/null || $1
+ ;;
+ stop|restart|reload)
+ $1
+ ;;
+ status)
+ status $PROCESS
+ RETVAL=$?
+ ;;
+ force-reload)
+ reload
+ ;;
+ condrestart|try-restart)
+ [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || :
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
+ exit 1
+ ;;
+esac
+exit $RETVAL
diff --git a/sys/matahari.service.in b/sys/matahari.service.in
new file mode 100644
index 0000000..2a7a741
--- /dev/null
+++ b/sys/matahari.service.in
@@ -0,0 +1,18 @@
+[Unit]
+Description=Matahari @BASE@@BASE_SUB@ daemon using the AMQP protocol.
+After=syslog.target network.target matahari-broker.service
+Requires=syslog.target network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=simple
+NotifyAccess=main
+SysVStartPriority=99
+
+EnvironmentFile=-@sysconfdir@/sysconfig/matahari
+ExecStart=/usr/sbin/matahari-qmf-@BASE@@BASE_SUB@d $MATAHARI_@DAEMON_TYPE@_ARGS
$@BASE@_@DAEMON_TYPE@_ARGS
+
+# Restart options include: no, on-success, on-failure, on-abort or always
+Restart=on-failure
diff --git a/sys/matahari.sysconf.in b/sys/matahari.sysconf.in
new file mode 100644
index 0000000..e84e0cc
--- /dev/null
+++ b/sys/matahari.sysconf.in
@@ -0,0 +1,24 @@
+# Connect to a broker on the named host
+# If this is not defined, agents will attempt to connect to the server specified
+# by the _matahari._tcp SRV record in DNS if that exists, otherwise to localhost
+MATAHARI_BROKER=@MATAHARI_BROKER@
+
+# Connect to a broker on a non-standard port
+#MATAHARI_PORT=@MATAHARI_PORT@
+
+# Other options that all agents should observe
+MATAHARI_AGENT_ARGS="--reconnect=yes"
+
+# SSL client options
+#QPID_SSL_CERT_DB=
+#QPID_SSL_CERT_PASSWORD_FILE=
+
+# Other options that all consoles should observe
+#MATAHARI_CONSOLE_ARGS=
+
+# Per agent options
+#host_AGENT_ARGS=
+#network_AGENT_ARGS=
+
+# Per console options
+#sysconfig_CONSOLE_ARGS=