KartikMistry has uploaded a new change for review.
https://gerrit.wikimedia.org/r/297350
Change subject: WIP: Configurable mode_patch for apertium
......................................................................
WIP: Configurable mode_patch for apertium
Bug: T139330
Change-Id: Ia8ee5f67848003b0cf900261d5bb70089de806c4
---
M modules/apertium/manifests/init.pp
M modules/apertium/templates/initscripts/apertium-apy.systemd.erb
M modules/apertium/templates/initscripts/apertium-apy.upstart.erb
3 files changed, 5 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/50/297350/1
diff --git a/modules/apertium/manifests/init.pp
b/modules/apertium/manifests/init.pp
index 65db282..de77b77 100644
--- a/modules/apertium/manifests/init.pp
+++ b/modules/apertium/manifests/init.pp
@@ -13,11 +13,14 @@
# The username apertium-apy will run with
# [*gid*]
# The group apertium-apy will run with
+# [*mode_path*]
+# Path to use for language pairs mode.
class apertium(
$num_of_processes = 1,
$max_idle_seconds = 300,
$uid = 'apertium',
$gid = 'apertium',
+ $mode_path = '/usr/share/apertium/modes',
) {
include ::service::configuration
diff --git a/modules/apertium/templates/initscripts/apertium-apy.systemd.erb
b/modules/apertium/templates/initscripts/apertium-apy.systemd.erb
index de643e6..1265df0 100644
--- a/modules/apertium/templates/initscripts/apertium-apy.systemd.erb
+++ b/modules/apertium/templates/initscripts/apertium-apy.systemd.erb
@@ -17,7 +17,7 @@
# https://www.python.org/dev/peps/pep-3143/#correct-daemon-behaviour
# it only seems to do the first. So we abuse it a bit to get standard behaviour
# and better logging
-ExecStart=/usr/bin/python3 /usr/share/apertium-apy/servlet.py -j<%=
@num_of_processes %> -m<%= @max_idle_seconds %> --daemon --log-path <%=
@log_dir %> /usr/share/apertium/modes
+ExecStart=/usr/bin/python3 /usr/share/apertium-apy/servlet.py -j<%=
@num_of_processes %> -m<%= @max_idle_seconds %> --daemon --log-path <%=
@log_dir %> <%= @mode_path %>
[Install]
WantedBy=multi-user.target
diff --git a/modules/apertium/templates/initscripts/apertium-apy.upstart.erb
b/modules/apertium/templates/initscripts/apertium-apy.upstart.erb
index 15c5069..b5bc068 100644
--- a/modules/apertium/templates/initscripts/apertium-apy.upstart.erb
+++ b/modules/apertium/templates/initscripts/apertium-apy.upstart.erb
@@ -21,7 +21,7 @@
# https://www.python.org/dev/peps/pep-3143/#correct-daemon-behaviour
# it only seems to do the first. So we abuse it a bit to get standard behaviour
# and better logging
-exec /usr/bin/python3 /usr/share/apertium-apy/servlet.py -j<%=
@num_of_processes %> -m<%= @max_idle_seconds %> --daemon --log-path <%=
@log_dir %> /usr/share/apertium/modes
+exec /usr/bin/python3 /usr/share/apertium-apy/servlet.py -j<%=
@num_of_processes %> -m<%= @max_idle_seconds %> --daemon --log-path <%=
@log_dir %> <%= @mode_path %>
# wait 60 seconds for a graceful restart before killing the master
kill timeout 60
--
To view, visit https://gerrit.wikimedia.org/r/297350
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8ee5f67848003b0cf900261d5bb70089de806c4
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: KartikMistry <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits