Alexandros Kosiaris has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/249123

Change subject: otrs: Ship systemd unit file for OTRS Daemon
......................................................................

otrs: Ship systemd unit file for OTRS Daemon

OTRS 5.0.1 expanded more on the concept of the OTRS scheduler and
improved into an all generic Daemon. Remove the scheduler systemd unit
file present in OTRS 4.0.x and replace it with the OTRS daemon.
The daemon is also responsible for all cron jobs done in the past by the
various cronjobs so remove all of those as well

Change-Id: I789dd446efc5d5e20199d3cc50c9b0058b2863ed
---
D modules/otrs/files/crontab.otrs
M modules/otrs/manifests/init.pp
R modules/otrs/templates/initscripts/otrs-daemon.systemd.erb
3 files changed, 5 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/23/249123/1

diff --git a/modules/otrs/files/crontab.otrs b/modules/otrs/files/crontab.otrs
deleted file mode 100644
index 11bfa9b..0000000
--- a/modules/otrs/files/crontab.otrs
+++ /dev/null
@@ -1,31 +0,0 @@
-# installed by puppet, see puppet/files/otrs/crontab.otrs
-
-MAILTO="[email protected]"
-
-# delete expired cache every Sunday AM
-20 0 * * 0   otrs /opt/otrs/bin/otrs.DeleteCache.pl --expired > /dev/null 2>&1
-30 0 * * 0   otrs /opt/otrs/bin/otrs.LoaderCache.pl -o delete > /dev/null 2>&1
-
-# start generic agent (db) every 10 min
-*/10 * * * *     otrs /opt/otrs/bin/otrs.GenericAgent.pl -c db > /dev/null 2>&1
-
-# start generic agent (non-db) every 20 min
-*/20 * * * *     otrs /opt/otrs/bin/otrs.GenericAgent.pl > /dev/null 2>&1
-
-# check for pending jobs every 120 min
-45 */2 * * *     otrs /opt/otrs/bin/otrs.PendingJobs.pl > /dev/null 2>&1
-
-# check daily the spool directory of OTRS
-10 0 * * *   otrs /opt/otrs/bin/otrs.cleanup > /dev/null 2>&1
-
-# rebuild ticket index for OTRS daily
-01 01 * * *  otrs /opt/otrs/bin/otrs.RebuildTicketIndex.pl > /dev/null 2>&1
-
-# delete old/idle session ids every 2 hours
-55 */2 * * *     otrs /opt/otrs/bin/otrs.DeleteSessionIDs.pl --expired > 
/dev/null 2>&1
-
-# unlock old locked tickets hourly
-35 * * * *   otrs /opt/otrs/bin/otrs.UnlockTickets.pl --timeout > /dev/null 
2>&1
-
-# NOTE: This is here for completeness. It is NOT to be used under systemd 
otherwise it WILL cause problems
-# */5 * * * *  otrs /opt/otrs/bin/otrs.Scheduler.pl -w 1 > /dev/null 2>&1
diff --git a/modules/otrs/manifests/init.pp b/modules/otrs/manifests/init.pp
index f16631c..8a521d1 100644
--- a/modules/otrs/manifests/init.pp
+++ b/modules/otrs/manifests/init.pp
@@ -95,12 +95,9 @@
         content => template('otrs/Config.pm.erb'),
     }
 
+    # TODO: Remove this after the migration to 5.0.x is complete
     file { '/etc/cron.d/otrs':
-        ensure => 'file',
-        owner  => 'root',
-        group  => 'root',
-        mode   => '0444',
-        source => 'puppet:///modules/otrs/crontab.otrs',
+        ensure => absent,
     }
 
     file { '/opt/otrs/bin/otrs.TicketExport2Mbox.pl':
@@ -137,7 +134,7 @@
     # should not bite back as after the move the 3.2.x install we have will be
     # decomissioned
     if os_version('debian >= jessie') {
-        base::service_unit { 'otrs-scheduler':
+        base::service_unit { 'otrs-daemon':
             ensure  => present,
             upstart => false,
             systemd => true,
@@ -147,13 +144,6 @@
                 hasstatus  => true,
                 hasrestart => false,
             }
-        }
-        # OTRS normally ships a watchdog scheduler cron entry that watches the
-        # scheduler and restarts it if it dies. That mode unfortunately is not
-        # compatible with systemd. Purge the scheduler and rely on systemd to
-        # watch over the scheduler
-        file { '/etc/cron.d/otrs-scheduler':
-            ensure => absent,
         }
     }
 }
diff --git a/modules/otrs/templates/initscripts/otrs-scheduler.systemd.erb 
b/modules/otrs/templates/initscripts/otrs-daemon.systemd.erb
similarity index 67%
rename from modules/otrs/templates/initscripts/otrs-scheduler.systemd.erb
rename to modules/otrs/templates/initscripts/otrs-daemon.systemd.erb
index c26304e..323faad 100644
--- a/modules/otrs/templates/initscripts/otrs-scheduler.systemd.erb
+++ b/modules/otrs/templates/initscripts/otrs-daemon.systemd.erb
@@ -10,8 +10,8 @@
 RestartSec=2s
 TimeoutStopSec=60
 Type=forking
-ExecStart=/opt/otrs/bin/otrs.Scheduler.pl -a start --force
-ExecStop=/opt/otrs/bin/otrs.Scheduler.pl -a stop --force
+ExecStart=/opt/otrs/bin/otrs.Daemon.pl start --force
+ExecStop=/opt/otrs/bin/otrs.Daemon.pl stop --force
 
 [Install]
 WantedBy=multi-user.target

-- 
To view, visit https://gerrit.wikimedia.org/r/249123
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I789dd446efc5d5e20199d3cc50c9b0058b2863ed
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to