Hello Folks,

    In an effort to port Spacewalk's sysV init script to the
all-new-and-shiny systemd, Marcelo Mello and I have created quite a few
"unit files" (systemd speak for init script).

    Due to service dependencies, we want to propose a new layout to make
it compatible with the systemd approach.


Mandatory and dependent services
---------------------------

    Since Spacewalk is not a daemon, but a collection of daemons, we
created a target-type file (named spacewalk.target) which will just call
all child services required by Spacewalk (jabberd, osa-dispatcher,
tomcat, httpd, rhn-search, cobbler and taskomatic). On start, stop,
restart and reload, spacewalk.target will perform the same action on all
dependencies.

    We also had to include dependency info in a few of those services,
so we named them spacewalk-SERVICENAME, as in spacewalk-httpd,
spacewalk-cobblerd and spacewalk-tomcat6. The original httpd, cobblerd
and tomcat6 service files remain untouched. However, starting the
original httpd service file will immediately stop spacewalk-httpd, and
so on for cobblerd and tomcat6.


Independent services
----------------------------

    DB_service (postgresql) and Monitoring and MonitoringScout - since
these services are not mandatory for running Spacewalk, they will
require a second step from the sysadmin which is to enable it manually:

             # systemctl enable <service>.service

For example:

             # systemctl enable MonitoringScout.service


   Follow below the output calling each script and reporting the results:

# grep "SERVICES=" `which spacewalk-service`
SERVICES="jabberd $DB_SERVICE $TOMCAT httpd osa-dispatcher Monitoring
MonitoringScout rhn-search cobblerd taskomatic"

# systemctl start jabberd.service
# ^start^status
systemctl start jabberd.service
jabberd.service - Next generation of the jabberd server
          Loaded: loaded (/etc/systemd/system/jabberd.service; static)

          Active: active (running) since Mon, 02 Apr 2012 16:47:03
-0300; 4s ago
         Process: 16064 ExecStop=/etc/init.d/jabberd stop (code=exited,
status=0
/SUCCESS)

         Process: 16121 ExecStart=/etc/init.d/jabberd start
(code=exited, status
=0/SUCCESS)

          CGroup: name=systemd:/system/jabberd.service
                  &#9500; 16127 /usr/bin/router -c /etc/jabberd//router.xml
                  &#9500; 16134 /usr/bin/sm -c /etc/jabberd//sm.xml
                  &#9500; 16141 /usr/bin/c2s -c /etc/jabberd//c2s.xml
                  &#9492; 16148 /usr/bin/s2s -c /etc/jabberd//s2s.xml


# systemctl start <my_db_service>.service
# ^start^status
systemctl status <my_db_service>.service
(output will depend on your DB service)

# systemctl start tomcat6.service
# ^start^status
systemctl status tomcat6.service

tomcat6.service - Apache Tomcat6 Web Application Container
        |
          Loaded: loaded (/lib/systemd/system/tomcat6.service; enabled)

          Active: active (running) since Mon, 02 Apr 2012 16:53:37
-0300; 1min 2
2s ago

         Process: 16181 ExecStart=/usr/sbin/tomcat6-sysd start
(code=exited, sta
tus=0/SUCCESS)

        Main PID: 16217 (java)
          CGroup: name=systemd:/system/tomcat6.service
                  &#9492; 16217 /usr/lib/jvm/jre/bin/java -ea -Xms256m
-Xmx256m -D...

# systemctl start spacewalk-tomcat6.service
# ^start^status
systemctl status spacewalk-tomcat6.service

spacewalk-tomcat6.service - Spacewalk's Apache Tomcat6 Web Application
Container
          Loaded: loaded (/etc/systemd/system/spacewalk-tomcat6.service;
static)
          Active: active (running) since Mon, 02 Apr 2012 16:56:41
-0300; 4s ago
         Process: 16320 ExecStart=/usr/sbin/tomcat6-sysd start
(code=exited, sta
tus=0/SUCCESS)

        Main PID: 16356 (java)
          CGroup: name=systemd:/system/spacewalk-tomcat6.service
                  &#9492; 16356 /usr/lib/jvm/jre/bin/java -ea -Xms256m
-Xmx256m -D...

# systemctl start spacewalk-httpd.service
# ^start^status
systemctl status spacewalk-httpd.service

spacewalk-httpd.service - The Apache HTTP Server (prefork MPM)

          Loaded: loaded (/etc/systemd/system/spacewalk-httpd.service;
static)
          Active: active (running) since Mon, 02 Apr 2012 16:56:46
-0300; 34s ago

         Process: 16357 ExecStart=/usr/sbin/httpd $OPTIONS -k start
(code=exited, status=0/SUCCESS)

        Main PID: 16367 (/usr/sbin/httpd)
          CGroup: name=systemd:/system/spacewalk-httpd.service
                  &#9500; 16367 /usr/sbin/httpd -k start
                  &#9500; 16368 /usr/bin/perl /usr/share/rhn/satidmap.pl
                  &#9500; 16372 /usr/sbin/httpd -k start
                  &#9500; 16373 /usr/sbin/httpd -k start
                  &#9500; 16374 /usr/sbin/httpd -k start
                  &#9500; 16375 /usr/sbin/httpd -k start
                  &#9500; 16376 /usr/sbin/httpd -k start
                  &#9500; 16377 /usr/sbin/httpd -k start
                  &#9500; 16378 /usr/sbin/httpd -k start
                  &#9492; 16379 /usr/sbin/httpd -k start

# systemctl start osa-dispatcher.service
# ^start^status
systemctl status osa-dispatcher.service

osa-dispatcher.service - osa-dispatcher daemon used by Spacewalk

          Loaded: loaded (/etc/systemd/system/osa-dispatcher.service;
static)
          Active: active (running) since Mon, 02 Apr 2012 16:56:41
-0300; 1min 58s ago

         Process: 16313 ExecStart=/etc/init.d/osa-dispatcher start
(code=exited, status=0/SUCCESS)

        Main PID: 16318 (osa-dispatcher)
          CGroup: name=systemd:/system/osa-dispatcher.service
                  &#9492; 16318 /usr/bin/python /usr/sbin/osa-dispatcher
--pid-fil...

# systemctl start Monitoring.service
# ^start^status
systemctl status Monitoring.service

Monitoring.service - NOCpulse Monitoring

          Loaded: loaded (/etc/systemd/system/Monitoring.service;
static)
          Active: active (running) since Mon, 02 Apr 2012 17:06:12
-0300; 13s ag
o

         Process: 16756 ExecStop=/usr/sbin/Monitoring stop (code=exited,
status=
0/SUCCESS)

         Process: 16793 ExecStart=/usr/sbin/Monitoring start
(code=exited, statu
s=0/SUCCESS)

          CGroup: name=systemd:/system/Monitoring.service
                  &#9500; 16800 /usr/bin/perl /usr/bin/gogo.pl
--fname=NotifEscala...
                  &#9500; 16801 /usr/bin/perl /usr/bin/gogo.pl
--fname=NotifEscala...
                  &#9500; 16802 /usr/bin/perl /usr/bin/notif-escalator
                  &#9500; 16820 /usr/bin/perl /usr/bin/gogo.pl
--fname=GenerateNot...
                  &#9500; 16821 /usr/bin/perl /usr/bin/gogo.pl
--fname=GenerateNot...
                  &#9500; 16822 /usr/bin/perl /usr/bin/generate-config
                  &#9500; 16835 /usr/bin/perl /usr/bin/gogo.pl
--fname=NotifLaunch...
                  &#9500; 16836 /usr/bin/perl /usr/bin/gogo.pl
--fname=NotifLaunch...
                  &#9500; 16837 /usr/bin/perl /usr/bin/notif-launcher
                  &#9500; 16852 /usr/bin/perl /usr/bin/gogo.pl
--fname=Notifier --...
                  &#9500; 16853 /usr/bin/perl /usr/bin/gogo.pl
--fname=Notifier --...
                  &#9500; 16854 /usr/bin/perl /usr/bin/notifier
                  &#9500; 16871 /usr/bin/perl /usr/bin/gogo.pl
--fname=AckProcesso...
                  &#9500; 16872 /usr/bin/perl /usr/bin/gogo.pl
--fname=AckProcesso...
                  &#9500; 16873 /usr/bin/perl /usr/bin/ack-processor
              |
                  &#9500; 16893 /usr/bin/perl /usr/bin/gogo.pl
--fname=TSDBLocalQu... |
                  &#9500; 16894 /usr/bin/perl /usr/bin/gogo.pl
--fname=TSDBLocalQu... |
                  &#9492; 16895 /usr/bin/perl /usr/bin/TSDBLocalQueue.pl

# systemctl start MonitoringScout.service
# ^start^status                                            |
systemctl status MonitoringScout.service
        |
MonitoringScout.service - NOCpulse Monitoring Scout
        |
          Loaded: loaded (/etc/systemd/system/MonitoringScout.service;
static)  |
          Active: active (running) since Mon, 02 Apr 2012 17:08:15
-0300; 26s ag
o

         Process: 16775 ExecStop=/usr/sbin/MonitoringScout stop
(code=exited, st
atus=0/SUCCESS)

         Process: 17211 ExecStart=/usr/sbin/MonitoringScout start
(code=exited,
status=0/SUCCESS)

          CGroup: name=systemd:/system/MonitoringScout.service
                  &#9500; 17390 /usr/bin/perl /usr/bin/gogo.pl
--fname=SputLite --...
                  &#9500; 17392 /usr/bin/perl /usr/bin/gogo.pl
--fname=SputLite --...
                  &#9500; 17394 /usr/bin/perl /usr/bin/execute_commands
                  &#9500; 17413 /usr/bin/perl /usr/bin/gogo.pl
--fname=Dequeuer --...
                  &#9500; 17414 /usr/bin/perl /usr/bin/gogo.pl
--fname=Dequeuer --...
                  &#9500; 17415 /usr/bin/perl /usr/bin/dequeue
                  &#9492; 17443 /usr/bin/perl /usr/bin/gogo.pl
--fname=Dispatcher ...

# systemctl start rhn-search.service
# ^start^status
systemctl status rhn-search.service
rhn-search.service - Spacewalk search engine
          Loaded: loaded (/etc/systemd/system/rhn-search.service; static)
          Active: active (running) since Mon, 02 Apr 2012 16:56:50
-0300; 13min ago
         Process: 16395 ExecStart=/etc/init.d/rhn-search start
(code=exited, status=0/SUCCESS)
        Main PID: 16411 (rhnsearchd)
          CGroup: name=systemd:/system/rhn-search.service
                  &#9500; 16411 /usr/bin/rhnsearchd
/usr/share/rhn/config-defaults/rhn_search_daemon.conf
wrapper.pidfile=/var/run/rhn-sear...
                  &#9492; 16413 /usr/bin/java
-Djava.library.path=/usr/lib:/usr/lib64:/usr/lib/oracle/11.2/client/lib:/usr/lib/oracle/11.2/...

# systemctl start spacewalk-cobblerd.service
# ^start^status
systemctl status spacewalk-cobblerd.service
spacewalk-cobblerd.service - Spacewalk's Cobbler Helper Daemon
          Loaded: loaded
(/etc/systemd/system/spacewalk-cobblerd.service; static)
          Active: active (exited) since Mon, 02 Apr 2012 16:56:54 -0300;
13min ago
         Process: 16423 ExecStart=/usr/bin/cobblerd (code=exited,
status=0/SUCCESS)
          CGroup: name=systemd:/system/spacewalk-cobblerd.service
                  &#9492; 16432 /usr/bin/python /usr/bin/cobblerd

# systemctl start taskomatic.service
# ^start^status
systemctl status taskomatic.service
taskomatic.service - Taskomatic task execution scheduler system
          Loaded: loaded (/etc/systemd/system/taskomatic.service; static)
          Active: active (running) since Mon, 02 Apr 2012 16:56:55
-0300; 15min ago
         Process: 16433 ExecStart=/etc/init.d/taskomatic start
(code=exited, status=0/SUCCESS)
        Main PID: 16449 (taskomaticd)
          CGroup: name=systemd:/system/taskomatic.service
                  &#9500; 16449 /usr/bin/taskomaticd
/usr/share/rhn/config-defaults/rhn_taskomatic_daemon.conf
wrapper.pidfile=/var/run//ta...
                  &#9492; 16543 /usr/bin/java
-Dibm.dst.compatibility=true -Xms256m -Xmx512m
-Djava.library.path=/usr/lib:/usr/lib64:/usr/l...


   Follow below the output calling the global script and report the results:

# systemctl start spacewalk.target
# ^start^status
spacewalk.target - Spacewalk
          Loaded: loaded (/etc/systemd/system/spacewalk.target; enabled)
          Active: active since Mon, 02 Apr 2012 17:20:40 -0300; 2min 2s ago




Current status
----------------------------

Currently, the main spacewalk unit file (spacewalk.target) issues
start/stop/restart/reload commands to all its dependencies. However,
spacewalk-tomcat6.service is facing a few issues when stopping:

# systemctl stop spacewalk.target
# systemctl status spacewalk.target
spacewalk.target - Spacewalk
          Loaded: loaded (/etc/systemd/system/spacewalk.target; enabled)
          Active: inactive (dead) since Mon, 02 Apr 2012 17:23:28 -0300;
9min ago

# systemctl status jabberd.service
jabberd.service - Next generation of the jabberd server
          Loaded: loaded (/etc/systemd/system/jabberd.service; static)
          Active: inactive (dead) since Mon, 02 Apr 2012 17:23:28 -0300;
11min ago
         Process: 22642 ExecStop=/etc/init.d/jabberd stop (code=exited,
status=0/SUCCESS)
         Process: 21350 ExecStart=/etc/init.d/jabberd start
(code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/jabberd.service

# systemctl status spacewalk-tomcat6.service
spacewalk-tomcat6.service - Spacewalk's Apache Tomcat6 Web Application
Container
          Loaded: loaded (/etc/systemd/system/spacewalk-tomcat6.service;
static)
          Active: failed since Mon, 02 Apr 2012 17:23:21 -0300; 10min ago
         Process: 22589 ExecStop=/usr/sbin/tomcat6-sysd stop
(code=exited, status=0/SUCCESS)
         Process: 21392 ExecStart=/usr/sbin/tomcat6-sysd start
(code=exited, status=0/SUCCESS)
        Main PID: 21428 (code=exited, status=143)
          CGroup: name=systemd:/system/spacewalk-tomcat6.service


Note that spacewalk-tomcat6.service is marked "failed", whereas
jabberd.service and every other spacewalk service is marked "inactive".
This means that the spacewalk-tomcat6.service is not stopping Tomcat
gracefully.

This should be easily fixable once we are able to track down the cause
for this issue.



Changes for sysadmins
----------------------------

Systemd is different from sysV and Upstart and it requires a few changes
in the way sysadmins enable the Spacewalk service. For instance, if the
DB service is independent from Spacewalk, then a regular "systemctl
enable spacewalk.target" should suffice.

However, if the DB service is PostgreSQL and its only reason to live is
to serve Spacewalk, it should be associated to the Spacewalk service
file like this:
# systemctl enable spacewalk-postgresql.service



Is this acceptable?
----------------------------

Are these changes acceptable to you?

We could have gone with just calling the "spacewalk-service" with a
start/stop/reload argument, and employ one single unit file for that.
However, the approach we chose is way more future-proof in that it
actually ports most of the script's functionalities to native systemd
unit files.

Please see the patch below if you find this approach acceptable.

-- 
Pablo N. Hess
RHCA, RHCVA, RHCX, RHCI, RHCE
Instructor - Red Hat
ph...@redhat.com
+55 11 9325-3016
PGP fingerprint: D34B F26B A96F
3CFC 87CE 3F23 12F3 05F3 1CF9 5486





>From a5bb85c80fe2db207233c9e72124a5286dadd7ae Mon Sep 17 00:00:00 2001
From: Pablo Hess <ph...@redhat.com>
Date: Mon, 2 Apr 2012 18:28:35 -0300
Subject: [PATCH] Added systemd unit files

---
 spacewalk/systemd-units/Monitoring.service         |   14 +++++
 spacewalk/systemd-units/MonitoringScout.service    |   14 +++++
 spacewalk/systemd-units/jabberd.service            |   16 ++++++
 spacewalk/systemd-units/osa-dispatcher.service     |   15 ++++++
 spacewalk/systemd-units/rhn-search.service         |   14 +++++
 spacewalk/systemd-units/spacewalk-cobblerd.service |   15 ++++++
 spacewalk/systemd-units/spacewalk-db.target        |    5 ++
 spacewalk/systemd-units/spacewalk-httpd.service    |   21 ++++++++
 spacewalk/systemd-units/spacewalk-tomcat6.service  |   22 ++++++++
 spacewalk/systemd-units/spacewalk.target           |   51
++++++++++++++++++++
 spacewalk/systemd-units/taskomatic.service         |   14 +++++
 11 files changed, 201 insertions(+), 0 deletions(-)
 create mode 100644 spacewalk/systemd-units/Monitoring.service
 create mode 100644 spacewalk/systemd-units/MonitoringScout.service
 create mode 100644 spacewalk/systemd-units/jabberd.service
 create mode 100644 spacewalk/systemd-units/osa-dispatcher.service
 create mode 100644 spacewalk/systemd-units/rhn-search.service
 create mode 100644 spacewalk/systemd-units/spacewalk-cobblerd.service
 create mode 100644 spacewalk/systemd-units/spacewalk-db.target
 create mode 100644 spacewalk/systemd-units/spacewalk-httpd.service
 create mode 100644 spacewalk/systemd-units/spacewalk-tomcat6.service
 create mode 100644 spacewalk/systemd-units/spacewalk.target
 create mode 100644 spacewalk/systemd-units/taskomatic.service

diff --git a/spacewalk/systemd-units/Monitoring.service
b/spacewalk/systemd-units/Monitoring.service
new file mode 100644
index 0000000..2ad88d5
--- /dev/null
+++ b/spacewalk/systemd-units/Monitoring.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=NOCpulse Monitoring
+After=spacewalk-httpd.service
+Before=MonitoringScout.service
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/Monitoring start
+ExecStop=/usr/sbin/Monitoring stop
+ExecReload=/usr/sbin/Monitoring reload
+
+[Install]
+#WantedBy=spacewalk.service
+
diff --git a/spacewalk/systemd-units/MonitoringScout.service
b/spacewalk/systemd-units/MonitoringScout.service
new file mode 100644
index 0000000..a77d3ec
--- /dev/null
+++ b/spacewalk/systemd-units/MonitoringScout.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=NOCpulse Monitoring Scout
+After=Monitoring.service
+Before=rhn-search.service
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/MonitoringScout start
+ExecStop=/usr/sbin/MonitoringScout stop
+ExecReload=/usr/sbin/MonitoringScout reload
+
+[Install]
+#WantedBy=spacewalk.service
+
diff --git a/spacewalk/systemd-units/jabberd.service
b/spacewalk/systemd-units/jabberd.service
new file mode 100644
index 0000000..8235cc8
--- /dev/null
+++ b/spacewalk/systemd-units/jabberd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Next generation of the jabberd server
+Before=spacewalk-db.target
+# Please include any other ordering info here
+
+
+[Service]
+Type=forking
+ExecStart=/etc/init.d/jabberd start
+ExecStop=/etc/init.d/jabberd stop
+ExecReload=/etc/init.d/jabberd reload
+
+[Install]
+#WantedBy=spacewalk.target
+# Please include any other dependency info here
+
diff --git a/spacewalk/systemd-units/osa-dispatcher.service
b/spacewalk/systemd-units/osa-dispatcher.service
new file mode 100644
index 0000000..b7fdd4c
--- /dev/null
+++ b/spacewalk/systemd-units/osa-dispatcher.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=osa-dispatcher daemon used by Spacewalk
+Before=spacewalk-tomcat6.service
+After=spacewalk-db.target
+
+[Service]
+Type=forking
+#EnvironmentFile=/etc/sysconfig/network
+#EnvironmentFile=/etc/sysconfig/osa-dispatcher
+#ExecStart=/usr/sbin/osa-dispatcher
+ExecStart=/etc/init.d/osa-dispatcher start
+ExecStop=/etc/init.d/osa-dispatcher stop
+PIDFile=/var/run/osa-dispatcher.pid
+
+[Install]
diff --git a/spacewalk/systemd-units/rhn-search.service
b/spacewalk/systemd-units/rhn-search.service
new file mode 100644
index 0000000..5eecdb2
--- /dev/null
+++ b/spacewalk/systemd-units/rhn-search.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Spacewalk search engine
+After=spacewalk-httpd.service
+After=Monitoring.service MonitoringScout.service
+Before=spacewalk-cobblerd.service
+
+[Service]
+Type=forking
+ExecStart=/etc/init.d/rhn-search start
+ExecStop=/etc/init.d/rhn-search stop
+
+[Install]
+#WantedBy=spacewalk.service
+
diff --git a/spacewalk/systemd-units/spacewalk-cobblerd.service
b/spacewalk/systemd-units/spacewalk-cobblerd.service
new file mode 100644
index 0000000..5c52c04
--- /dev/null
+++ b/spacewalk/systemd-units/spacewalk-cobblerd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Spacewalk's Cobbler Helper Daemon
+After=rhn-search.service
+Before=taskomatic.service
+# Cobbler's regular ordering
+After=syslog.target network.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/cobblerd
+RemainAfterExit=yes
+
+[Install]
+#WantedBy=multi-user.target
+
diff --git a/spacewalk/systemd-units/spacewalk-db.target
b/spacewalk/systemd-units/spacewalk-db.target
new file mode 100644
index 0000000..ecccadf
--- /dev/null
+++ b/spacewalk/systemd-units/spacewalk-db.target
@@ -0,0 +1,5 @@
+[Unit]
+Description=Spacewalk Database
+After=jabberd.service
+
+[Install]
diff --git a/spacewalk/systemd-units/spacewalk-httpd.service
b/spacewalk/systemd-units/spacewalk-httpd.service
new file mode 100644
index 0000000..a5748cc
--- /dev/null
+++ b/spacewalk/systemd-units/spacewalk-httpd.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=The Apache HTTP Server (prefork MPM)
+Conflicts=httpd.service
+After=spacewalk-tomcat6.service
+Before=rhn-search.service
+# These services are not mandatory for Spacewalk
+Before=Monitoring.service MonitoringScout.service
+# Apache's regular ordering
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/httpd/httpd.pid
+EnvironmentFile=/etc/sysconfig/httpd
+ExecStart=/usr/sbin/httpd $OPTIONS -k start
+ExecReload=/usr/sbin/httpd $OPTIONS -t
+ExecReload=/bin/kill -HUP $MAINPID
+ExecStop=/usr/sbin/httpd $OPTIONS -k stop
+
+[Install]
+#WantedBy=multi-user.target
diff --git a/spacewalk/systemd-units/spacewalk-tomcat6.service
b/spacewalk/systemd-units/spacewalk-tomcat6.service
new file mode 100644
index 0000000..c324e13
--- /dev/null
+++ b/spacewalk/systemd-units/spacewalk-tomcat6.service
@@ -0,0 +1,22 @@
+# Systemd unit file for tomcat6
+#
+# To create clones of this service:
+# 1) By default SERVICE_NAME=tomcat6. When cloned, the value must be
defined
+# before tomcat6-sysd is called.
+# 2) Create /etc/sysconfig/${SERVICE_NAME} from /etc/sysconfig/tomcat6
+# to override tomcat6 defaults
+
+[Unit]
+Description=Spacewalk's Apache Tomcat6 Web Application Container
+After=osa-dispatcher.service
+Before=spacewalk-httpd.service
+# This is Tomcat6's regular ordering
+After=syslog.target network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/tomcat6-sysd start
+ExecStop=/usr/sbin/tomcat6-sysd stop
+
+[Install]
+#WantedBy=multi-user.target
diff --git a/spacewalk/systemd-units/spacewalk.target
b/spacewalk/systemd-units/spacewalk.target
new file mode 100644
index 0000000..bbb0ff9
--- /dev/null
+++ b/spacewalk/systemd-units/spacewalk.target
@@ -0,0 +1,51 @@
+[Unit]
+Description=Spacewalk
+
+Requires=network.target
+Requires=spacewalk-httpd.service
+Requires=spacewalk-tomcat6.service
+Requires=jabberd.service
+Requires=osa-dispatcher.service
+Requires=taskomatic.service
+Requires=rhn-search.service
+Requires=spacewalk-db.target
+Requires=spacewalk-cobblerd.service
+Requires=MonitoringScout.service
+Requires=Monitoring.service
+
+Before=network.target
+Before=spacewalk-httpd.service
+Before=spacewalk-tomcat6.service
+Before=jabberd.service
+Before=osa-dispatcher.service
+Before=taskomatic.service
+Before=rhn-search.service
+Before=spacewalk-db.target
+Before=spacewalk-cobblerd.service
+Before=MonitoringScout.service
+Before=Monitoring.service
+
+PropagateReloadTo=network.target
+PropagateReloadTo=spacewalk-httpd.service
+PropagateReloadTo=spacewalk-tomcat6.service
+PropagateReloadTo=jabberd.service
+PropagateReloadTo=osa-dispatcher.service
+PropagateReloadTo=taskomatic.service
+PropagateReloadTo=rhn-search.service
+PropagateReloadTo=spacewalk-db.target
+PropagateReloadTo=spacewalk-cobblerd.service
+PropagateReloadTo=MonitoringScout.service
+PropagateReloadTo=Monitoring.service
+
+[Install]
+WantedBy=multi-user.target
+Alias=spacewalk-httpd.service.requires/spacewalk.target
+Alias=spacewalk-tomcat6.service.requires/spacewalk.target
+Alias=jabberd.service.requires/spacewalk.target
+Alias=osa-dispatcher.service.requires/spacewalk.target
+Alias=taskomatic.service.requires/spacewalk.target
+Alias=rhn-search.service.requires/spacewalk.target
+Alias=spacewalk-db.target.requires/spacewalk.target
+Alias=spacewalk-cobblerd.service.requires/spacewalk.target
+Alias=Monitoring.service.requires/spacewalk.target
+Alias=MonitoringScout.service.requires/spacewalk.target
diff --git a/spacewalk/systemd-units/taskomatic.service
b/spacewalk/systemd-units/taskomatic.service
new file mode 100644
index 0000000..e0a38d7
--- /dev/null
+++ b/spacewalk/systemd-units/taskomatic.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Taskomatic task execution scheduler system
+After=spacewalk-cobbler.service
+
+[Service]
+Type=forking
+ExecStart=/etc/init.d/taskomatic start
+ExecStop=/etc/init.d/taskomatic stop
+ExecReload=/etc/init.d/taskomatic reload
+
+[Install]
+#WantedBy=spacewalk.service
+
+
-- 
1.7.1

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to