summaryrefslogtreecommitdiff
path: root/www-apps
diff options
context:
space:
mode:
authorBertrand Jacquin <beber@meleeweb.net>2013-09-11 23:59:43 +0200
committerBertrand Jacquin <beber@meleeweb.net>2013-09-12 00:01:21 +0200
commit9e70c62f057c40e87e17253fc3b538f3283f6fb6 (patch)
treef415438605088c8df9ad372a395862718c31df31 /www-apps
parentmetadata: refresh cache (diff)
downloadportage-9e70c62f057c40e87e17253fc3b538f3283f6fb6.tar.xz
www-apps/phabricator: init scripts can be instancied but this does not mean daemon name is changed, disallow auto install and so remove stupid hacks on webroot/MY_HTDOCSBASE, replace 'env' shebang to files it point to, move source deletion to src_prepare, fix init script to track phd-daemon instead of phd using the ssd --name and --interpreted
Diffstat (limited to 'www-apps')
-rw-r--r--www-apps/phabricator/ChangeLog6
-rw-r--r--www-apps/phabricator/Manifest6
-rwxr-xr-xwww-apps/phabricator/files/aphlictd.initd3
-rwxr-xr-xwww-apps/phabricator/files/phd.initd31
4 files changed, 38 insertions, 8 deletions
diff --git a/www-apps/phabricator/ChangeLog b/www-apps/phabricator/ChangeLog
index c8c1a6f4..7a847cf9 100644
--- a/www-apps/phabricator/ChangeLog
+++ b/www-apps/phabricator/ChangeLog
@@ -1,3 +1,9 @@
+ 11 Sep 2013; Bertrand Jacquin <beber@meleeweb.net> files/aphlictd.initd,
+ files/phd.initd:
+ www-apps/phabricator: if pid file or pid file is not define in configuration
+ set a default value, remove --interprate logic that can't work in phd case, so
+ add a hack around this using JSON pid files
+
11 Sep 2013; Bertrand Jacquin <beber@meleeweb.net>
files/0001-Changed-add_user.php-to-create-users-with-unverified.patch,
files/0002-Make-wiki-visible-to-all.patch, files/phd.initd,
diff --git a/www-apps/phabricator/Manifest b/www-apps/phabricator/Manifest
index b6063aa8..e384a8eb 100644
--- a/www-apps/phabricator/Manifest
+++ b/www-apps/phabricator/Manifest
@@ -1,11 +1,11 @@
AUX 0001-Changed-add_user.php-to-create-users-with-unverified.patch 1246 SHA256 fe0a9bbdbecf40754e06569e0766781f2a8370c6ac2dd077f013bca98981deed WHIRLPOOL 25b50454516d1bc368c81efaeb3603052cb2524eced0330c7ad81e12588a79f8894edd6ba211508e94c206842e527ae4e86ad2760eb844175980462c479a4f09
AUX 0002-Make-wiki-visible-to-all.patch 907 SHA256 8f145e199490c559b11865b90b694146bf2d6fa07dcdf50f34f91f44216f24c9 WHIRLPOOL b868cfd98f85eda609ec2c700b42ae1c1ec2724dba8b3bed1cc53dbbda862b294dbad9864cf95f6aab5668b15a17b6f39a25778250c38d602c28a540a7d70ad7
AUX aphlictd.confd 163 SHA256 553f18f54bcf75eada649e564fea7c4c610fd01ec93708bd246263405e7d5246 WHIRLPOOL 027e41cff147fbf7544ba72575fa21e12a66da7b5cd1bdf53a98b929b7c6127c25a997118e9cfea0e00379a7937eb52b051deb4256abb5bb5d6796a9d16138ad
-AUX aphlictd.initd 1036 SHA256 e0a547d4592955beef3886781d152cd0d48cdd1a547234d6cf7d2cc3e74ee07a WHIRLPOOL d7a8da8395dddaca01e4adaea03200121191cf313d202b5bee6bc9823a6117c0e220dcedc03f30c3022d5b7f6b716b78fe8aedb7ab2cd8d17e3649dcd0f8bd2e
+AUX aphlictd.initd 1049 SHA256 6f45d4e4d2d55b50b35b84c11c73628c067f5b7e4d6d88e148ebd00a1a1208cd WHIRLPOOL 2dcf7c230891e660f6dd3655ef0f04be74798f7fc98cc6191088d90ceeb7b6fe51d36ea016d625c18325f4b724a89f07b8e6c2bfd0aa6779946fe72b1702f95d
AUX hook-01-perms 647 SHA256 557ccec2af3003f7d4d1bce8104f0619de1657743a3c453021ed4643db368278 WHIRLPOOL 19f8de21e0d3a5cd754e4ede5c4462112d8c0233efcd07b1ffa360fdc78c0527d74abd84a3713d736fa1ed4b889ed61cd747a1f1b2731549d0315834deeed0c6
AUX hook-02-storage-upgrade 2179 SHA256 ab053bacb55ab34f8e832abb9b6b7254367ceed9f422955046e2930ac17af6f6 WHIRLPOOL 70a1355254cfbde014d825768f814db41a780014966fb931513d2547e6cbe9413c83e6f37699ba00385735831512e5cc2732f562c05df1425874175640f6250a
AUX phd.confd 215 SHA256 80ddbf586f38cc600d06e524f7e85c3258bd563696fa2e41e1ea19268da8079b WHIRLPOOL 0f1a587c755994c410b62da6b897ca8684d584b9f01956359e078429fc7ec7642561dc3e3c306bbb24753e3a68ef5f088a5709706143b6154aa085ac2dfa52ad
-AUX phd.initd 1379 SHA256 894c7072d225f72a33596db63bb2a9b0d34fbd278c1f191d7861ff08e2198c85 WHIRLPOOL 9024c383875347e348e550abb4a506571e4e2693c83278285c56e254f454f69c9155b58ca49532636d3015f235554ca69ef60af92e66854855b25b321feab891
+AUX phd.initd 2108 SHA256 8475c308320ce4d51d35cbea46df61628c9c1d64eb724955a38ed49e51690cda WHIRLPOOL 4c91fcce779d423fa0fa24e744675a7dfaa57d0fe2dd86792a2c27215fc014ca85b38695909f8f6c063308a10d53c499620d909ee29382aec8097c437857988e
EBUILD phabricator-9999.ebuild 4363 SHA256 9293b2c6b33e4f0a5f83ba814540393692feacfb4824a48eaeed38a921e35732 WHIRLPOOL 99be1029a16003d0dacaa5c192420978c68dd95c523470939c755ef42c1d419c7cd613888d6484127e4c5efc58ea47a89114c42c38c3e00ee98e381801e725ef
-MISC ChangeLog 3432 SHA256 e906748258f6637879ae3787e2614d91a93e8e19d4197b32c86bfd18a48df366 WHIRLPOOL 0db89e2b630ea35f5932def97cbf92313bea48b0af6131b3eb43efc70979df6bf1e8aeafcc740f709c9bd899d893635a711260a92192a192ddaf128d2e2100a0
+MISC ChangeLog 3733 SHA256 8235e7dca793d2e571d57e2bbd2a2505c40f8209c8db5f25cbf3ce6f0a9dcf1e WHIRLPOOL f01e7844d531e32bfe2655a508da079f95150305ad6e05b340c9a0c064b02e56d941900b4441ba2f0804223105a4bbcb316267c8e0938490ad98330f7153328c
MISC metadata.xml 653 SHA256 744c67bfd3b874f305b08a5b68c5e2213c3cdc1c47b381fe130ebfc2005a964b WHIRLPOOL 5efd225c032e0704862510f166c94327460caf27527b473fe8f35ea6117b2b16862e362aff0b7bdb47b38349dbcf8710fff4040f11d50e07865f983dacc93d99
diff --git a/www-apps/phabricator/files/aphlictd.initd b/www-apps/phabricator/files/aphlictd.initd
index 2c1dd321..34f771b4 100755
--- a/www-apps/phabricator/files/aphlictd.initd
+++ b/www-apps/phabricator/files/aphlictd.initd
@@ -24,8 +24,9 @@ checkconfig() {
|| return 1
if [[ -z "${pid_file/null}" ]] ; then
+ pid_file="/run/${RC_SVCNAME}.pid"
"${PHABRICATOR_ROOT}/bin/config" \
- set notification.pidfile "/run/phabricator/${RC_SVCNAME}.pid"
+ set notification.pidfile "${pid_file}"
fi
}
diff --git a/www-apps/phabricator/files/phd.initd b/www-apps/phabricator/files/phd.initd
index 9b3b71b8..d41bad7a 100755
--- a/www-apps/phabricator/files/phd.initd
+++ b/www-apps/phabricator/files/phd.initd
@@ -25,8 +25,9 @@ checkconfig() {
|| return 1
if [[ -z "${pid_dir/null}" ]] ; then
+ pid_dir="/run/${RC_SVCNAME}"
"${PHABRICATOR_ROOT}/bin/config" \
- set phd.pid-directory "/run/phabricator"
+ set phd.pid-directory "${pid_dir}"
fi
}
@@ -46,15 +47,37 @@ start() {
--quiet \
--user "${PHABRICATOR_USER}" \
--exec "${PHABRICATOR_ROOT}/bin/phd" \
- --interpreted \
- --name "${PHABRICATOR_ROOT}/scripts/daemon/phd-daemon"
+ --pidfile "${pid_dir}.pid" \
-- start
eend $?
+
+ # This is a terrible hack
+ # bin/phd launch many phd-daemon, and then exit
+ # phd-daemon handle their own pidfiles, all concentrated in the same directory
+ # formatted as JSON file
+ #
+ # This mean that start-stop-daemon
+ # can't match on a pidfile created by phd or phd-daemon
+ # can't match on --exec as their is not 'phd' process
+ # can't match on --name as arguments are not fixed
+ # and then always make phd as crashed
+ #
+ # So solution here is to wait a bit, and then create a pidfile that contain pid
+ # enumerated in JSON files
+ einfo "Populating ${pid_dir}.pid"
+ sleep 5
+ find "${pid_dir}" \
+ -type f \
+ | grep -E '/daemon.([0-9]+)' \
+ | xargs --no-run-if-empty -- \
+ jq .pid \
+ > "${pid_dir}.pid"
+ eend $?
}
stop() {
ebegin "Stopping ${RC_SVCNAME} (${PHABRICATOR_ROOT})"
- # Yep, a start, phd play with many pid files
+ # Yep, a start, phd play with many pid files as explain above
start-stop-daemon --start \
-e PHABRICATOR_ENV="${PHABRICATOR_ENV}" \
--quiet \