Dzahn has submitted this change and it was merged.

Change subject: phabricator: add systemd unit file for phd service
......................................................................


phabricator: add systemd unit file for phd service

The phd service currently fails on phab2001.codfw.wmnet on jessie,
with "Unit phd.service failed to load: No such file or directory."

This adds the missing unit file if the init system is systemd.

The upstream ticket https://secure.phabricator.com/T4181 is about
the missing init scripts and in the comments people have pasted
several examples of their systemd unit files they came up with.

This is like one of them, adjusted to our pathes (/srv/phab/..).

Also adds some comments about that. The service stanza will still
have to be adjusted as well.

Bug: T137928
Change-Id: I97347682217156ced446db9492423c606207201b
---
A modules/phabricator/files/systemd/phd.service
M modules/phabricator/manifests/init.pp
2 files changed, 29 insertions(+), 1 deletion(-)

Approvals:
  20after4: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/phabricator/files/systemd/phd.service 
b/modules/phabricator/files/systemd/phd.service
new file mode 100644
index 0000000..0352e7f
--- /dev/null
+++ b/modules/phabricator/files/systemd/phd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=phabricator-phd
+After=syslog.target network.target
+Before=apache2.service
+User=phd
+Group=phd
+
+[Service]
+Type=oneshot
+Enviroment="PATH=/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin"
+ExecStart=/srv/phab/phabricator/bin/phd start
+ExecStop=/srv/phab/phabricator/bin/phd stop
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/modules/phabricator/manifests/init.pp 
b/modules/phabricator/manifests/init.pp
index 8d6ae42..ee472fd 100644
--- a/modules/phabricator/manifests/init.pp
+++ b/modules/phabricator/manifests/init.pp
@@ -235,10 +235,22 @@
         require  => $base_requirements,
     }
 
-    # This needs to become Upstart managed
+    if $::initsystem == 'systemd' {
+        file { '/etc/systemd/system/phd.service':
+            ensure => present,
+            owner  => 'root',
+            group  => 'root',
+            mode   => '0444',
+            source => 'puppet:///modules/phabricator/systemd/phd.service',
+        }
+    }
+
+    # This needs to become <s>Upstart</s> systemd managed
     # https://secure.phabricator.com/book/phabricator/article/managing_daemons/
     # Meanwhile upstream has a bug to make an LSB friendly wrapper
     # https://secure.phabricator.com/T8129
+    # see examples of real-word unit files in comments of:
+    # https://secure.phabricator.com/T4181
     service { 'phd':
         ensure     => running,
         start      => '/usr/sbin/service phd start --force',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I97347682217156ced446db9492423c606207201b
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <[email protected]>
Gerrit-Reviewer: 20after4 <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to