[ovirt-engine/f17] Added systemd service files

Juan Hernandez jhernand at fedoraproject.org
Tue Apr 24 20:20:26 UTC 2012


commit 11baf626c59cfa83812364279dcd6f4e656066ca
Author: Juan Hernandez <juan.hernandez at redhat.com>
Date:   Tue Apr 24 22:09:39 2012 +0200

    Added systemd service files

 ovirt-engine-add-modules.patch                     |  166 +++++
 ...t-engine-add-resteasy-listener-to-restapi.patch |   34 +
 ovirt-engine-add-systemd-service.patch             |  421 +++++++++++
 ovirt-engine-dont-deploy-jboss-modules.patch       |   63 --
 ...-engine-fix-classpath-building-in-scripts.patch |    2 +-
 ovirt-engine-fix-namespaces-for-jboss-7.1.1.patch  |   34 -
 ovirt-engine-makefile-fixes.patch                  |  235 ++++--
 ...e-remove-dependency-on-jboss-interceptors.patch |   48 ++
 ...engine-replace-pubkey2ssh-with-ssh-keygen.patch |   33 -
 ovirt-engine-setup-fixes.patch                     |  773 ++++++++++++++++++++
 ovirt-engine.spec                                  |  187 +++--
 11 files changed, 1712 insertions(+), 284 deletions(-)
---
diff --git a/ovirt-engine-add-modules.patch b/ovirt-engine-add-modules.patch
new file mode 100644
index 0000000..ca02a40
--- /dev/null
+++ b/ovirt-engine-add-modules.patch
@@ -0,0 +1,166 @@
+commit 6d8504a86f3783dddfae3763b23baa4022faea00
+Author: Juan Hernandez <juan.hernandez at redhat.com>
+Date:   Tue Apr 24 19:50:46 2012 +0200
+
+    modules
+
+diff --git a/deployment/modules/com/sun/xml/bind/main/module.xml b/deployment/modules/com/sun/xml/bind/main/module.xml
+new file mode 100644
+index 0000000..22d4fad
+--- /dev/null
++++ b/deployment/modules/com/sun/xml/bind/main/module.xml
+@@ -0,0 +1,39 @@
++<?xml version="1.0" encoding="UTF-8"?>
++
++<!--
++       ~ JBoss, Home of Professional Open Source.
++  ~ Copyright 2011, Red Hat, Inc., and individual contributors
++  ~ as indicated by the @author tags. See the copyright.txt file in the
++  ~ distribution for a full listing of individual contributors.
++  ~
++  ~ This is free software; you can redistribute it and/or modify it
++  ~ under the terms of the GNU Lesser General Public License as
++  ~ published by the Free Software Foundation; either version 2.1 of
++  ~ the License, or (at your option) any later version.
++  ~
++  ~ This software is distributed in the hope that it will be useful,
++  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
++  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++  ~ Lesser General Public License for more details.
++  ~
++  ~ You should have received a copy of the GNU Lesser General Public
++  ~ License along with this software; if not, write to the Free
++  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
++  -->
++
++<module xmlns="urn:jboss:module:1.1" name="com.sun.xml.bind">
++
++    <resources>
++        <resource-root path="jaxb-impl.jar"/>
++        <resource-root path="jaxb-xjc.jar"/>
++        <!-- Insert resources here -->
++    </resources>
++
++    <dependencies>
++        <module name="javax.api" />
++        <module name="javax.xml.bind.api" />
++        <module name="javax.xml.stream.api" />
++    </dependencies>
++</module>
++
+diff --git a/deployment/modules/org/hibernate/validator/main/module.xml b/deployment/modules/org/hibernate/validator/main/module.xml
+new file mode 100644
+index 0000000..69355b0
+--- /dev/null
++++ b/deployment/modules/org/hibernate/validator/main/module.xml
+@@ -0,0 +1,45 @@
++<?xml version="1.0" encoding="UTF-8"?>
++
++<!--
++  ~ JBoss, Home of Professional Open Source.
++  ~ Copyright 2010, Red Hat, Inc., and individual contributors
++  ~ as indicated by the @author tags. See the copyright.txt file in the
++  ~ distribution for a full listing of individual contributors.
++  ~
++  ~ This is free software; you can redistribute it and/or modify it
++  ~ under the terms of the GNU Lesser General Public License as
++  ~ published by the Free Software Foundation; either version 2.1 of
++  ~ the License, or (at your option) any later version.
++  ~
++  ~ This software is distributed in the hope that it will be useful,
++  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
++  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++  ~ Lesser General Public License for more details.
++  ~
++  ~ You should have received a copy of the GNU Lesser General Public
++  ~ License along with this software; if not, write to the Free
++  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
++  -->
++
++<module xmlns="urn:jboss:module:1.1" name="org.hibernate.validator">
++  <resources>
++    <resource-root path="hibernate-validator.jar"/>
++    <resource-root path="jtype.jar"/>
++        <!-- Insert resources here -->
++  </resources>
++
++  <dependencies>
++    <module name="javax.api"/>
++    <module name="javax.persistence.api"/>
++    <module name="javax.validation.api"/>
++    <module name="javax.persistence.api"/>
++    <module name="javax.xml.bind.api"/>
++    <module name="org.jboss.logging"/>
++    <module name="org.jboss.common-core"/>
++    <module name="org.joda.time"/>
++    <module name="org.slf4j"/>
++    <module name="org.apache.xerces" services="import"/>
++    <module name="sun.jdk" services="import"/>
++  </dependencies>
++</module>
+diff --git a/deployment/modules/sun/jdk/main/module.xml b/deployment/modules/sun/jdk/main/module.xml
+deleted file mode 100644
+index 090b542..0000000
+--- a/deployment/modules/sun/jdk/main/module.xml
++++ /dev/null
+@@ -1,58 +0,0 @@
+-<?xml version="1.0" encoding="UTF-8"?>
+-
+-<!--
+-  ~ JBoss, Home of Professional Open Source.
+-  ~ Copyright 2010, Red Hat, Inc., and individual contributors
+-  ~ as indicated by the @author tags. See the copyright.txt file in the
+-  ~ distribution for a full listing of individual contributors.
+-  ~
+-  ~ This is free software; you can redistribute it and/or modify it
+-  ~ under the terms of the GNU Lesser General Public License as
+-  ~ published by the Free Software Foundation; either version 2.1 of
+-  ~ the License, or (at your option) any later version.
+-  ~
+-  ~ This software is distributed in the hope that it will be useful,
+-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+-  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-  ~ Lesser General Public License for more details.
+-  ~
+-  ~ You should have received a copy of the GNU Lesser General Public
+-  ~ License along with this software; if not, write to the Free
+-  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+-  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-  -->
+-<module xmlns="urn:jboss:module:1.1" name="sun.jdk">
+-    <resources>
+-        <!-- currently jboss modules has not way of importing services from
+-        classes.jar so we duplicate them here -->
+-        <resource-root path="service-loader-resources"/>
+-    </resources>
+-    <dependencies>
+-        <system export="true">
+-            <paths>
+-                <path name="com/sun/script/javascript"/>
+-                <path name="com/sun/jndi/dns"/>
+-                <path name="com/sun/jndi/url"/>
+-                <path name="com/sun/jndi/url/dns"/>
+-                <path name="com/sun/jndi/ldap"/>
+-                <path name="com/sun/security/auth"/>
+-                <path name="com/sun/security/auth/login"/>
+-                <path name="com/sun/security/auth/module"/>
+-                <path name="sun/misc"/>
+-                <path name="sun/security"/>
+-                <path name="sun/security/krb5"/>
+-                <path name="sun/nio"/>
+-                <path name="sun/nio/ch"/>
+-                <path name="sun/util"/>
+-                <path name="sun/util/calendar"/>
+-                <path name="sun/security/provider"/>
+-                <path name="META-INF/services"/>
+-            </paths>
+-            <exports>
+-                <include-set>
+-                    <path name="META-INF/services"/>
+-                </include-set>
+-            </exports>
+-        </system>
+-    </dependencies>
+-</module>
diff --git a/ovirt-engine-add-resteasy-listener-to-restapi.patch b/ovirt-engine-add-resteasy-listener-to-restapi.patch
new file mode 100644
index 0000000..2bcabcc
--- /dev/null
+++ b/ovirt-engine-add-resteasy-listener-to-restapi.patch
@@ -0,0 +1,34 @@
+diff --git a/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml b/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml
+index 3f77945..5ed3ceb 100644
+--- a/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml
++++ b/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml
+@@ -6,6 +6,29 @@
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+   version="3.0">
+ 
++  <listener>
++    <listener-class>
++      org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
++    </listener-class>
++  </listener>
++
++  <servlet>
++    <servlet-name>Resteasy</servlet-name>
++    <servlet-class>
++      org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
++    </servlet-class>
++    <init-param>
++      <param-name>javax.ws.rs.Application</param-name>
++      <param-value>org.ovirt.engine.api.restapi.BackendApplication</param-value>
++    </init-param>
++  </servlet>
++
++  <servlet-mapping>
++    <servlet-name>Resteasy</servlet-name>
++    <url-pattern>/*</url-pattern>
++  </servlet-mapping>
++
++
+    <!-- <security-constraint>
+       <web-resource-collection>
+         <web-resource-name>Protected Context</web-resource-name>
diff --git a/ovirt-engine-add-systemd-service.patch b/ovirt-engine-add-systemd-service.patch
new file mode 100644
index 0000000..2765377
--- /dev/null
+++ b/ovirt-engine-add-systemd-service.patch
@@ -0,0 +1,421 @@
+commit 5d5282f63c2284453e8a6ab254359eb6ad97c788
+Author: Juan Hernandez <juan.hernandez at redhat.com>
+Date:   Wed Apr 18 16:39:13 2012 +0200
+
+    add-fedora-service
+
+diff --git a/packaging/fedora/ovirt-engine-logging.properties b/packaging/fedora/ovirt-engine-logging.properties
+new file mode 100644
+index 0000000..49a22bf
+--- /dev/null
++++ b/packaging/fedora/ovirt-engine-logging.properties
+@@ -0,0 +1,23 @@
++# Additional logger names to configure (root logger is always configured)
++loggers=org.jboss.as.config
++
++# Dump system environment at boot by default
++logger.org.jboss.as.config.level=DEBUG
++
++# Root logger level
++logger.level=INFO
++# Root logger handlers
++logger.handlers=FILE
++
++# File handler configuration
++handler.FILE=org.jboss.logmanager.handlers.FileHandler
++handler.FILE.level=DEBUG
++handler.FILE.properties=autoFlush,fileName
++handler.FILE.autoFlush=true
++handler.FILE.fileName=/var/log/ovirt-engine/boot.log
++handler.FILE.formatter=PATTERN
++
++# Formatter pattern configuration
++formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter
++formatter.PATTERN.properties=pattern
++formatter.PATTERN.pattern=%d{HH:mm:ss,SSS} %-5p [%c] %s%E%n
+diff --git a/packaging/fedora/ovirt-engine-users.properties b/packaging/fedora/ovirt-engine-users.properties
+new file mode 100644
+index 0000000..d0807d7
+--- /dev/null
++++ b/packaging/fedora/ovirt-engine-users.properties
+@@ -0,0 +1,22 @@
++#
++# Properties declaration of users for the realm 'ManagementRealm' which is the default realm
++# for new AS 7.1 installations. Further authentication mechanism can be configured
++# as part of the <management /> in standalone.xml.
++#
++# Users can be added to this properties file at any time, updates after the server has started
++# will be automatically detected.
++#
++# By default the properties realm expects the entries to be in the format: -
++# username=HEX( MD5( username ':' realm ':' password))
++#
++# A utility script is provided which can be executed from the bin folder to add the users: -
++# - Linux
++#  bin/add-user.sh
++#
++# - Windows
++#  bin\add-user.bat
++
++# The following illustrates how an admin user could be defined, this
++# is for illustration only and does not correspond to a usable password.
++#
++#admin=2a0923285184943425d1f53ddd58ec7a
+diff --git a/packaging/fedora/ovirt-engine.service b/packaging/fedora/ovirt-engine.service
+new file mode 100644
+index 0000000..53d988f
+--- /dev/null
++++ b/packaging/fedora/ovirt-engine.service
+@@ -0,0 +1,11 @@
++[Unit]
++Description=oVirt Engine
++After=network.service
++
++[Service]
++EnvironmentFile=/etc/sysconfig/ovirt-engine
++ExecStart=/usr/share/ovirt-engine/bin/ovirt-engine.sh
++User=ovirt
++
++[Install]
++WantedBy=multi-user.target
+diff --git a/packaging/fedora/ovirt-engine.sh b/packaging/fedora/ovirt-engine.sh
+new file mode 100755
+index 0000000..b4567a5
+--- /dev/null
++++ b/packaging/fedora/ovirt-engine.sh
+@@ -0,0 +1,53 @@
++#!/bin/sh
++
++# Base directories for the engine and for the application server:
++JBOSS_BASE=${JBOSS_BASE:-/usr/share/jboss-as}
++ENGINE_BASE=${ENGINE_BASE:-/usr/share/ovirt-engine}
++
++# Defaults for the heap size:
++ENGINE_MIN_HEAP=${ENGINE_HEAP_MIN:-1g}
++ENGINE_MAX_HEAP=${ENGINE_HEAP_MIN:-1g}
++
++# Module path should include first the engine modules so that they can override
++# those provided by the application server if needed:
++ENGINE_MODULEPATH=${ENGINE_MODULEPATH:-${ENGINE_BASE}/modules:${JBOSS_BASE}/modules}
++
++# Virtual machine options:
++OPTIONS="-server"
++OPTIONS="${OPTIONS} -XX:+UseCompressedOops"
++OPTIONS="${OPTIONS} -XX:+TieredCompilation"
++OPTIONS="${OPTIONS} -Xms${ENGINE_MIN_HEAP}"
++OPTIONS="${OPTIONS} -Xms${ENGINE_MAX_HEAP}"
++OPTIONS="${OPTIONS} -XX:MaxPermSize=256m"
++OPTIONS="${OPTIONS} -Djava.net.preferIPv4Stack=true"
++OPTIONS="${OPTIONS} -Dsun.rmi.dgc.client.gcInterval=3600000"
++OPTIONS="${OPTIONS} -Dsun.rmi.dgc.server.gcInterval=3600000"
++OPTIONS="${OPTIONS} -Djava.awt.headless=true"
++
++# Application server options:
++OPTIONS="${OPTIONS} -Dlogging.configuration=file:///etc/ovirt-engine/ovirt-engine-logging.properties"
++OPTIONS="${OPTIONS} -Dorg.jboss.resolver.warning=true"
++OPTIONS="${OPTIONS} -Djboss.modules.system.pkgs=org.jboss.byteman"
++OPTIONS="${OPTIONS} -Djboss.server.default.config=ovirt-engine.xml"
++OPTIONS="${OPTIONS} -Djboss.home.dir=${JBOSS_BASE}"
++OPTIONS="${OPTIONS} -Djboss.server.base.dir=${ENGINE_BASE}"
++OPTIONS="${OPTIONS} -Djboss.server.config.dir=/etc/ovirt-engine"
++OPTIONS="${OPTIONS} -Djboss.server.data.dir=/var/lib/ovirt-engine"
++OPTIONS="${OPTIONS} -Djboss.server.log.dir=/var/log/ovirt-engine"
++OPTIONS="${OPTIONS} -Djboss.server.temp.dir=/var/cache/ovirt-engine"
++OPTIONS="${OPTIONS} -Djboss.controller.temp.dir=/var/cache/ovirt-engine"
++
++# Remove and recreate deployment markers:
++/bin/rm -f ${ENGINE_BASE}/deployments/engine.ear.*
++/bin/touch ${ENGINE_BASE}/deployments/engine.ear.dodeploy
++/bin/rm -f ${ENGINE_BASE}/deployments/ROOT.war.*
++/bin/touch ${ENGINE_BASE}/deployments/ROOT.war.dodeploy
++
++# Start the java virtual machine:
++exec /bin/java \
++  ${OPTIONS} \
++  -jar ${JBOSS_BASE}/jboss-modules.jar \
++  -mp ${ENGINE_MODULEPATH} \
++  -jaxpmodule javax.xml.jaxp-provider \
++  org.jboss.as.standalone \
++  -c ovirt-engine.xml
+diff --git a/packaging/fedora/ovirt-engine.sysconfig b/packaging/fedora/ovirt-engine.sysconfig
+new file mode 100644
+index 0000000..fe0565e
+--- /dev/null
++++ b/packaging/fedora/ovirt-engine.sysconfig
+@@ -0,0 +1,5 @@
++# These variables control the amount of memory used by the java virtual machine
++# where the engine runs:
++#
++#ENGINE_MIN_HEAP=1g
++#ENGINE_MAX_HEAP=1g
+diff --git a/packaging/fedora/ovirt-engine.xml b/packaging/fedora/ovirt-engine.xml
+new file mode 100644
+index 0000000..2a9b8c8
+--- /dev/null
++++ b/packaging/fedora/ovirt-engine.xml
+@@ -0,0 +1,265 @@
++<?xml version="1.0" ?>
++
++<server xmlns="urn:jboss:domain:1.1">
++
++  <extensions>
++    <extension module="org.jboss.as.connector"/>
++    <extension module="org.jboss.as.deployment-scanner"/>
++    <extension module="org.jboss.as.ee"/>
++    <extension module="org.jboss.as.ejb3"/>
++    <extension module="org.jboss.as.jmx"/>
++    <extension module="org.jboss.as.jpa"/>
++    <extension module="org.jboss.as.logging"/>
++    <extension module="org.jboss.as.naming"/>
++    <extension module="org.jboss.as.remoting"/>
++    <extension module="org.jboss.as.security"/>
++    <extension module="org.jboss.as.threads"/>
++    <extension module="org.jboss.as.transactions"/>
++    <extension module="org.jboss.as.web"/>
++  </extensions>
++
++  <management>
++    <security-realms>
++      <security-realm name="ManagementRealm">
++        <authentication>
++          <properties path="/etc/ovirt-engine/ovirt-engine-users.properties"/>
++        </authentication>
++      </security-realm>
++    </security-realms>
++    <management-interfaces>
++      <native-interface security-realm="ManagementRealm">
++        <socket-binding native="management-native"/>
++      </native-interface>
++      <http-interface security-realm="ManagementRealm" console-enabled="false">
++        <socket-binding http="management-http"/>
++      </http-interface>
++    </management-interfaces>
++  </management>
++
++  <profile>
++    <subsystem xmlns="urn:jboss:domain:logging:1.1">
++      <periodic-rotating-file-handler name="FILE" autoflush="true">
++        <level name="INFO"/>
++        <formatter>
++          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
++        </formatter>
++        <file path="/var/log/ovirt-engine/server.log"/>
++        <suffix value=".yyyy-MM-dd"/>
++      </periodic-rotating-file-handler>
++      <size-rotating-file-handler name="ENGINE" autoflush="true">
++        <level name="INFO"/>
++        <formatter>
++          <pattern-formatter pattern="%d %-5p [%c] (%t) %s%E%n"/>
++        </formatter>
++        <file path="/var/log/ovirt-engine/engine.log"/>
++        <rotate-size value="1M"/>
++        <max-backup-index value="30"/>
++        <append value="true"/>
++      </size-rotating-file-handler>
++      <logger category="com.arjuna">
++        <level name="WARN"/>
++      </logger>
++      <logger category="org.apache.tomcat.util.modeler">
++        <level name="WARN"/>
++      </logger>
++      <logger category="sun.rmi">
++        <level name="WARN"/>
++      </logger>
++      <logger category="org.ovirt">
++        <level name="INFO"/>
++        <handlers>
++          <handler name="ENGINE"/>
++        </handlers>
++      </logger>
++      <logger category="org.ovirt.engine.core.bll">
++        <level name="INFO"/>
++      </logger>
++      <logger category="org.ovirt.engine.core.dal.dbbroker.PostgresDbEngineDialect$PostgresJdbcTemplate">
++        <level name="WARN"/>
++      </logger>
++      <logger category="org.springframework.ldap">
++        <level name="ERROR"/>
++      </logger>
++      <root-logger>
++        <level name="INFO"/>
++        <handlers>
++          <handler name="FILE"/>
++        </handlers>
++      </root-logger>
++    </subsystem>
++    <subsystem xmlns="urn:jboss:domain:datasources:1.0">
++      <datasources>
++        <datasource jndi-name="java:/ENGINEDataSource" pool-name="ENGINEDataSource" enabled="true">
++          <connection-url>jdbc:postgresql://localhost:5432/engine</connection-url>
++          <driver>postgresql</driver>
++          <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
++          <pool>
++            <min-pool-size>1</min-pool-size>
++            <max-pool-size>100</max-pool-size>
++            <prefill>true</prefill>
++          </pool>
++          <security>
++            <user-name>engine</user-name>
++            <security-domain>EncryptDBPassword</security-domain>
++          </security>
++          <statement>
++            <prepared-statement-cache-size>100</prepared-statement-cache-size>
++          </statement>
++        </datasource>
++        <drivers>
++          <driver name="postgresql" module="org.postgresql">
++            <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
++          </driver>
++        </drivers>
++      </datasources>
++    </subsystem>
++    <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
++      <deployment-scanner path="/usr/share/ovirt-engine/deployments" scan-enabled="true" scan-interval="5000" auto-deploy-zipped="false" deployment-timeout="60"/>
++    </subsystem>
++    <subsystem xmlns="urn:jboss:domain:ee:1.0"/>
++    <subsystem xmlns="urn:jboss:domain:ejb3:1.2">
++      <session-bean>
++        <stateless>
++          <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
++        </stateless>
++        <stateful default-access-timeout="300000" cache-ref="simple"/>
++        <singleton default-access-timeout="300000"/>
++      </session-bean>
++      <mdb>
++        <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
++        <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
++      </mdb>
++      <pools>
++        <bean-instance-pools>
++          <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
++          <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
++        </bean-instance-pools>
++      </pools>
++      <caches>
++        <cache name="simple" aliases="NoPassivationCache"/>
++      </caches>
++      <async thread-pool-name="default"/>
++      <timer-service thread-pool-name="default">
++        <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>
++      </timer-service>
++      <remote connector-ref="remoting-connector" thread-pool-name="default"/>
++      <thread-pools>
++        <thread-pool name="default">
++          <max-threads count="10"/>
++          <keepalive-time time="100" unit="milliseconds"/>
++        </thread-pool>
++      </thread-pools>
++    </subsystem>
++    <subsystem xmlns="urn:jboss:domain:jca:1.1">
++      <archive-validation enabled="false" fail-on-error="false" fail-on-warn="false"/>
++      <bean-validation enabled="true"/>
++      <default-workmanager>
++        <short-running-threads>
++          <core-threads count="50"/>
++          <queue-length count="50"/>
++          <max-threads count="50"/>
++          <keepalive-time time="10" unit="seconds"/>
++        </short-running-threads>
++        <long-running-threads>
++          <core-threads count="50"/>
++          <queue-length count="50"/>
++          <max-threads count="50"/>
++          <keepalive-time time="10" unit="seconds"/>
++        </long-running-threads>
++      </default-workmanager>
++    </subsystem>
++    <subsystem xmlns="urn:jboss:domain:jmx:1.1">
++      <show-model value="true"/>
++      <remoting-connector/>
++    </subsystem>
++    <subsystem xmlns="urn:jboss:domain:jpa:1.0">
++      <jpa default-datasource=""/>
++    </subsystem>
++    <subsystem xmlns="urn:jboss:domain:naming:1.1"/>
++    <subsystem xmlns="urn:jboss:domain:remoting:1.1">
++      <connector name="remoting-connector" socket-binding="remoting"/>
++    </subsystem>
++    <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"/>
++    <subsystem xmlns="urn:jboss:domain:security:1.1">
++      <security-domains>
++        <security-domain name="other" cache-type="default">
++          <authentication>
++            <login-module code="Remoting" flag="optional">
++              <module-option name="password-stacking" value="useFirstPass"/>
++            </login-module>
++            <login-module code="RealmUsersRoles" flag="required">
++              <module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>
++              <module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>
++              <module-option name="realm" value="ApplicationRealm"/>
++              <module-option name="password-stacking" value="useFirstPass"/>
++            </login-module>
++          </authentication>
++        </security-domain>
++        <security-domain name="jboss-web-policy" cache-type="default">
++          <authorization>
++            <policy-module code="Delegating" flag="required"/>
++          </authorization>
++        </security-domain>
++        <security-domain name="jboss-ejb-policy" cache-type="default">
++          <authorization>
++            <policy-module code="Delegating" flag="required"/>
++          </authorization>
++        </security-domain>
++        <security-domain name="EngineKerberosAuth">
++          <authentication>
++            <login-module code="com.sun.security.auth.module.Krb5LoginModule" flag="required"/>
++          </authentication>
++        </security-domain>
++        <security-domain name="EncryptDBPassword">
++          <authentication>
++            <login-module code="org.picketbox.datasource.security.SecureIdentityLoginModule" flag="required">
++              <module-option name="username" value="engine"/>
++              <module-option name="password" value=""/>
++              <module-option name="managedConnectionFactoryName" value="jboss.jca:name=ENGINEDataSource,service=LocalTxCM"/>
++            </login-module>
++          </authentication>
++        </security-domain>
++      </security-domains>
++    </subsystem>
++    <subsystem xmlns="urn:jboss:domain:transactions:1.1">
++      <core-environment>
++        <process-id>
++          <uuid/>
++        </process-id>
++      </core-environment>
++      <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
++      <coordinator-environment default-timeout="300"/>
++    </subsystem>
++    <subsystem xmlns="urn:jboss:domain:threads:1.1"/>
++    <subsystem xmlns="urn:jboss:domain:web:1.1" native="false" default-virtual-server="default-host">
++      <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
++      <connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" enable-lookups="false" secure="true">
++        <ssl name="ssl" password="mypass" certificate-key-file="/etc/pki/ovirt-engine/.keystore" protocol="TLSv1" verify-client="false"/>
++      </connector>
++      <virtual-server name="default-host" enable-welcome-root="false">
++        <alias name="localhost"/>
++        <alias name="example.com"/>
++      </virtual-server>
++    </subsystem>
++  </profile>
++
++  <interfaces>
++    <interface name="management">
++      <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
++    </interface>
++    <interface name="public">
++      <any-address/>
++    </interface>
++  </interfaces>
++
++  <socket-binding-group name="standard-sockets" default-interface="public">
++    <socket-binding name="http" port="8080"/>
++    <socket-binding name="https" port="8443"/>
++    <socket-binding name="management-native" interface="management" port="9999"/>
++    <socket-binding name="management-http" interface="management" port="9990"/>
++    <socket-binding name="remoting" port="4447"/>
++    <socket-binding name="txn-recovery-environment" port="4712"/>
++    <socket-binding name="txn-status-manager" port="4713"/>
++  </socket-binding-group>
++
++</server>
diff --git a/ovirt-engine-fix-classpath-building-in-scripts.patch b/ovirt-engine-fix-classpath-building-in-scripts.patch
index ba1ae1b..688b01f 100644
--- a/ovirt-engine-fix-classpath-building-in-scripts.patch
+++ b/ovirt-engine-fix-classpath-building-in-scripts.patch
@@ -75,7 +75,7 @@ index 4258d61..73f687e 100755
 +apache-commons-lang \
 +springframework/spring-beans \
 +springframework/spring-core \
-+spring-ldap-core \
++spring-ldap/spring-ldap-core \
 +ovirt-engine/engineencryptutils
 +)
  
diff --git a/ovirt-engine-makefile-fixes.patch b/ovirt-engine-makefile-fixes.patch
index e236a72..6cc1353 100644
--- a/ovirt-engine-makefile-fixes.patch
+++ b/ovirt-engine-makefile-fixes.patch
@@ -1,17 +1,80 @@
+commit ca9001dbc05473cfc99db64945fe8e8fee0dcbf6
+Author: Juan Hernandez <juan.hernandez at redhat.com>
+Date:   Wed Apr 18 22:14:55 2012 +0200
+
+    makefile-fixes
+
 diff --git a/Makefile b/Makefile
-index d02ad06..7ae7db8 100644
+index a1d04b5..9f5c02f 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -44,7 +44,7 @@ test:
- install: build_mvn create_dirs install_ear install_quartz install_tools \
+@@ -9,7 +9,7 @@ MVN=$(shell which mvn)
+ BUILD_FLAGS=-P gwt-admin,gwt-user
+ DEPLOY_FLAGS=-f deploy.xml
+ JBOSS_HOME=/usr/share/jboss-as
+-EAR_DIR=/usr/share/ovirt-engine/engine.ear
++EAR_DIR=/usr/share/ovirt-engine/deployments/engine.ear
+ EAR_SRC_DIR=ear/target/engine
+ PY_SITE_PKGS:=$(shell python -c "from distutils.sysconfig import get_python_lib as f;print f()")
+ APP_VERSION:=$(shell cat pom.xml | grep '<engine.version>' | awk -F\> '{print $$2}' | awk -F\< '{print $$1}')
+@@ -41,10 +41,12 @@ clean:
+ test:
+ 	$(MVN) install $(BUILD_FLAGS)
+ 
+-install: build_mvn create_dirs install_ear install_quartz install_tools \
++install: build_mvn create_dirs install_ear install_tools \
  		install_config install_log_collector install_iso_uploader \
  		install_sysprep install_notification_service install_db_scripts \
 -		install_misc install_setup install_sec
-+		install_misc install_setup install_jboss_modules install_sec
++		install_misc install_setup install_jboss_modules install_sec \
++		install_root_webapp \
++		install_systemd_service
  
  tarball: $(TARBALL)
  $(TARBALL):
-@@ -109,100 +109,137 @@ install_tools:
+@@ -71,7 +73,9 @@ rpm: $(SRPM)
+ 
+ create_dirs:
+ 	@echo "*** Creating Directories"
+-	@mkdir -p $(PREFIX)/usr/share/ovirt-engine/{sysprep,kerberos,scripts,3rd-party-lib,engine.ear,conf,dbscripts,resources,ovirt-isos,iso-uploader,log-collector,db-backups,engine.ear}
++	@mkdir -p $(PREFIX)/usr/share/ovirt-engine/{kerberos,scripts,3rd-party-lib,conf,dbscripts,resources,ovirt-isos,iso-uploader,log-collector,db-backups}
++	@mkdir -p $(PREFIX)/usr/share/ovirt-engine/bin
++	@mkdir -p $(PREFIX)/usr/share/ovirt-engine/deployments
+ 	@mkdir -p $(PREFIX)/usr/share/ovirt-engine/engine-config/lib
+ 	@mkdir -p $(PREFIX)/usr/share/ovirt-engine/notifier/lib
+ 	@mkdir -p $(PREFIX)/usr/share/ovirt-engine/engine-manage-domains/lib
+@@ -86,20 +90,21 @@ create_dirs:
+ 	@mkdir -p $(PREFIX)/var/run/ovirt-engine/notifier
+ 	@mkdir -p $(PREFIX)/var/lock/ovirt-engine
+ 	@mkdir -p $(PREFIX)/etc/{init.d,tmpfiles.d,cron.daily}
+-	@mkdir -p $(PREFIX)/etc/ovirt-engine/{engine-config,engine-manage-domains}
++	@mkdir -p $(PREFIX)/etc/ovirt-engine/{engine-config,engine-manage-domains,sysprep}
+ 	@mkdir -p $(PREFIX)$(EAR_DIR)
+-	@mkdir -p $(PREFIX)$(JBOSS_HOME)/modules/org/postgresql/main/
+-	@mkdir -p $(PREFIX)/usr/share/ovirt-engine/resources/jboss/modules/org
++	@mkdir -p $(PREFIX)/usr/share/ovirt-engine/resources/jboss
+ 	@mkdir -p $(PREFIX)/etc/pki/ovirt-engine/{keys,private,requests,certs}
++	@mkdir -p $(PREFIX)/etc/sysconfig
++	@mkdir -p $(PREFIX)/usr/lib/systemd/system
++	@mkdir -p $(PREFIX)/var/lib/ovirt-engine
++	@mkdir -p $(PREFIX)/var/cache/ovirt-engine
+ 
+ install_ear:
+ 	@echo "*** Deploying EAR to $(PREFIX)"
+-	mkdir -p $(PREFIX)$(EAR_DIR)
+-	cp -rf $(EAR_SRC_DIR)/* $(PREFIX)$(EAR_DIR)
+-
+-install_quartz:
+-	@echo "*** Deploying quartz.jar to $(PREFIX)"
+-#	cp -f ear/target/quartz/quartz*.jar $(PREFIX)$(JBOSS_HOME)/common/lib/
++	install -dm 755 $(PREFIX)$(EAR_DIR)
++	cp -r $(EAR_SRC_DIR)/* $(PREFIX)$(EAR_DIR)
++	find $(PREFIX)$(EAR_DIR) -type d -exec chmod 755 {} \;
++	find $(PREFIX)$(EAR_DIR) -type f -exec chmod 644 {} \;
+ 
+ install_tools:
+ 	@echo "*** Installing Common Tools"
+@@ -109,120 +114,146 @@ install_tools:
  
  install_setup:
  	@echo "*** Deploying setup executables"
@@ -35,22 +98,20 @@ index d02ad06..7ae7db8 100644
 -	chmod 755 $(PREFIX)/etc/ovirt-engine/web-conf.js
 -	cp -f ./packaging/fedora/setup/output_messages.py $(PREFIX)/usr/share/ovirt-engine/scripts
 -	chmod 755 $(PREFIX)/usr/share/ovirt-engine/scripts/output_messages.py
-+	
++
 +	# Configuration files templates for engine-setup:
 +	install -m 644 packaging/fedora/setup/engine-config-install.properties $(PREFIX)/usr/share/ovirt-engine/conf
 +	install -m 644 packaging/fedora/setup/iptables.default $(PREFIX)/usr/share/ovirt-engine/conf
 +	install -m 644 packaging/fedora/setup/nfs.sysconfig $(PREFIX)/usr/share/ovirt-engine/conf
-+	
-+	# Python modules shared by the setup and cleanup tools (they shouldn't
-+	# have execution permissions):
++
++	# Python modules shared by the setup and cleanup tools:
 +	install -m 644 packaging/fedora/setup/basedefs.py $(PREFIX)/usr/share/ovirt-engine/scripts
 +	install -m 644 packaging/fedora/setup/common_utils.py $(PREFIX)/usr/share/ovirt-engine/scripts
 +	install -m 644 packaging/fedora/setup/engine_validators.py $(PREFIX)/usr/share/ovirt-engine/scripts
 +	install -m 644 packaging/fedora/setup/nfsutils.py $(PREFIX)/usr/share/ovirt-engine/scripts
 +	install -m 644 packaging/fedora/setup/output_messages.py $(PREFIX)/usr/share/ovirt-engine/scripts
-+	
-+	# Python main programs for the engine setup and cleanup tools need
-+	# execution permission:
++
++	# Python main programs for the engine setup and cleanup tools:
 +	install -m 755 packaging/fedora/setup/engine-setup.py $(PREFIX)/usr/share/ovirt-engine/scripts
  	ln -s /usr/share/ovirt-engine/scripts/engine-setup.py $(PREFIX)/usr/bin/engine-setup
 -	cp -af ./packaging/fedora/setup/resources/jboss/* $(PREFIX)/usr/share/ovirt-engine/resources/jboss/
@@ -60,32 +121,32 @@ index d02ad06..7ae7db8 100644
 -	chmod 755 $(PREFIX)/usr/share/ovirt-engine/scripts/engine-cleanup.py
 +	install -m 755 packaging/fedora/setup/engine-cleanup.py $(PREFIX)/usr/share/ovirt-engine/scripts
  	ln -s /usr/share/ovirt-engine/scripts/engine-cleanup.py $(PREFIX)/usr/bin/engine-cleanup
-+	
-+	# The configuration file for the main page:	
-+	install -m 644 packaging/fedora/setup/resources/jboss/web-conf.js $(PREFIX)/etc/ovirt-engine
-+	
-+	# Resources used to configure the application server don't need
-+	# execution permission:
-+	cp -r packaging/fedora/setup/resources/jboss/* $(PREFIX)/usr/share/ovirt-engine/resources/jboss/
-+	find $(PREFIX)/usr/share/ovirt-engine/resources/jboss -type d -exec chmod 755 {} \;
-+	find $(PREFIX)/usr/share/ovirt-engine/resources/jboss -type f -exec chmod 644 {} \;
-+	
-+	# XXX: Is this really needed?
- 	sed -i "s/MYVERSION/$(RPM_VERSION)/" $(PREFIX)/usr/share/ovirt-engine/resources/jboss/ROOT.war/engineVersion.js
- 
+-	sed -i "s/MYVERSION/$(RPM_VERSION)/" $(PREFIX)/usr/share/ovirt-engine/resources/jboss/ROOT.war/engineVersion.js
++
++
 +install_jboss_modules:
 +	# Copy the module definitions:
-+	install -dm 755 $(PREFIX)/usr/share/jboss-as/modules
-+	cp -r deployment/modules/* $(PREFIX)/usr/share/jboss-as/modules
-+	find $(PREFIX)/usr/share/jboss-as/modules -type d -exec chmod 755 {} \;
-+	find $(PREFIX)/usr/share/jboss-as/modules -type f -exec chmod 644 {} \;
-+	
-+	# Replace the name of the jar file with its absolute location (this
-+	# avoids a symbolic link):
-+	sed -i "s|postgresql-jdbc.jar|`build-classpath postgresql-jdbc`|" $(PREFIX)/usr/share/jboss-as/modules/org/postgresql/main/module.xml
++	install -dm 755 $(PREFIX)/usr/share/ovirt-engine/modules
++	cp -r deployment/modules/* $(PREFIX)/usr/share/ovirt-engine/modules
++	find $(PREFIX)/usr/share/ovirt-engine/modules -type d -exec chmod 755 {} \;
++	find $(PREFIX)/usr/share/ovirt-engine/modules -type f -exec chmod 644 {} \;
++
++	# PostgreSQL:
++	ln -s /usr/share/java/postgresql-jdbc.jar $(PREFIX)/usr/share/ovirt-engine/modules/org/postgresql/main/.
 +
++	# JAXB:
++	ln -s /usr/share/java/glassfish-jaxb/jaxb-impl.jar $(PREFIX)/usr/share/ovirt-engine/modules/com/sun/xml/bind/main/.
++	ln -s /usr/share/java/glassfish-jaxb/jaxb-xjc.jar $(PREFIX)/usr/share/ovirt-engine/modules/com/sun/xml/bind/main/.
++
++	# Hibernate validator needs to be overriden because it is missing the
++	# jtype library:
++	ln -s /usr/share/java/hibernate-validator.jar $(PREFIX)/usr/share/ovirt-engine/modules/org/hibernate/validator/main/.
++	ln -s /usr/share/java/jtype.jar $(PREFIX)/usr/share/ovirt-engine/modules/org/hibernate/validator/main/.
+ 
  install_sec:
+-	cd backend/manager/3rdparty/pub2ssh/; chmod +x pubkey2ssh.sh; mkdir -p bin; ./pubkey2ssh.sh; cd -
 -	rm -rf $(PREFIX)/etc/pki/engine-config/*.bat
+-	cp -f ./backend/manager/3rdparty/pub2ssh/bin/pubkey2ssh $(PREFIX)/etc/pki/ovirt-engine
 -	chmod 755 $(PREFIX)/etc/pki/ovirt-engine
 -	cp -a  ./backend/manager/conf/ca/* $(PREFIX)/etc/pki/ovirt-engine
 +	# Create the directories:
@@ -94,16 +155,16 @@ index d02ad06..7ae7db8 100644
 +	install -dm 755 $(PREFIX)/etc/pki/ovirt-engine/keys
 +	install -dm 755 $(PREFIX)/etc/pki/ovirt-engine/private
 +	install -dm 755 $(PREFIX)/etc/pki/ovirt-engine/requests
-+	
++
 +	# Configuration files:
 +	install -m 644 backend/manager/conf/ca/openssl.conf $(PREFIX)/etc/pki/ovirt-engine
 +	install -m 644 backend/manager/conf/ca/cacert.template $(PREFIX)/etc/pki/ovirt-engine
 +	install -m 644 backend/manager/conf/ca/cert.template $(PREFIX)/etc/pki/ovirt-engine
-+	
++
 +	# Certificate database:
 +	install -m 644 backend/manager/conf/ca/database.txt $(PREFIX)/etc/pki/ovirt-engine
 +	install -m 644 backend/manager/conf/ca/serial.txt $(PREFIX)/etc/pki/ovirt-engine
-+	
++
 +	# Scripts:
 +	install -m 755 backend/manager/conf/ca/*.sh $(PREFIX)/etc/pki/ovirt-engine
 +	install -m 755 backend/manager/conf/ca/generate-ssh-keys $(PREFIX)/etc/pki/ovirt-engine
@@ -124,17 +185,16 @@ index d02ad06..7ae7db8 100644
 -	cp -f ./backend/manager/modules/engineencryptutils/target/engineencryptutils-$(APP_VERSION).jar $(PREFIX)/usr/share/ovirt-engine/engine-config/lib/
 -	cp -f ./ear/target/engine/lib/engine-compat.jar $(PREFIX)/usr/share/ovirt-engine/engine-config/lib/
 -	rm -f $(PREFIX)/usr/bin/engine-config
-+	
-+	# Configuration files for the configuration tool (no execution
-+	# permissions for these):	
++
++	# Configuration files for the configuration tool:
 +	install -m 644 backend/manager/tools/engine-config/src/main/resources/engine-config.conf $(PREFIX)/etc/ovirt-engine/engine-config/
 +	install -m 644 backend/manager/tools/engine-config/src/main/resources/engine-config.*properties $(PREFIX)/etc/ovirt-engine/engine-config/
 +	install -m 644 backend/manager/tools/engine-config/src/main/resources/log4j.xml $(PREFIX)/etc/ovirt-engine/engine-config/
-+	
-+	# Main program for the configuraiton tool (needs execution permission):
++
++	# Main program for the configuraiton tool:
 +	install -m 755 backend/manager/tools/engine-config/src/main/resources/engine-config $(PREFIX)/usr/share/ovirt-engine/engine-config/
  	ln -s /usr/share/ovirt-engine/engine-config/engine-config $(PREFIX)/usr/bin/engine-config
--
+ 
 -	cp -f ./backend/manager/conf/kerberos/engine-manage-domains $(PREFIX)/usr/share/ovirt-engine/engine-manage-domains/
 -	chmod 750 $(PREFIX)/usr/share/ovirt-engine/engine-manage-domains/engine-manage-domains
 -	cp -f ./backend/manager/modules/utils/src/main/resources/engine-manage-domains.conf $(PREFIX)/etc/ovirt-engine/engine-manage-domains/
@@ -143,14 +203,11 @@ index d02ad06..7ae7db8 100644
 -	chmod 644 $(PREFIX)/etc/ovirt-engine/engine-manage-domains/log4j.xml
 -	cp -f ./ear/target/engine/lib/engine-compat.jar $(PREFIX)/usr/share/ovirt-engine/engine-manage-domains/lib/
 -	rm -f $(PREFIX)/usr/bin/engine-manage-domains
-+	
 +	# Configuration files for the domain management tool (no execution
-+	# permissions for these):
 +	install -m 644 backend/manager/modules/utils/src/main/resources/engine-manage-domains.conf $(PREFIX)/etc/ovirt-engine/engine-manage-domains/
 +	install -m 644 backend/manager/modules/utils/src/main/resources/engine-manage-domains/log4j.xml $(PREFIX)/etc/ovirt-engine/engine-manage-domains/
-+	
++
 +	# Main program for the domain management tool (needs execution
-+	# permission):
 +	install -m 755 backend/manager/conf/kerberos/engine-manage-domains $(PREFIX)/usr/share/ovirt-engine/engine-manage-domains/
  	ln -s /usr/share/ovirt-engine/engine-manage-domains/engine-manage-domains $(PREFIX)/usr/bin/engine-manage-domains
  
@@ -159,36 +216,36 @@ index d02ad06..7ae7db8 100644
 -	cp -f ./backend/manager/tools/engine-logcollector/src/rhev/logcollector.py $(PREFIX)/usr/share/ovirt-engine/log-collector/
 -	chmod 755 $(PREFIX)/usr/share/ovirt-engine/log-collector/logcollector.py
 -	/usr/bin/gzip -c ./backend/manager/tools/engine-logcollector/src/rhev/engine-log-collector.8 > $(PREFIX)/usr/share/man/man8/engine-log-collector.8.gz
--	chmod 644 $(PREFIX)/usr/share/man/man8/engine-log-collector.8.gz
--	cp -f ./backend/manager/tools/engine-logcollector/src/rhev/logcollector.conf $(PREFIX)/etc/ovirt-engine/
--	chmod 600 $(PREFIX)/etc/ovirt-engine/logcollector.conf
--	cp -f ./backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/api.py $(PREFIX)/usr/share/ovirt-engine/log-collector/schemas
--	cp -f ./backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/hypervisors.py $(PREFIX)/usr/share/ovirt-engine/log-collector/schemas
--	cp -f ./backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/__init__.py $(PREFIX)/usr/share/ovirt-engine/log-collector/schemas
--	chmod 755 $(PREFIX)/usr/share/ovirt-engine/log-collector/schemas/*
--	cp -f ./backend/manager/tools/engine-logcollector/src/sos/plugins/jboss.py $(PREFIX)$(PY_SITE_PKGS)/sos/plugins
--	cp -f ./backend/manager/tools/engine-logcollector/src/sos/plugins/engine.py $(PREFIX)$(PY_SITE_PKGS)/sos/plugins
--	cp -f ./backend/manager/tools/engine-logcollector/src/sos/plugins/postgresql.py $(PREFIX)$(PY_SITE_PKGS)/sos/plugins
--	chmod 755 $(PREFIX)$(PY_SITE_PKGS)/sos/plugins/*
--	rm -f $(PREFIX)/usr/bin/engine-log-collector
-+	
++
 +	# Python modules shouldn't have execution permission:
 +	install -m 644 backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/api.py $(PREFIX)/usr/share/ovirt-engine/log-collector/schemas
 +	install -m 644 backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/hypervisors.py $(PREFIX)/usr/share/ovirt-engine/log-collector/schemas
 +	install -m 644 backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/__init__.py $(PREFIX)/usr/share/ovirt-engine/log-collector/schemas
-+	
++
 +	# Then main program needs execution permission:
 +	install -m 755 backend/manager/tools/engine-logcollector/src/rhev/logcollector.py $(PREFIX)/usr/share/ovirt-engine/log-collector/
- 	ln -s /usr/share/ovirt-engine/log-collector/logcollector.py $(PREFIX)/usr/bin/engine-log-collector	
-+	
++	ln -s /usr/share/ovirt-engine/log-collector/logcollector.py $(PREFIX)/usr/bin/engine-log-collector
++
 +	# The configuration file should be readable only by root as it may
 +	# contain passwords:
 +	install -m 600 backend/manager/tools/engine-logcollector/src/rhev/logcollector.conf $(PREFIX)/etc/ovirt-engine/
-+	
++
 +	# Manual page:
 +	gzip -c backend/manager/tools/engine-logcollector/src/rhev/engine-log-collector.8 > $(PREFIX)/usr/share/man/man8/engine-log-collector.8.gz
-+	chmod 644 $(PREFIX)/usr/share/man/man8/engine-log-collector.8.gz
-+	
+ 	chmod 644 $(PREFIX)/usr/share/man/man8/engine-log-collector.8.gz
+-	cp -f ./backend/manager/tools/engine-logcollector/src/rhev/logcollector.conf $(PREFIX)/etc/ovirt-engine/
+-	chmod 600 $(PREFIX)/etc/ovirt-engine/logcollector.conf
+-	cp -f ./backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/api.py $(PREFIX)/usr/share/ovirt-engine/log-collector/schemas
+-	cp -f ./backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/hypervisors.py $(PREFIX)/usr/share/ovirt-engine/log-collector/schemas
+-	cp -f ./backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/__init__.py $(PREFIX)/usr/share/ovirt-engine/log-collector/schemas
+-	chmod 755 $(PREFIX)/usr/share/ovirt-engine/log-collector/schemas/*
+-	cp -f ./backend/manager/tools/engine-logcollector/src/sos/plugins/jboss.py $(PREFIX)$(PY_SITE_PKGS)/sos/plugins
+-	cp -f ./backend/manager/tools/engine-logcollector/src/sos/plugins/engine.py $(PREFIX)$(PY_SITE_PKGS)/sos/plugins
+-	cp -f ./backend/manager/tools/engine-logcollector/src/sos/plugins/postgresql.py $(PREFIX)$(PY_SITE_PKGS)/sos/plugins
+-	chmod 755 $(PREFIX)$(PY_SITE_PKGS)/sos/plugins/*
+-	rm -f $(PREFIX)/usr/bin/engine-log-collector
+-	ln -s /usr/share/ovirt-engine/log-collector/logcollector.py $(PREFIX)/usr/bin/engine-log-collector	
++
 +	# SOS plugins:
 +	install -m 755 backend/manager/tools/engine-logcollector/src/sos/plugins/jboss.py $(PREFIX)$(PY_SITE_PKGS)/sos/plugins
 +	install -m 755 backend/manager/tools/engine-logcollector/src/sos/plugins/engine.py $(PREFIX)$(PY_SITE_PKGS)/sos/plugins
@@ -206,26 +263,30 @@ index d02ad06..7ae7db8 100644
 -	cp -f ./backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/__init__.py $(PREFIX)/usr/share/ovirt-engine/iso-uploader/schemas
 -	chmod 755 $(PREFIX)/usr/share/ovirt-engine/iso-uploader/schemas/*
 -	rm -f $(PREFIX)/usr/bin/engine-iso-uploader
-+	
++
 +	# Python modules shouldn't have execution permission:
 +	install -m 644 backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/api.py $(PREFIX)/usr/share/ovirt-engine/iso-uploader/schemas
 +	install -m 644 backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/__init__.py $(PREFIX)/usr/share/ovirt-engine/iso-uploader/schemas
-+	
++
 +	# Then main program needs execution permission:
 +	install -m 755 backend/manager/tools/engine-iso-uploader/src/engine-iso-uploader.py $(PREFIX)/usr/share/ovirt-engine/iso-uploader/
  	ln -s /usr/share/ovirt-engine/iso-uploader/engine-iso-uploader.py $(PREFIX)/usr/bin/engine-iso-uploader
-+	
+ 
 +	# The configuration file should be readable only by root because it may
 +	# contain passwords used to connect with SSH to the file servers:
 +	install -m 600 backend/manager/tools/engine-iso-uploader/src/isouploader.conf $(PREFIX)/etc/ovirt-engine/
-+	
++
 +	# Manual page:
 +	gzip -c backend/manager/tools/engine-iso-uploader/src/engine-iso-uploader.8 > $(PREFIX)/usr/share/man/man8/engine-iso-uploader.8.gz
 +	chmod 644 $(PREFIX)/usr/share/man/man8/engine-iso-uploader.8.gz
- 
++
  install_sysprep:
- 	@echo "*** Deploying sysperp"
-@@ -211,16 +248,15 @@ install_sysprep:
+-	@echo "*** Deploying sysperp"
+-	cp -f ./backend/manager/conf/sysprep/* $(PREFIX)/usr/share/ovirt-engine/sysprep
+-	chmod 644 $(PREFIX)/usr/share/ovirt-engine/sysprep/*
++	@echo "*** Deploying sysprep"
++	cp -f ./backend/manager/conf/sysprep/* $(PREFIX)/etc/ovirt-engine/sysprep
++	chmod 644 $(PREFIX)/etc/ovirt-engine/sysprep/*
  
  install_notification_service:
  	@echo "*** Deploying notification service"
@@ -239,19 +300,19 @@ index d02ad06..7ae7db8 100644
 -	chmod 755 $(PREFIX)/etc/init.d/engine-notifierd
 -	cp -f ./backend/manager/tools/engine-notifier/engine-notifier-service/target/engine-notifier-service-$(APP_VERSION).jar $(PREFIX)/usr/share/ovirt-engine/notifier/engine-notifier.jar
 -	chmod 644 $(PREFIX)/usr/share/ovirt-engine/notifier/engine-notifier.jar
-+	
-+	# The main program and the startup script need execution permission:	
++
++	# The main program and the startup script need execution permission:
 +	install -m 755 backend/manager/tools/engine-notifier/engine-notifier-resources/src/main/resources/notifier.sh $(PREFIX)/usr/share/ovirt-engine/notifier/
 +	install -m 755 backend/manager/tools/engine-notifier/engine-notifier-resources/src/main/resources/engine-notifierd $(PREFIX)/etc/init.d/
-+	
++
 +	# The configuration file should be readable only by root and ovirt
-+	# because it may contain credentials used to connect to mail servers:	
++	# because it may contain credentials used to connect to mail servers:
 +	install -m 640 backend/manager/tools/engine-notifier/engine-notifier-resources/src/main/resources/notifier.conf $(PREFIX)/etc/ovirt-engine/notifier/
 +	install -m 644 backend/manager/tools/engine-notifier/engine-notifier-resources/src/main/resources/log4j.xml $(PREFIX)/etc/ovirt-engine/notifier/
  
  install_db_scripts:
  	@echo "*** Deploying Database scripts"
-@@ -228,24 +264,15 @@ install_db_scripts:
+@@ -230,24 +261,35 @@ install_db_scripts:
  
  install_misc:
  	@echo "*** Copying additional files"
@@ -281,8 +342,28 @@ index d02ad06..7ae7db8 100644
 +	install -m 644 backend/manager/conf/vds_installer.py $(PREFIX)/usr/share/ovirt-engine/scripts
 +	install -m 644 backend/manager/conf/jboss-log4j.xml $(PREFIX)/usr/share/ovirt-engine/conf
 +	install -m 644 packaging/fedora/setup/resources/postgres/postgres-ds.xml $(PREFIX)/usr/share/ovirt-engine/conf
++	install -m 644 packaging/fedora/ovirt-engine.xml $(PREFIX)/etc/ovirt-engine
++	install -m 644 packaging/fedora/ovirt-engine-logging.properties $(PREFIX)/etc/ovirt-engine
++	install -m 644 packaging/fedora/ovirt-engine-users.properties $(PREFIX)/etc/ovirt-engine
 +	install -m 755 packaging/ovirtlogrot.sh ${PREFIX}/usr/share/ovirt-engine/scripts/
 +	install -m 755 packaging/resources/ovirt-cron ${PREFIX}/etc/cron.daily
 +	install -m 644 packaging/resources/ovirt-tmpfilesd ${PREFIX}/etc/tmpfiles.d/ovirt-engine.conf
++
++install_root_webapp:
++	@echo "*** Deploying root webapp"
++
++	# Copy the root web application to the deployments directory (the web-conf.js file will be
++	# copied inside by engine-setup):
++	cp -r packaging/fedora/setup/resources/jboss/ROOT.war $(PREFIX)/usr/share/ovirt-engine/deployments
++	find $(PREFIX)/usr/share/ovirt-engine/deployments/ROOT.war -type d -exec chmod 755 {} \;
++	find $(PREFIX)/usr/share/ovirt-engine/deployments/ROOT.war -type f -exec chmod 644 {} \;
++	install -m 644 packaging/fedora/setup/resources/jboss/web-conf.js $(PREFIX)/etc/ovirt-engine
  
++	# XXX: Is this really needed?
++	sed -i "s/MYVERSION/$(RPM_VERSION)/" $(PREFIX)/usr/share/ovirt-engine/deployments/ROOT.war/engineVersion.js
  
++install_systemd_service:
++	@echo "*** Deploying systemd service"
++	install -m 755 packaging/fedora/ovirt-engine.sh $(PREFIX)/usr/share/ovirt-engine/bin
++	install -m 644 packaging/fedora/ovirt-engine.sysconfig $(PREFIX)/etc/sysconfig/ovirt-engine
++	install -m 644 packaging/fedora/ovirt-engine.service $(PREFIX)/usr/lib/systemd/system
diff --git a/ovirt-engine-remove-dependency-on-jboss-interceptors.patch b/ovirt-engine-remove-dependency-on-jboss-interceptors.patch
new file mode 100644
index 0000000..218d869
--- /dev/null
+++ b/ovirt-engine-remove-dependency-on-jboss-interceptors.patch
@@ -0,0 +1,48 @@
+From 6ea46f9d35015436115647299fc44b68d96cc298 Mon Sep 17 00:00:00 2001
+From: Juan Hernandez <juan.hernandez at redhat.com>
+Date: Thu, 16 Feb 2012 12:03:15 +0100
+Subject: [PATCH] core: Remove dependency on jboss interceptors (#NA)
+
+This dependency is not needed and it complicates building of the
+RPMs in Fedora.
+
+Change-Id: Ibcd421297a6f7a2894177b65f8646b3016282851
+---
+ backend/manager/modules/utils/pom.xml |    4 ----
+ pom.xml                               |    5 -----
+ 2 files changed, 0 insertions(+), 9 deletions(-)
+
+diff --git a/backend/manager/modules/utils/pom.xml b/backend/manager/modules/utils/pom.xml
+index 1e01679..a7bf1d9 100644
+--- a/backend/manager/modules/utils/pom.xml
++++ b/backend/manager/modules/utils/pom.xml
+@@ -14,10 +14,6 @@
+ 
+   <dependencies>
+    <dependency>
+-      <groupId>org.jboss.interceptor</groupId>
+-      <artifactId>jboss-interceptor-core</artifactId>
+-   </dependency>
+-   <dependency>
+       <groupId>org.jboss.spec.javax.interceptor</groupId>
+       <artifactId>jboss-interceptors-api_1.1_spec</artifactId>
+       <version>1.0.0.Final</version>
+diff --git a/pom.xml b/pom.xml
+index 50a249a..923f05f 100644
+--- a/pom.xml
++++ b/pom.xml
+@@ -79,11 +79,6 @@
+         <version>1.0.0.Final</version>
+       </dependency>
+       <dependency>
+-        <groupId>org.jboss.interceptor</groupId>
+-        <artifactId>jboss-interceptor-core</artifactId>
+-        <version>2.0.0.Alpha3</version>
+-      </dependency>
+-      <dependency>
+         <groupId>org.quartz-scheduler</groupId>
+         <artifactId>quartz</artifactId>
+         <version>${quartz.version}</version>
+-- 
+1.7.7.6
+
diff --git a/ovirt-engine-replace-pubkey2ssh-with-ssh-keygen.patch b/ovirt-engine-replace-pubkey2ssh-with-ssh-keygen.patch
index 5a11162..1dfc94a 100644
--- a/ovirt-engine-replace-pubkey2ssh-with-ssh-keygen.patch
+++ b/ovirt-engine-replace-pubkey2ssh-with-ssh-keygen.patch
@@ -1,36 +1,3 @@
-From 71081c4b5a00e55cdef2a814351d41e2a78f59a3 Mon Sep 17 00:00:00 2001
-From: Juan Hernandez <juan.hernandez at redhat.com>
-Date: Sun, 18 Mar 2012 16:06:43 +0100
-Subject: [PATCH] Replace pubkey2ssh with ssh-keygen -i -m pcks8 -f
-
----
- Makefile                                          |    2 -
- backend/manager/3rdparty/pub2ssh/lgpl-2.1.txt     |  502 ---------------------
- backend/manager/3rdparty/pub2ssh/pubkey2ssh.sh    |    5 -
- backend/manager/3rdparty/pub2ssh/readme.txt       |   29 --
- backend/manager/3rdparty/pub2ssh/src/pubkey2ssh.c |  160 -------
- backend/manager/conf/ca/installCA.sh              |   11 +-
- packaging/fedora/spec/ovirt-engine.spec.in        |    1 -
- 7 files changed, 1 insertion(+), 709 deletions(-)
- delete mode 100644 backend/manager/3rdparty/pub2ssh/lgpl-2.1.txt
- delete mode 100755 backend/manager/3rdparty/pub2ssh/pubkey2ssh.sh
- delete mode 100644 backend/manager/3rdparty/pub2ssh/readme.txt
- delete mode 100644 backend/manager/3rdparty/pub2ssh/src/pubkey2ssh.c
-
-diff --git a/Makefile b/Makefile
-index a1d04b5..2b0575e 100644
---- a/Makefile
-+++ b/Makefile
-@@ -139,9 +139,7 @@ install_setup:
- 	sed -i "s/MYVERSION/$(RPM_VERSION)/" $(PREFIX)/usr/share/ovirt-engine/resources/jboss/ROOT.war/engineVersion.js
- 
- install_sec:
--	cd backend/manager/3rdparty/pub2ssh/; chmod +x pubkey2ssh.sh; mkdir -p bin; ./pubkey2ssh.sh; cd -
- 	rm -rf $(PREFIX)/etc/pki/engine-config/*.bat
--	cp -f ./backend/manager/3rdparty/pub2ssh/bin/pubkey2ssh $(PREFIX)/etc/pki/ovirt-engine
- 	chmod 755 $(PREFIX)/etc/pki/ovirt-engine
- 	cp -a  ./backend/manager/conf/ca/* $(PREFIX)/etc/pki/ovirt-engine
- 
 diff --git a/backend/manager/3rdparty/pub2ssh/lgpl-2.1.txt b/backend/manager/3rdparty/pub2ssh/lgpl-2.1.txt
 deleted file mode 100644
 index 4362b49..0000000
diff --git a/ovirt-engine-setup-fixes.patch b/ovirt-engine-setup-fixes.patch
new file mode 100644
index 0000000..3272967
--- /dev/null
+++ b/ovirt-engine-setup-fixes.patch
@@ -0,0 +1,773 @@
+commit 8f2e1adfa9a52f978681b12b974ff34b3ec195d6
+Author: Juan Hernandez <juan.hernandez at redhat.com>
+Date:   Wed Apr 18 22:13:47 2012 +0200
+
+    setup-fixes
+
+diff --git a/backend/manager/modules/utils/src/main/resources/engine-manage-domains.conf b/backend/manager/modules/utils/src/main/resources/engine-manage-domains.conf
+index a510a0b..c16581f 100755
+--- a/backend/manager/modules/utils/src/main/resources/engine-manage-domains.conf
++++ b/backend/manager/modules/utils/src/main/resources/engine-manage-domains.conf
+@@ -1,7 +1,7 @@
+ jaasFile=/usr/share/ovirt-engine/conf/jaas.conf
+-krb5confFile=/usr/share/jboss-as/standalone/configuration/krb5.conf
+-jbossDataSourceFile=/usr/share/jboss-as/standalone/configuration/standalone.xml
+-jbossLoginConfigFile=/usr/share/jboss-as/standalone/configuration/standalone.xml
++krb5confFile=/etc/ovirt-engine/krb5.conf
++jbossDataSourceFile=/usr/share/ovirt-engine/ovirt-engine.xml
++jbossLoginConfigFile=/usr/share/ovirt-engine/ovirt-engine.xml
+ engineConfigExecutable=/usr/share/ovirt-engine/engine-config/engine-config
+ localHostEntry=localhost
+-engineLibPath=/usr/share/ovirt-engine/engine.ear/lib
++engineLibPath=/usr/share/ovirt-engine/deployments/engine.ear/lib
+diff --git a/backend/manager/tools/engine-config/src/main/resources/engine-config.conf b/backend/manager/tools/engine-config/src/main/resources/engine-config.conf
+index 91d37ac..c5799d0 100644
+--- a/backend/manager/tools/engine-config/src/main/resources/engine-config.conf
++++ b/backend/manager/tools/engine-config/src/main/resources/engine-config.conf
+@@ -2,8 +2,8 @@
+ 
+ 
+ # Data source files
+-jbossDataSourceFile=/usr/share/jboss-as/standalone/configuration/standalone.xml
+-jbossLoginConfigFile=/usr/share/jboss-as/standalone/configuration/standalone.xml
++jbossDataSourceFile=/etc/ovirt-engine/ovirt-engine.xml
++jbossLoginConfigFile=/etc/ovirt-engine/ovirt-engine.xml
+ 
+ # Data structure
+ configTable=vdc_options
+diff --git a/packaging/fedora/setup/basedefs.py b/packaging/fedora/setup/basedefs.py
+index 5432516..e691e17 100644
+--- a/packaging/fedora/setup/basedefs.py
++++ b/packaging/fedora/setup/basedefs.py
+@@ -13,68 +13,47 @@ PGPASS_FILE_TEMPLATE="hostname:port:database:username:password"
+ JBOSS_SECURITY_DOMAIN="EncryptDBPassword"
+ JBOSS_KERB_AUTH="EngineKerberosAuth"
+ 
+-JBOSS_PROFILE_NAME="default"
+ VDC_OPTION_CVER="general"
+ ENGINE_RPM_NAME="ovirt-engine"
+ 
+-JBOSS_SHARE_FOLDER="/usr/share/jboss-as"
+-
+ INTERNAL_ADMIN="admin"
+ INTERNAL_DOMAIN="internal"
+ 
++JBOSS_SHARE_FOLDER="/usr/share/jboss-as"
++
+ DIR_ETC_SYSCONFIG="/etc/sysconfig"
+ DIR_USR_SHARE="/usr/share"
+ DIR_VAR_LOG="/var/log"
+ DIR_VAR_LIB="/var/lib"
+ DIR_LOG="%s/ovirt-engine/" % DIR_VAR_LOG
+ DIR_CONFIG="%s/ovirt-engine/conf" % DIR_USR_SHARE
+-DIR_JBOSS_RESOURCES="%s/ovirt-engine/resources/jboss" % DIR_USR_SHARE
+ DIR_KERBEROS="%s/ovirt-engine/kerberos" % DIR_USR_SHARE
+-DIR_JBOSS="/usr/share/jboss-as"
+ 
+-DIR_JBOSS_ROOT_WAR_IMAGES_SRC="%s/%s" % (DIR_JBOSS_RESOURCES, "images/")
+-DIR_JBOSS_ROOT_WAR="%s/standalone/deployments/ROOT.war" % DIR_JBOSS
++DIR_JBOSS_ROOT_WAR="%s/ovirt-engine/deployments/ROOT.war" % DIR_USR_SHARE
+ DIR_ENGINE_EAR_SRC="%s/ovirt-engine/engine.ear" % DIR_USR_SHARE
+-DIR_ROOT_WAR_SRC="%s/ovirt-engine/resources/jboss/ROOT.war" % DIR_USR_SHARE
+ DIR_DB_SCRIPTS="%s/ovirt-engine/dbscripts/" % DIR_USR_SHARE
+ DIR_DB_BACKUPS="%s/ovirt-engine/db-backups" % DIR_USR_SHARE
+ DIR_ENGINE_CONFIG="%s/ovirt-engine/engine-config/" % DIR_USR_SHARE
+ DIR_RHEVM_CONFIG_CONF="/etc/ovirt-engine/engine-config/"
+ DIR_OVIRT_PKI="/etc/pki/ovirt-engine"
+-DIR_MODULES_SRC="%s/ovirt-engine/resources/jboss/modules"  % DIR_USR_SHARE
+-DIR_MODULES_DEST="%s/modules" % DIR_JBOSS
+ 
+ 
+ FILE_INSTALLER_LOG="engine-setup.log"
+ FILE_JBOSS_HTTP_PARAMS="/etc/ovirt-engine/web-conf.js"
+-FILE_JBOSS_ROOT_WAR_CSS = "style.css"
+-FILE_JBOSS_ROOT_WAR_CSS_SRC="%s/%s" % (DIR_JBOSS_RESOURCES, FILE_JBOSS_ROOT_WAR_CSS)
+-FILE_JBOSS_WEB_XML_SRC="%s/standalone/deployments/ROOT.war/WEB-INF/web.xml" % DIR_JBOSS
+ FILE_EXTERNAL_CONFIG="%s/ovirt-engine/engine.ear/ovirtengine.war/ExternalConfig.txt" % DIR_USR_SHARE
+ FILE_DEFAULT_HTML="%s/ovirt-engine/engine.ear/ovirtengine.war/Default.htm" % DIR_USR_SHARE
+ FILE_SERVER_PARAMS_JS="%s/ovirt-engine/engine.ear/ovirtengine.war/ServerParameters.js" % DIR_USR_SHARE
+-FILE_KRB_CONF="%s/deployments/configuration/krb5.conf" % DIR_JBOSS
+ FILE_CA_CRT_SRC="/etc/pki/ovirt-engine/ca.pem"
+ FILE_CA_CRT_TEMPLATE="/etc/pki/ovirt-engine/cacert.template"
+ FILE_CERT_TEMPLATE="/etc/pki/ovirt-engine/cert.template"
+ FILE_JBOSSAS_CONF="/etc/jboss-as/jboss-as.conf"
+-FILE_JBOSS_STANDALONE="%s/standalone/configuration/standalone.xml" % DIR_JBOSS
+-FILE_JBOSS_ROOT_WAR_HTML="engine_index.html"
+-FILE_JBOSS_ROOT_WAR_HTML_DEST="%s/%s" % (DIR_JBOSS_ROOT_WAR, FILE_JBOSS_ROOT_WAR_HTML)
+-FILE_JBOSS_ROOT_WAR_HTML_SRC="%s/%s" % (DIR_JBOSS_RESOURCES, FILE_JBOSS_ROOT_WAR_HTML)
+-FILE_JBOSS_ROOT_WAR_JS_VERSION="engineVersion.js"
+-FILE_JBOSS_ROOT_WAR_CONTEXT_SRC="%s/ROOT_war-context.xml" % DIR_JBOSS_RESOURCES
+-FILE_JBOSS_ROOT_WAR_CONTEXT_DEST="%s/WEB-INF/context.xml" % DIR_JBOSS_ROOT_WAR
+-FILE_JBOSS_ROOT_WAR_FAVICON="favicon.ico"
+-FILE_JBOSS_ROOT_WAR_FAVICON_DEST="%s/%s" % (DIR_JBOSS_ROOT_WAR, FILE_JBOSS_ROOT_WAR_FAVICON)
+-FILE_JBOSS_ROOT_WAR_FAVICON_SRC="%s/%s" % (DIR_JBOSS_RESOURCES, FILE_JBOSS_ROOT_WAR_FAVICON)
++FILE_JBOSS_STANDALONE="/etc/ovirt-engine/ovirt-engine.xml"
+ FILE_DB_INSTALL_SCRIPT="engine-db-install.sh"
+ FILE_DB_UPGRADE_SCRIPT="upgrade.sh"
+ FILE_RHEVM_CONFIG_BIN=os.path.join(DIR_ENGINE_CONFIG, "engine-config")
+ FILE_RHEVM_CONFIG_PROPS="engine-config-install.properties"
+ FILE_RHEVM_EXTENDED_CONF = os.path.join(DIR_CONFIG, FILE_RHEVM_CONFIG_PROPS)
+ FILE_RESOLV_CONF="/etc/resolv.conf"
+-FILE_SLIMMING_PROFILE_CONF="/usr/share/ovirt-engine/conf/slimming.conf"
+ FILE_IPTABLES_DEFAULT="%s/ovirt-engine/conf/iptables.default" % DIR_USR_SHARE
+ FILE_IPTABLES_EXAMPLE="%s/ovirt-engine/conf/iptables.example" % DIR_USR_SHARE
+ FILE_IPTABLES_BACKUP="%s/ovirt-engine/conf/iptables.backup" % DIR_USR_SHARE
+@@ -87,7 +66,6 @@ FILE_ISOUPLOADER_CONF="/etc/ovirt-engine/isouploader.conf"
+ FILE_LOGCOLLECTOR_CONF="/etc/ovirt-engine/logcollector.conf"
+ FILE_PSQL_CONF="/var/lib/pgsql/data/postgresql.conf"
+ FILE_LIMITS_CONF="/etc/security/limits.conf"
+-FILE_JDK_MODULE_XML="%s/modules/sun/jdk/main/module.xml" % DIR_JBOSS
+ 
+ # ISO FILES
+ FILE_VIRTIO_WIN_VFD="/usr/share/virtio-win/virtio-win.vfd"
+@@ -135,7 +113,7 @@ CONST_VDSM_UID = 36
+ CONST_KVM_GID  = 36
+ CONST_MAX_PSQL_CONNS= 150
+ CONST_FD_OPEN = 65535
+-CONST_FD_LINE = "jboss           %s    nofile          %s"
++CONST_FD_LINE = "ovirt           %s    nofile          %s"
+ CONST_SHMMAX=35554432
+ 
+ #text colors
+diff --git a/packaging/fedora/setup/engine-cleanup.py b/packaging/fedora/setup/engine-cleanup.py
+index 9590da7..44cf85f 100755
+--- a/packaging/fedora/setup/engine-cleanup.py
++++ b/packaging/fedora/setup/engine-cleanup.py
+@@ -26,10 +26,6 @@ LOG_PATH = "/var/log/%s" % (BASE_NAME)
+ PKI_DIR = "/etc/pki/%s" %(BASE_NAME)
+ TRUSTORE = os.path.join (PKI_DIR, ".truststore")
+ KEYSTORE = os.path.join (PKI_DIR, ".keystore")
+-JBOSS_SERVER_DIR = "/var/lib/jbossas/server"
+-VAR_SLIMMED_DIR = os.path.join(JBOSS_SERVER_DIR, basedefs.JBOSS_PROFILE_NAME)
+-ETC_JBOSS_DIR = "/etc/jbossas"
+-ETC_SLIMMED_DIR = os.path.join(ETC_JBOSS_DIR, basedefs.JBOSS_PROFILE_NAME)
+ PKI_BACKUP_DIR = "/etc/pki/%s-backups" % (PREFIX)
+ 
+ #MSGS
+@@ -38,16 +34,15 @@ MSG_RC_ERROR = "Return Code is not zero"
+ MSG_ERROR_BACKUP_DB = "Error: Database backup failed"
+ MSG_ERROR_DROP_DB = "Error: Database drop failed"
+ MSG_ERROR_CHECK_LOG = "Error: Cleanup failed.\nplease check log at %s"
+-MSG_ERR_FAILED_JBOSS_SERVICE_STILL_RUN = "Error: Can't stop jboss service. Please shut it down manually."
+-MSG_ERR_FAILED_STP_JBOSS_SERVICE = "Error: Can't stop JBoss"
+-MSG_ERR_FAILED_STATUS_JBOSS_SERVICE = "Error: Can't get JBoss service status"
++MSG_ERR_FAILED_ENGINE_SERVICE_STILL_RUN = "Error: Can't stop jboss service. Please shut it down manually."
++MSG_ERR_FAILED_STP_ENGINE_SERVICE = "Error: Can't stop JBoss"
++MSG_ERR_FAILED_STATUS_ENGINE_SERVICE = "Error: Can't get JBoss service status"
+ 
+ MSG_INFO_DONE = "DONE"
+ MSG_INFO_ERROR = "ERROR"
+-MSG_INFO_STOP_JBOSS = "Stopping JBoss Service"
++MSG_INFO_STOP_ENGINE = "Stopping Engine Service"
+ MSG_INFO_BACKUP_DB = "Backing Up Database"
+ MSG_INFO_REMOVE_DB = "Removing Database"
+-MSG_INFO_REMOVE_SLIMMED = "Removing %s JBoss profile" % (PROD_NAME)
+ MSG_INFO_REMOVE_CA = "Removing CA"
+ MSG_INFO_UNLINK_EAR = "Removing EAR link"
+ MSG_INFO_DB_BACKUP_FILE = "DB Backup available at"
+@@ -257,15 +252,15 @@ class DB():
+ 
+         return True
+ 
+-def stopJboss():
+-    logging.debug("stoping jboss service.")
++def stopEngine():
++    logging.debug("stoping service.")
+ 
+-    cmd = [basedefs.EXEC_SERVICE, "jboss-as", "stop"]
+-    output, rc = utils.execCmd(cmd, None, True, MSG_ERR_FAILED_STP_JBOSS_SERVICE, [])
++    cmd = [basedefs.EXEC_SERVICE, BASE_NAME, "stop"]
++    output, rc = utils.execCmd(cmd, None, True, MSG_ERR_FAILED_STP_ENGINE_SERVICE, [])
+ 
+-    # JBoss service sometimes return zero rc even if service is still up
++    # Service sometimes return zero rc even if service is still up
+     if "[FAILED]" in output and "Timeout: Shutdown command was sent, but process is still running" in output:
+-        raise OSError(MSG_ERR_FAILED_JBOSS_SERVICE_STILL_RUN)
++        raise OSError(MSG_ERR_FAILED_ENGINE_SERVICE_STILL_RUN)
+ 
+ def restartPostgresql():
+     """
+@@ -301,14 +296,6 @@ def _printErrlMessages():
+         logging.info('%s'%(msg))
+         print ('%s'%(msg))
+ 
+-def unlinkEar():
+-    links = [os.path.join(basedefs.DIR_JBOSS, "standalone", "deployments", "engine.ear"),
+-             os.path.join(basedefs.DIR_JBOSS, "standalone", "deployments", "ROOT.war")]
+-
+-    for link in links:
+-        if os.path.exists(link):
+-            os.unlink(link)
+-
+ def main(options):
+     db = DB()
+     ca = CA()
+@@ -321,8 +308,8 @@ def main(options):
+ 
+     print
+ 
+-    # Stop JBoss
+-    runFunc(stopJboss, MSG_INFO_STOP_JBOSS)
++    # Stop the service:
++    runFunc(stopEngine, MSG_INFO_STOP_ENGINE)
+ 
+     # Close all DB connections and drop DB (only if db exists)
+     if db.exists() and options.drop_db:
+@@ -333,11 +320,6 @@ def main(options):
+     if options.remove_ca:
+         runFunc([ca.backup, ca.remove], MSG_INFO_REMOVE_CA)
+ 
+-    # Unlink ear link in JBoss
+-    if options.unlink_ear:
+-        runFunc([unlinkEar], MSG_INFO_UNLINK_EAR)
+-
+-
+     if len(err_messages) == 0:
+         print MSG_INFO_CLEANUP_OK
+     else:
+diff --git a/packaging/fedora/setup/engine-setup.py b/packaging/fedora/setup/engine-setup.py
+index 8bd3f69..93d22dd 100755
+--- a/packaging/fedora/setup/engine-setup.py
++++ b/packaging/fedora/setup/engine-setup.py
+@@ -573,99 +573,6 @@ def copyAndLinkConfig(config):
+         # return new path
+         return new_config_path
+ 
+-def _editJbossasConf():
+-    try:
+-        jbossasHandler = utils.TextConfigFileHandler(basedefs.FILE_JBOSSAS_CONF)
+-        jbossasHandler.open()
+-
+-        jbossasHandler.editParam("JBOSS_IP", "0.0.0.0")
+-        jbossasHandler.editParam("JBOSSCONF", basedefs.JBOSS_PROFILE_NAME)
+-
+-        jbossasHandler.close()
+-    except:
+-        logging.error(traceback.format_exc())
+-        raise Exception(output_messages.ERR_EXP_UPD_JBOSS_CONF%(basedefs.FILE_JBOSSAS_CONF))
+-
+-def _linkHttpParams():
+-    #copy context.xml to ROOT.war/WEB-INF
+-    try:
+-        #create links for files in /usr/share/rhevm/reosurces/jboss
+-        targetsList = [ basedefs.FILE_JBOSS_HTTP_PARAMS ]
+-
+-        for target in targetsList:
+-            #first, remove existing destination
+-            link = "%s/%s" % (basedefs.DIR_JBOSS_ROOT_WAR, os.path.basename(target))
+-            if os.path.exists(link):
+-                if os.path.islink(link):
+-                    logging.debug("removing link %s" % link)
+-                    os.unlink(link)
+-                #logging.debug("Removing %s" % link)
+-                elif os.path.isdir(link):
+-                    #remove dir using shutil.rmtree
+-                    logging.debug("removing directory %s" % link)
+-                    shutil.rmtree(link)
+-                else:
+-                    logging.debug("removing file %s" % link)
+-                    os.remove(link)
+-
+-            logging.debug("Linking %s to %s" % (target, link))
+-            os.link(target, link)
+-    except:
+-        logging.error(traceback.format_exc())
+-        raise Exception(output_messages.ERR_EXP_FAILED_ROOT_WAR)
+-
+-def _changeDefaultWelcomePage():
+-    logging.debug("editing jboss conf file %s" % (basedefs.FILE_JBOSS_WEB_XML_SRC))
+-    webXmlHandler = utils.XMLConfigFileHandler(basedefs.FILE_JBOSS_WEB_XML_SRC)
+-    webXmlHandler.open()
+-
+-    #check if the node already exists
+-    welcomeFileListNode = webXmlHandler.xpathEval("/web-app/welcome-file-list")
+-    if len(welcomeFileListNode) == 0: #get the child to insert the node after
+-        servletMapNode = utils.getXmlNode(webXmlHandler, "/web-app/mime-mapping")
+-
+-        #add new node - welcome-file-list
+-        welcomeFileListNode = libxml2.newNode('welcome-file-list')
+-
+-        #add the new node as a next sibling to the servletMapNode
+-        servletMapNode.addNextSibling(welcomeFileListNode)
+-
+-        #add child and set content to the new child node
+-        welcomeFileNode = libxml2.newNode('welcome-file')
+-        welcomeFileListNode.addChild(welcomeFileNode)
+-    else:
+-        logging.debug("jboss file %s already updated, updating tag content only" % (basedefs.FILE_JBOSS_WEB_XML_SRC))
+-
+-    logging.debug("setting value of default root.war html-file to %s" % (basedefs.FILE_JBOSS_ROOT_WAR_HTML))
+-    utils.setXmlContent(webXmlHandler, "/web-app/welcome-file-list/welcome-file", basedefs.FILE_JBOSS_ROOT_WAR_HTML)
+-    webXmlHandler.close()
+-
+-def _addMimeMapNode(webXmlHandler):
+-    """
+-    adds a new mime-mapping node after description
+-    """
+-    descMapNode = utils.getXmlNode(webXmlHandler, "/web-app/description")
+-    mimeMapListNode = libxml2.newNode('mime-mapping') 
+-
+-    #add the new node as a next sibling to the servletMapNode
+-    descMapNode.addNextSibling(mimeMapListNode)
+-
+-    #add the extention node
+-    extFileNode = libxml2.newNode('extension')
+-    mimeMapListNode.addChild(extFileNode)
+-
+-    #add the mime-type node
+-    typeFileNode = libxml2.newNode('mime-type')
+-    mimeMapListNode.addChild(typeFileNode)
+-
+-    #set content to extension node
+-    logging.debug("setting value of extention to crt")
+-    utils.setXmlContent(webXmlHandler, "/web-app/mime-mapping/extension", "crt")
+-
+-    #set content to mime type node
+-    logging.debug("setting value of mime-type to application/x-x509-ca-cert")
+-    utils.setXmlContent(webXmlHandler, "/web-app/mime-mapping/mime-type", "application/x-x509-ca-cert")
+-
+ def _handleJbossCertFile():
+     """
+     copy ca.crt to ROOT.WAR dir
+@@ -680,37 +587,10 @@ def _handleJbossCertFile():
+         raise Exception(output_messages.ERR_EXP_CANT_FIND_CA_FILE % (basedefs.FILE_CA_CRT_SRC))
+ 
+     # change ownership to jboss
+-    os.chown(destCaFile, utils.getUsernameId("jboss-as"), utils.getGroupId("jboss-as"))
+-
+-    # update mime type in web.xml
+-    logging.debug("editing jboss conf file %s" % (basedefs.FILE_JBOSS_WEB_XML_SRC))
+-    webXmlHandler = utils.XMLConfigFileHandler(basedefs.FILE_JBOSS_WEB_XML_SRC)
+-    webXmlHandler.open()
+-
+-    #check if the node already exists
+-    mimeMapListNode = webXmlHandler.xpathEval("/web-app/mime-mapping")
+-
+-    #add new xml node in case we don't have one
+-    if len(mimeMapListNode) == 0:
+-        _addMimeMapNode(webXmlHandler)
+-    else:
+-        #if we already have a mapping node, check if it doesn't include the 'crt' map
+-        mapNodes = webXmlHandler.xpathEval("/web-app/mime-mapping/extension")
+-        nodeExists = False
+-        for node in mapNodes:
+-            if node.content == "crt":
+-                nodeExists = True
+-                break
+-        if not nodeExists:
+-            _addMimeMapNode(webXmlHandler)
+-
+-    webXmlHandler.close()
++    os.chown(destCaFile, utils.getUsernameId("ovirt"), utils.getGroupId("ovirt"))
+ 
+ def _editRootWar():
+     try:
+-        # Copy new files and images to rhevm-slimmed profile
+-        _linkHttpParams()
+-
+         # Update rhevm_index.html file with consts
+         logging.debug("update %s with http & ssl urls"%(basedefs.FILE_JBOSS_HTTP_PARAMS))
+ 
+@@ -721,6 +601,9 @@ def _editRootWar():
+         utils.findAndReplace(basedefs.FILE_JBOSS_HTTP_PARAMS, "var http_port.*", 'var http_port = "%s";'%(conf["HTTP_PORT"]))
+         utils.findAndReplace(basedefs.FILE_JBOSS_HTTP_PARAMS, "var https_port.*", 'var https_port = "%s";'%(conf["HTTPS_PORT"]))
+ 
++        # Copy the updated file to the root web application:
++        utils.copyFile(basedefs.FILE_JBOSS_HTTP_PARAMS, basedefs.DIR_JBOSS_ROOT_WAR)
++
+         # Handle ca.crt
+         _handleJbossCertFile()
+ 
+@@ -832,12 +715,12 @@ def _changeCaPermissions(pkiDir):
+                     os.path.join(pkiDir, "private", "ca.pem"),
+                     os.path.join(pkiDir,".truststore")
+                     ]
+-    jbossUid = utils.getUsernameId("jboss-as")
+-    jbossGid = utils.getGroupId("jboss-as")
++    ovirtUid = utils.getUsernameId("ovirt")
++    ovirtGid = utils.getGroupId("ovirt")
+ 
+     for item in changeList:
+-        logging.debug("changing ownership of %s to %s/%s (uid/gid)" % (item, jbossUid, jbossGid))
+-        os.chown(item, int(jbossUid), int(jbossGid))
++        logging.debug("changing ownership of %s to %s/%s (uid/gid)" % (item, ovirtUid, ovirtGid))
++        os.chown(item, int(ovirtUid), int(ovirtGid))
+         logging.debug("changing file permissions for %s to 0750" % (item))
+         os.chmod(item, 0750)
+ 
+@@ -915,33 +798,6 @@ def _configIptables():
+         logging.error(traceback.format_exc())
+         raise Exception(output_messages.ERR_EXP_FAILED_CFG_IPTABLES)
+ 
+-def _createJbossProfile():
+-    logging.debug("creating jboss profile")
+-    try:
+-        dirs = [
+-                   {'src'  : basedefs.DIR_ENGINE_EAR_SRC,
+-                    'dest' : os.path.join(basedefs.DIR_JBOSS, "standalone", "deployments", "engine.ear")},
+-                   {'src'  : basedefs.DIR_ROOT_WAR_SRC,
+-                    'dest' : os.path.join(basedefs.DIR_JBOSS, "standalone", "deployments", "ROOT.war")}
+-                   ]
+-
+-        for item in dirs:
+-            if not os.path.exists(item['dest']):
+-                if os.path.islink(item['dest']) and os.readlink(item['dest']) != item['src']:
+-                    os.remove(item['dest'])
+-                os.symlink(item['src'], item['dest'])
+-
+-                logging.debug("Successfully created jboss profile %s"%(basedefs.JBOSS_PROFILE_NAME))
+-            else:
+-                logging.debug("%s profile already exists, doing nothing"%(basedefs.JBOSS_PROFILE_NAME))
+-
+-            logging.debug("touching .dodeploy file for %s" % item['dest'])
+-            open("%s.dodeploy" % item['dest'], 'w').close()
+-
+-    except:
+-        logging.error(traceback.format_exc())
+-        raise Exception("Failed to create JBoss profile")
+-
+ def _createDB():
+     """
+     create fresh engine db
+@@ -1017,7 +873,7 @@ def _updateVDCOptions():
+             "CertificateFileName":"/etc/pki/ovirt-engine/certs/engine.cer",
+             "CAEngineKey":"/etc/pki/ovirt-engine/private/ca.pem",
+             "TruststoreUrl":"/etc/pki/ovirt-engine/.keystore",
+-            "ENGINEEARLib":"/usr/share/jboss-as/standalone/deployments/engine.ear",
++            "ENGINEEARLib":"/usr/share/ovirt-engine/deployments/engine.ear",
+             "CACertificatePath":"/etc/pki/ovirt-engine/ca.pem",
+             "CertAlias":"engine",
+         },
+@@ -1481,9 +1337,9 @@ def _displaySummary():
+ 
+ def _startJboss():
+     logging.debug("using chkconfig to enable jboss to load on system startup.")
+-    output, rc = utils.execExternalCmd("/sbin/chkconfig jboss-as on", True, output_messages.ERR_FAILED_CHKCFG_JBOSS)
+-    _handleJbossService('stop', output_messages.INFO_STOP_JBOSS, output_messages.ERR_FAILED_STP_JBOSS_SERVICE, False)
+-    _handleJbossService('start', output_messages.INFO_START_JBOSS, output_messages.ERR_FAILED_START_JBOSS_SERVICE, False)
++    output, rc = utils.execExternalCmd("/sbin/chkconfig ovirt-engine on", True, output_messages.ERR_FAILED_CHKCFG_JBOSS)
++    _handleEngineService('stop', output_messages.INFO_STOP_JBOSS, output_messages.ERR_FAILED_STP_JBOSS_SERVICE, False)
++    _handleEngineService('start', output_messages.INFO_START_JBOSS, output_messages.ERR_FAILED_START_JBOSS_SERVICE, False)
+     
+ def _configNfsShare():
+     #ISO_DOMAIN_NAME, NFS_MP
+@@ -1604,33 +1460,32 @@ def _addFinalInfoMsg():
+     messages.append(output_messages.INFO_ADD_USERS)
+     messages.append(output_messages.INFO_RHEVM_URL % conf["HTTP_URL"])
+ 
+-def _checkJbossService(configFile):
+-    logging.debug("checking the status of jboss")
+-    cmd = "%s jboss-as status" % (basedefs.EXEC_SERVICE)
++def _checkEngineService(configFile):
++    logging.debug("checking the status of engine")
++    cmd = "%s ovirt-engine status" % (basedefs.EXEC_SERVICE)
+     output, rc = utils.execExternalCmd(cmd)
+     if 0 == rc:
+-        logging.debug("jboss-as is up and running")
++        logging.debug("engine is up and running")
+ 
+         #if we don't use an answer file, we need to ask the user if to stop jboss
+         if not configFile:
+             print output_messages.INFO_NEED_STOP_JBOSS
+             answer = _askYesNo(output_messages.INFO_Q_STOP_JBOSS)
+             if answer:
+-                _handleJbossService('stop', output_messages.INFO_STOP_JBOSS, output_messages.ERR_FAILED_STP_JBOSS_SERVICE, True)
++                _handleEngineService('stop', output_messages.INFO_STOP_JBOSS, output_messages.ERR_FAILED_STP_JBOSS_SERVICE, True)
+             else:
+                 logging.debug("User chose not to stop jboss")
+                 return False
+         else:
+-            #we stop the jboss service on a silent install
+-            _handleJbossService('stop', output_messages.INFO_STOP_JBOSS, output_messages.ERR_FAILED_STP_JBOSS_SERVICE, True)
++            #we stop the service on a silent install
++            _handleEngineService('stop', output_messages.INFO_STOP_JBOSS, output_messages.ERR_FAILED_STP_JBOSS_SERVICE, True)
+     return True
+ 
+-def _handleJbossService(action, infoMsg, errMsg, printToStdout=False):
++def _handleEngineService(action, infoMsg, errMsg, printToStdout=False):
+     ''' stop or start the jbossas service
+         according to action param
+     '''
+-#    cmd = "%s jboss %s"  % (basedefs.EXEC_SERVICE, action)
+-    cmd = ["%s" % basedefs.EXEC_SERVICE, "jboss-as", "%s" % action]
++    cmd = ["%s" % basedefs.EXEC_SERVICE, "ovirt-engine", "%s" % action]
+     logging.debug(infoMsg)
+     if printToStdout:
+         print infoMsg
+@@ -1810,49 +1665,6 @@ def stopRhevmDbRelatedServices(etlService, notificationService):
+             logging.warn(traceback.format_exc())
+             messages.append(output_messages.ERR_FAILED_STOP_SERVICE % "rhevm-notiferd")
+ 
+-def deployJbossModules():
+-    """
+-    deploy the postgres module and edit the xml for the jdk module
+-    """
+-    try:
+-        # Copy module(s) from /usr/share/ovirt-engine/resources/jboss/modules
+-        logging.debug("Adding modules to jboss's modules")
+-        modules = [ { 'target' : "%s/org/postgresql" % basedefs.DIR_MODULES_SRC,
+-                      'link'   : "%s/org/postgresql" % basedefs.DIR_MODULES_DEST}
+-                  ]
+-        for module in modules:
+-            utils.replaceWithLink(module['target'], module['link'])
+-
+-        # edit module.xml for the jdk module
+-        backupFile = "%s.%i" % (basedefs.FILE_JDK_MODULE_XML, random.randint(1000000,9999999))
+-        editFile = "%s.%s.%i" % (basedefs.FILE_JDK_MODULE_XML, "EDIT", random.randint(1000000,9999999))
+-        logging.debug("Backing up %s into %s", basedefs.FILE_JDK_MODULE_XML, backupFile)
+-        utils.copyFile(basedefs.FILE_JDK_MODULE_XML, backupFile)
+-        utils.copyFile(basedefs.FILE_JDK_MODULE_XML, editFile)
+-
+-        logging.debug("loading xml file handler")
+-        xmlObj = utils.XMLConfigFileHandler(editFile)
+-        xmlObj.open()
+-
+-        logging.debug("registering name space")
+-        xmlObj.registerNs('module','urn:jboss:module:1.1')
+-
+-        paths = ['''<path name="sun/security"/>''', '''<path name="sun/security/krb5"/>''', '''<path name="com/sun/jndi/url"/>''', '''<path name="com/sun/jndi/url/dns"/>''' ]
+-
+-        for path in paths:
+-            logging.debug("adding %s as node", path)
+-            xmlObj.addNodes("//module:module/module:dependencies/module:system/module:paths", path)
+-
+-        xmlObj.close()
+-
+-        shutil.move(editFile, basedefs.FILE_JDK_MODULE_XML)
+-        logging.debug("JDK module configuration has been saved")
+-
+-    except:
+-        logging.error("Failed to deploy modules into jboss")
+-        logging.error(traceback.format_exc())
+-        raise output_messages.ERR_EXP_FAILED_DEPLOY_MODULES
+-
+ def configEncryptedPass():
+     """
+     push the encrypted password into standalone.xml
+@@ -1877,7 +1689,7 @@ def configEncryptedPass():
+         xmlObj.close()
+ 
+         shutil.move(editFile, basedefs.FILE_JBOSS_STANDALONE)
+-        os.chown(basedefs.FILE_JBOSS_STANDALONE, utils.getUsernameId("jboss-as"), utils.getGroupId("jboss-as"))
++        os.chown(basedefs.FILE_JBOSS_STANDALONE, utils.getUsernameId("ovirt"), utils.getGroupId("ovirt"))
+         logging.debug("Jboss configuration has been saved")
+ 
+     except:
+@@ -1908,8 +1720,6 @@ def configJbossXml():
+         xmlObj.registerNs('domain','urn:jboss:domain:1.1')
+ 
+         logging.debug("Configuring Jboss")
+-        configJbossLogging(xmlObj)
+-        configJbossDatasource(xmlObj)
+         configJbossNetwork(xmlObj)
+         configJbossSSL(xmlObj)
+         logging.debug("Jboss has been configured")
+@@ -1917,7 +1727,7 @@ def configJbossXml():
+         xmlObj.close()
+ 
+         shutil.move(editFile, basedefs.FILE_JBOSS_STANDALONE)
+-        os.chown(basedefs.FILE_JBOSS_STANDALONE, utils.getUsernameId("jboss-as"), utils.getGroupId("jboss-as"))
++        os.chown(basedefs.FILE_JBOSS_STANDALONE, utils.getUsernameId("ovirt"), utils.getGroupId("ovirt"))
+         logging.debug("Jboss configuration has been saved")
+ 
+     except:
+@@ -1925,151 +1735,6 @@ def configJbossXml():
+         logging.error(traceback.format_exc())
+         raise output_messages.ERR_EXP_FAILED_CONFIG_JBOSS
+ 
+-def configJbossLogging(xmlObj):
+-    """
+-    Configure the Logging for jboss
+-    """
+-    logging.debug("Configuring logging for jboss")
+-
+-    logging.debug("Registering logging namespace")
+-    xmlObj.registerNs('logging', 'urn:jboss:domain:logging:1.1')
+-
+-    logging.debug("setting attributes")
+-    nodes = xmlObj.xpathEval("//logging:subsystem/logging:console-handler[@name='CONSOLE']")
+-    nodes[0].setProp("autoflush", "true")
+-
+-    logging.debug("Adding level node with attribute: name, value: INFO")
+-    nodes = xmlObj.xpathEval("//logging:subsystem/logging:periodic-rotating-file-handler[@name='FILE']")
+-    nodes[0].setProp("autoflush", "true")
+-
+-
+-    xmlObj.removeNodes("//logging:subsystem/logging:periodic-rotating-file-handler[@name='FILE']/logging:level")
+-    levelStr = '''<level name="INFO" />'''
+-    xmlObj.addNodes("//logging:subsystem/logging:periodic-rotating-file-handler[@name='FILE']", levelStr)
+-
+-    xmlObj.removeNodes("//logging:subsystem/logging:size-rotating-file-handler[@name='ENGINE_LOG']")
+-    logging.debug("Adding file handler for ENGINE_LOG")
+-    fileHandlerStr = '''
+-    <size-rotating-file-handler name="ENGINE_LOG" autoflush="true">
+-        <level name="INFO"/>
+-        <formatter>
+-            <pattern-formatter pattern="%d %-5p [%c] (%t) %s%E%n"/>
+-        </formatter>
+-        <file path="/var/log/ovirt-engine/engine.log"/>
+-        <rotate-size value="1M"/>
+-        <max-backup-index value="30"/>
+-        <append value="true"/>
+-    </size-rotating-file-handler>
+-'''
+-    xmlObj.addNodes("//logging:subsystem", fileHandlerStr)
+-
+-    logging.debug("Adding Loggers for ovirt-engine")
+-    loggerCats = ["org.ovirt", "org.ovirt.engine.core.bll", "org.ovirt.engine.core.dal.dbbroker.PostgresDbEngineDialect$PostgresJdbcTemplate","org.springframework.ldap"]
+-    for loggerCat in loggerCats:
+-        xmlObj.removeNodes("//logging:subsystem/logging:logger[@category='%s']" % loggerCat)
+-
+-    loggers = ['''
+-    <logger category="org.ovirt">
+-        <level name="INFO"/>
+-        <handlers>
+-            <handler name="ENGINE_LOG"/>
+-        </handlers>
+-    </logger>
+-    ''','''
+-    <logger category="org.ovirt.engine.core.bll">
+-        <level name="INFO"/>
+-    </logger>
+-    ''','''
+-    <logger category="org.ovirt.engine.core.dal.dbbroker.PostgresDbEngineDialect$PostgresJdbcTemplate">
+-        <level name="WARN"/>
+-    </logger>
+-    ''','''
+-    <logger category="org.springframework.ldap">
+-        <level name="ERROR"/>
+-    </logger>
+-    ''']
+-
+-    for logger in loggers:
+-        xmlObj.addNodes("//logging:subsystem", logger)
+-
+-    logging.debug("Logging is enabled and configured in jboss's configuration")
+-
+-def configJbossDatasource(xmlObj):
+-    """
+-    configure the datasource for jboss
+-    """
+-    logging.debug("Configuring logging for jboss")
+-
+-    logging.debug("Registering datasource namespaces")
+-    xmlObj.registerNs('datasource', 'urn:jboss:domain:datasources:1.0')
+-    xmlObj.registerNs('deployment-scanner', 'urn:jboss:domain:deployment-scanner:1.0')
+-
+-    logging.debug("looking for ENGINEDatasource datasource")
+-
+-    # removeNodes will remove the node if it exists and will do nothing if it does not exist
+-    xmlObj.removeNodes("//datasource:subsystem/datasource:datasources/datasource:datasource[@jndi-name='java:/ENGINEDataSource']")
+-
+-    datasourceStr = '''
+-        <datasource jndi-name="java:/ENGINEDataSource" pool-name="ENGINEDataSource" enabled="true">
+-        <connection-url>
+-            jdbc:postgresql://localhost:5432/engine
+-        </connection-url>
+-        <driver>
+-            postgresql
+-        </driver>
+-        <transaction-isolation>
+-            TRANSACTION_READ_COMMITTED
+-        </transaction-isolation>
+-        <pool>
+-            <min-pool-size>
+-                1
+-            </min-pool-size>
+-            <max-pool-size>
+-                100
+-            </max-pool-size>
+-            <prefill>
+-                true
+-            </prefill>
+-        </pool>
+-        <security>
+-            <user-name>
+-                engine
+-            </user-name>
+-            <security-domain>
+-                EncryptDBPassword
+-            </security-domain>
+-        </security>
+-        <statement>
+-            <prepared-statement-cache-size>
+-                100
+-            </prepared-statement-cache-size>
+-        </statement>
+-    </datasource>
+-'''
+-    logging.debug("Adding ENGINE datasource")
+-    xmlObj.addNodes("//datasource:subsystem/datasource:datasources", datasourceStr)
+-
+-    logging.debug("Adding drivers to datasource")
+-    xmlObj.removeNodes("//datasource:subsystem/datasource:datasources/datasource:drivers/datasource:driver[@name='postgresql']")
+-    driversStr='''
+-    <drivers>
+-        <driver name="postgresql" module="org.postgresql">
+-            <xa-datasource-class>
+-                org.postgresql.xa.PGXADataSource
+-            </xa-datasource-class>
+-        </driver>
+-    </drivers>
+-'''
+-    xmlObj.addNodes("//datasource:subsystem/datasource:datasources", driversStr)
+-
+-    logging.debug("configuring deployment-scanner")
+-    node = xmlObj.xpathEval("//deployment-scanner:subsystem/deployment-scanner:deployment-scanner")[0]
+-    node.setProp("name","default")
+-    node.setProp("path","deployments")
+-    node.setProp("scan-enabled","true")
+-    node.setProp("deployment-timeout","60")
+-    logging.debug("Datasource has been added into jboss's configuration")
+-
+ def configJbossSecurity(xmlObj):
+     """
+     configure security for jboss
+@@ -2170,13 +1835,13 @@ def startRhevmDbRelatedServices(etlService, notificationService):
+ 
+ def runMainFunctions(conf):
+     # Create rhevm-slimmed jboss profile
+-    runFunction([_createJbossProfile, setMaxSharedMemory], output_messages.INFO_CONFIG_OVIRT_ENGINE)
++    runFunction([setMaxSharedMemory], output_messages.INFO_CONFIG_OVIRT_ENGINE)
+ 
+     # Create CA
+     runFunction(_createCA, output_messages.INFO_CREATE_CA)
+ 
+     # Edit JBoss configuration
+-    runFunction([configJbossXml, deployJbossModules, _editRootWar], output_messages.INFO_UPD_JBOSS_CONF)
++    runFunction([configJbossXml, _editRootWar], output_messages.INFO_UPD_JBOSS_CONF)
+ 
+     # Install rhevm db if it's not installed and running already
+     if _isDbAlreadyInstalled() == False:
+@@ -2219,14 +1884,10 @@ def runMainFunctions(conf):
+ 
+ def isSecondRun():
+     keystore = os.path.join(basedefs.DIR_OVIRT_PKI, ".keystore")
+-    engineLink = os.path.join(basedefs.DIR_JBOSS, "server", basedefs.JBOSS_PROFILE_NAME,"deploy","engine.ear")
+ 
+     if os.path.exists(keystore):
+         logging.debug("%s exists, second run detected", keystore)
+         return True
+-    elif os.path.exists(engineLink):
+-        logging.debug("%s exists, second run detected", engineLink)
+-        return True
+     else:
+         return False
+ 
+@@ -2247,7 +1908,7 @@ def main(configFile=None):
+                 return 0
+ 
+         #TODO: add validation to answer file before stopping jboss
+-        if not _checkJbossService(configFile):
++        if not _checkEngineService(configFile):
+             logging.debug("exiting gracefully")
+             print output_messages.INFO_STOP_INSTALL_EXIT
+             return 0
+@@ -2294,6 +1955,7 @@ def _checkAvailableMemory():
+     """
+     checks for memory using the "free" command
+     """
++    return
+     #execute free -g to get output in GB
+     logging.debug("checking total memory")
+     cmd = "%s -g" % basedefs.EXEC_FREE
diff --git a/ovirt-engine.spec b/ovirt-engine.spec
index 9ec2709..d80c8c1 100644
--- a/ovirt-engine.spec
+++ b/ovirt-engine.spec
@@ -6,28 +6,32 @@
 # Short names for directories:
 %global engine_data_dir %{_datadir}/%{name}
 %global engine_jar_dir %{_javadir}/%{name}
-%global engine_ear_dir %{engine_data_dir}/engine.ear
+%global engine_bin_dir %{engine_data_dir}/bin
+%global engine_modules_dir %{engine_data_dir}/modules
+%global engine_deployments_dir %{engine_data_dir}/deployments
+%global engine_content_dir %{_var}/lib/ovirt-engine
+%global engine_temp_dir %{_var}/cache/ovirt-engine
+%global engine_ear_dir %{engine_deployments_dir}/engine.ear
 %global engine_pki_dir %{_sysconfdir}/pki/%{name}
 %global restapi_war_dir %{engine_ear_dir}/restapi.war
+%global root_war_dir %{engine_deployments_dir}/ROOT.war
 
 # The name of the engine user and group:
 %global engine_group ovirt
 %global engine_user ovirt
 %global engine_uid 108
 
-# The name of the application server user and group:
-%global jboss_user jboss-as
-%global jboss_group jboss-as
-
-# JBoss application server modules directory:
-%global jboss_modules_dir %{_datadir}/jboss-as/modules
-
 # Directory to install python libraries:
 %global py_site_pkgs %(python -c "from distutils.sysconfig import get_python_lib as f;print f()")
 
+# Macro to create the engine user:
+%global create_engine_user \
+/bin/getent group %{engine_group} >/dev/null || /sbin/groupadd -r %{engine_group}; \
+/bin/getent passwd %{engine_user} >/dev/null || /sbin/useradd -c "oVirt Manager" -u %{engine_uid} -g %{engine_group} -s /bin/nologin %{engine_user}
+
 Name: ovirt-engine
 Version: %{upstream_version}.%{upstream_release}
-Release: 1%{?dist}
+Release: 12%{?dist}
 Summary: Management server for Open Virtualization
 Group: Applications/System
 License: ASL 2.0
@@ -135,25 +139,21 @@ Patch260: %{name}-replace-pubkey2ssh-with-ssh-keygen.patch
 # Use build-classpath in scripts:
 Patch270: %{name}-fix-classpath-building-in-scripts.patch
 
-# Update the namespaces used to locate tags in the standalone.xml file in JBoss
-# 7.1.1:
-Patch280: %{name}-fix-namespaces-for-jboss-7.1.1.patch
-
-# Move the sysprep filese to the /etc directory:
-# Upstream: http://gerrit.ovirt.org/3193
-Patch290: %{name}-move-sysprep-files-to-etc.patch
-
-# Several fixes, including permissions, in the Makefile:
-# Upstream: http://gerrit.ovirt.org/3248
-Patch300: %{name}-makefile-fixes.patch
-
 # Create the CA database files when needed instead of including them in the
 # package:
 Patch310: %{name}-create-database-and-serial-when-needed.patch
 
-# The required JBoss modules are part of the jboss-modules subpackage, so there
-# is no need for the setup tool to copy those files:
-Patch320: %{name}-dont-deploy-jboss-modules.patch
+# Add the modules required by the engine and those included with the
+# application server but that need to be overriden:
+Patch340: %{name}-add-modules.patch
+
+# Add the resteasy listener to the restapi, as the current version of the
+# application server doesn't include the bootstrap of resteasy:
+Patch350: %{name}-add-resteasy-listener-to-restapi.patch
+
+# Fixes for the makefile and for the setup tool:
+Patch360: %{name}-makefile-fixes.patch
+Patch370: %{name}-setup-fixes.patch
 
 # Add a README file:
 Patch1000: %{name}-add-readme.patch
@@ -162,6 +162,9 @@ Patch1000: %{name}-add-readme.patch
 # or webadmin:
 Patch1010: %{name}-replace-index-page.patch
 
+# The the service configuration and scripts:
+Patch1020: %{name}-add-systemd-service.patch
+
 # Build time requirements:
 BuildRequires: apache-commons-beanutils
 BuildRequires: apache-commons-codec
@@ -235,7 +238,7 @@ Requires: postgresql-server
 Requires: postgresql-contrib
 
 # Require JBoss AS 7:
-Requires: jboss-as
+Requires: jboss-as >= 7.1.0-3
 
 # Require the subpackages:
 Requires: %{name}-config = %{version}-%{release}
@@ -284,6 +287,7 @@ Requires: jakarta-commons-httpclient
 Requires: java
 Requires: javassist
 Requires: jboss-interceptors-1.1-api
+Requires: jsch
 Requires: objectweb-asm
 Requires: openssh
 Requires: openssl
@@ -417,13 +421,6 @@ The common libraries used by Open Virtualization Manager Tools.
 # Unpack and patch the sources:
 %setup -q -c -n %{name}-%{upstream_version}_%{upstream_release}
 
-# Remove some obsolete files:
-rm -rf backend/manager/conf/ca/Setup.txt
-
-# Remove extra modules that are not needed starting with JBoss AS 7.1:
-rm -rf deployment/modules/org/jboss/as/naming
-rm -rf deployment/modules/sun/jdk
-
 # Apply the patches:
 %patch1 -p1
 %patch0 -p1
@@ -452,13 +449,21 @@ rm -rf deployment/modules/sun/jdk
 %patch250 -p1
 %patch260 -p1
 %patch270 -p1
-%patch280 -p1
-%patch290 -p1
-%patch300 -p1
 %patch310 -p1
-%patch320 -p1
+%patch340 -p1
+%patch350 -p1
+%patch360 -p1
+%patch370 -p1
 %patch1000 -p1
 %patch1010 -p1
+%patch1020 -p1
+
+# Remove some obsolete files:
+rm -rf backend/manager/conf/ca/Setup.txt
+
+# Remove extra modules that are not needed starting with JBoss AS 7.1:
+rm -rf deployment/modules/org/jboss/as/naming
+rm -rf deployment/modules/sun/jdk
 
 # Fix the end of line of the database scripts:
 find backend/manager/dbscripts -type f -name '*.sh' -exec dos2unix {} \;
@@ -476,8 +481,8 @@ backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/api.py
 
 %build
 
-# Use the upstream makefile to do build, but instructing it to use mvn-rpmbuild
-# instead of regular mvn and to skip completely the tests, as we don't have the
+# Use the makefile to do build, but instructing it to use mvn-rpmbuild instead
+# of regular mvn and to skip completely the tests, as we don't have the
 # required dependencies:
 make \
   MVN="mvn-rpmbuild" \
@@ -488,8 +493,8 @@ make \
 
 %install
 
-# Use the upstream makefile to do the normal installation, after that we will
-# need to replace jar files with links to their actual locations:
+# Use the makefile to do the normal installation, after that we will need to
+# replace jar files with links to their actual locations:
 make \
   PREFIX="%{buildroot}" \
   install
@@ -550,7 +555,10 @@ backend/manager/tools/engine-notifier/engine-notifier-resources engine-notifier-
 
 # Remove all the jar files, as they have to be replaced with links pointing to
 # the actual locations:
-find %{buildroot}%{engine_ear_dir} -depth -name '*.jar' -exec rm -rf {} \;
+find %{buildroot}%{engine_deployments_dir} -depth -name '*.jar' -exec rm -rf {} \;
+
+# Remove manifests files as the dependencies there confuse the class loader:
+find %{buildroot}%{engine_deployments_dir} -name MANIFEST.MF -delete
 
 # Replace jar files in the ear with links to their actuals locations, first for
 # jar files from this package, as for these can't use build-classpath:
@@ -581,28 +589,31 @@ aopalliance
 apache-commons-beanutils
 apache-commons-codec
 apache-commons-collections
-apache-commons-httpclient
 apache-commons-lang
-dom4j
 apache-mina/mina-core
 apache-sshd/sshd-core
+bea-stax-api
+dom4j
+geronimo-validation
+jackson/jackson-core-asl
+jackson/jackson-mapper-asl
+jakarta-commons-httpclient
+jsch
+objectweb-asm/asm-all
 quartz
 slf4j/api
 slf4j/log4j12
-springframework/spring-instrument
 springframework/spring-aop
 springframework/spring-beans
 springframework/spring-context
 springframework/spring-core
+springframework/spring-instrument
 springframework/spring-jdbc
 springframework/spring-tx
 spring-ldap/spring-ldap-core
-bea-stax-api
-geronimo-validation
 ws-commons-util
 xmlrpc3-client
 xmlrpc3-common
-objectweb-asm/asm-all
 .
 
 # Replace jar files in the RESTAPI web application with links to ther actual
@@ -628,9 +639,7 @@ apache-commons-codec
 jakarta-commons-httpclient
 httpcomponents/httpclient
 httpcomponents/httpcore
-jackson/jackson-core-asl
 jackson/jackson-jaxrs
-jackson/jackson-mapper-asl
 jackson/jackson-xc
 javassist
 jaxb-api
@@ -663,17 +672,25 @@ cp -rp target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
 %dir %{_datadir}/%{name}/db-backups
 %dir %{_datadir}/%{name}/scripts
 %dir %{_localstatedir}/run/%{name}
-%dir %attr(-, %{jboss_user}, %{jboss_group}) %{_var}/log/%{name}
-%dir %attr(-, %{jboss_user}, %{jboss_group}) %{_var}/lock/%{name}
+%dir %attr(-, %{engine_user}, %{engine_group}) %{_var}/log/%{name}
+%dir %attr(-, %{engine_user}, %{engine_group}) %{_var}/lock/%{name}
 %{_datadir}/%{name}/scripts/vds_installer.py*
 %{_datadir}/%{name}/scripts/ovirtlogrot.sh
 %{_sysconfdir}/cron.daily/ovirt-cron
 %config(noreplace) %{_sysconfdir}/tmpfiles.d/ovirt-engine.conf
 
 # Engine configuration files:
-%dir %{_sysconfdir}/%{name}
-%config(noreplace) %{_sysconfdir}/%{name}/engine.conf
-%config(noreplace) %{_sysconfdir}/%{name}/web-conf.js
+%dir %attr(-, %{engine_user}, %{engine_group}) %{_sysconfdir}/%{name}
+%config(noreplace) %attr(-, %{engine_user}, %{engine_group}) %{_sysconfdir}/%{name}/engine.conf
+%config(noreplace) %attr(-, %{engine_user}, %{engine_group}) %{_sysconfdir}/%{name}/ovirt-engine.xml
+%config(noreplace) %attr(-, %{engine_user}, %{engine_group}) %{_sysconfdir}/%{name}/ovirt-engine-logging.properties
+%config(noreplace) %attr(-, %{engine_user}, %{engine_group}) %{_sysconfdir}/%{name}/ovirt-engine-users.properties
+%config(noreplace) %attr(-, %{engine_user}, %{engine_group}) %{_sysconfdir}/%{name}/web-conf.js
+
+# Files needed by the systemd service:
+%{engine_bin_dir}/ovirt-engine.sh
+%{_unitdir}/ovirt-engine.service
+%config(noreplace) %{_sysconfdir}/sysconfig/ovirt-engine
 
 # The main package owns the dependencies map and directory containing the jar
 # files (but not all its contents):
@@ -724,20 +741,28 @@ cp -rp target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
 %{_mavenpomdir}/JPP.%{name}-vdsbroker.pom
 %{_mavenpomdir}/JPP.%{name}-vdsbrokerbean.pom
 
+# Directory for the engine modules that complement and override those provided
+# by the application server:
+
+# Directories for the deployments, contents and temporary files need to be
+# owned by the engine because the application server needs to write to them:
+%dir %attr(-, %{engine_user}, %{engine_group}) %{engine_deployments_dir}
+%dir %attr(-, %{engine_user}, %{engine_group}) %{engine_content_dir}
+%dir %attr(-, %{engine_user}, %{engine_group}) %{engine_temp_dir}
+
 # This package owns the directory of the ear and some (not all) of its
 # contents:
 %dir %{engine_ear_dir}
 %dir %{engine_ear_dir}/lib
-
-# Manifests:
 %{engine_ear_dir}/META-INF
-
-# The EJBs and all the libraries in the lib directory are owned by the backend:
 %{engine_ear_dir}/engine-bll.jar
 %{engine_ear_dir}/engine-scheduler.jar
 %{engine_ear_dir}/engine-vdsbroker.jar
 %{engine_ear_dir}/lib/*.jar
 
+# Root web application:
+%{root_war_dir}
+
 # Sysprep files:
 %config(noreplace) %{_sysconfdir}/%{name}/sysprep
 
@@ -747,11 +772,11 @@ cp -rp target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
 
 # PKI Directories are owned by the application server because it needs to
 # create files inside:
-%dir %attr(-, %{jboss_user}, %{jboss_group}) %{engine_pki_dir}
-%dir %attr(-, %{jboss_user}, %{jboss_group}) %{engine_pki_dir}/certs
-%dir %attr(-, %{jboss_user}, %{jboss_group}) %{engine_pki_dir}/keys
-%dir %attr(-, %{jboss_user}, %{jboss_group}) %{engine_pki_dir}/private
-%dir %attr(-, %{jboss_user}, %{jboss_group}) %{engine_pki_dir}/requests
+%dir %attr(-, %{engine_user}, %{engine_group}) %{engine_pki_dir}
+%dir %attr(-, %{engine_user}, %{engine_group}) %{engine_pki_dir}/certs
+%dir %attr(-, %{engine_user}, %{engine_group}) %{engine_pki_dir}/keys
+%dir %attr(-, %{engine_user}, %{engine_group}) %{engine_pki_dir}/private
+%dir %attr(-, %{engine_user}, %{engine_group}) %{engine_pki_dir}/requests
 
 # PKI configuration files:
 %config(noreplace) %{engine_pki_dir}/openssl.conf
@@ -760,11 +785,14 @@ cp -rp target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
 
 # The certificate database files are not created by the RPM, but by the scripts
 # as needed:
-%ghost %attr(-, %{jboss_user}, %{jboss_group}) %{engine_pki_dir}/database.txt
-%ghost %attr(-, %{jboss_user}, %{jboss_group}) %{engine_pki_dir}/serial.txt
+%ghost %attr(-, %{engine_user}, %{engine_group}) %{engine_pki_dir}/database.txt
+%ghost %attr(-, %{engine_user}, %{engine_group}) %{engine_pki_dir}/serial.txt
 
-# PostgreSQL JDBC driver module:
-%{jboss_modules_dir}/org/postgresql
+# Modules:
+%dir %{engine_modules_dir}
+%{engine_modules_dir}/org/postgresql
+%{engine_modules_dir}/com/sun/xml/bind
+%{engine_modules_dir}/org/hibernate/validator
 
 
 %files config
@@ -844,8 +872,8 @@ cp -rp target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
 
 # Log and state directories must be owned by ovirt because the notifier service
 # runs with that user and needs to write them:
-%dir %attr(-, ovirt, ovirt) %{_var}/log/%{name}/notifier
-%dir %attr(-, ovirt, ovirt) %{_localstatedir}/run/%{name}/notifier
+%dir %attr(-, %{engine_user}, %{engine_group}) %{_var}/log/%{name}/notifier
+%dir %attr(-, %{engine_user}, %{engine_group}) %{_localstatedir}/run/%{name}/notifier
 
 # Configuration files:
 %dir %{_sysconfdir}/%{name}/notifier
@@ -913,20 +941,24 @@ cp -rp target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
 %{_mavenpomdir}/JPP.%{name}-engine-tools-common.pom
 
 
+# Create the ovirt group and group for all the subpackages that contain
+# files owned by them:
+%pre
+%create_engine_user
+
+%pre backend
+%create_engine_user
+
 %pre notification-service
+%create_engine_user
 
-# Create the ovirt group and user as it will be the used to run the service and
-# to own the log and state files:
-/bin/getent group %{engine_group} >/dev/null || \
-  /sbin/groupadd -r %{engine_group}
-/bin/getent passwd %{engine_user} >/dev/null || \
-  /sbin/useradd -c "Ovirt Manager" -u %{engine_uid} -g %{engine_group} -s /bin/nologin %{engine_user}
 
 %post notification-service
 
 # Register the service:
 /sbin/chkconfig --add engine-notifierd
 
+
 %preun notification-service
 
 # If the last version of the package is going to be removed then stop and
@@ -939,6 +971,10 @@ fi
 
 
 %changelog
+* Tue Apr 24 2012 Juan Hernandez <juan.hernandez at redhat.com> - 3.0.0.0001-12
+- Fixes needed to work with the jboss-as package
+- Added systemd service files
+
 * Thu Apr 12 2012 Juan Hernandez <juan.hernandez at redhat.com> - 3.0.0.0001-11
 - Moved the upstream release number to the version tag
 
@@ -980,4 +1016,3 @@ fi
 * Wed Oct 26 2011 Ronen Angluster <ranglust at redhat.com> - 3.0.0.0001-1
 - Initial build
 - Cloned from RHEVM spec file
-


More information about the scm-commits mailing list