From 305495eefa5a4c187b33dc404dbffd3ad47b5b62 Mon Sep 17 00:00:00 2001 From: Joerg Deckert Date: Thu, 1 Mar 2018 09:43:15 +0100 Subject: [PATCH] gnustep-apps/sogo: systemd support --- gnustep-apps/sogo/Manifest | 7 ++-- gnustep-apps/sogo/files/sogod.confd | 6 ++++ gnustep-apps/sogo/files/sogod.initd | 2 +- gnustep-apps/sogo/files/sogod.service | 41 ++++++++++++++++++++++++ gnustep-apps/sogo/sogo-3.2.10-r99.ebuild | 3 +- 5 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 gnustep-apps/sogo/files/sogod.service diff --git a/gnustep-apps/sogo/Manifest b/gnustep-apps/sogo/Manifest index 8fbda89..80c98a0 100644 --- a/gnustep-apps/sogo/Manifest +++ b/gnustep-apps/sogo/Manifest @@ -1,6 +1,7 @@ -AUX sogod.confd 117 SHA256 a556b2501155ebb9e2bd57fe8b32011ebca67530b4908d1cb0f87473ba80803a SHA512 d93bde8c500bf8452d5f32efc35ec12f436afc498d7cc6ac1f55769f8696c9b41cc5edec829a19ea01b24c0d3a2c7901fc797cb04ced371bc8e0c3e6e243f15b WHIRLPOOL 189dc32b8fa8f7ef2dbdec29515423ce4771ea18f1b3d539a85bb5e9b7148e26b2d37fd089ccccd4646793eaded6a01d43f2674fc98bd9537bc7b72053ec1355 -AUX sogod.initd 688 SHA256 ad809f65086290b6c2320b7a3ac3a340451155b00cd3c815bb44509354124ead SHA512 a1ad645a658ab4148fc6af7dbac7243148a887c38691229ccea3e3eb6a57401fca896e5d57f516e66c838baac20c207c762c18d7b0919fb75e06d2489e5feba1 WHIRLPOOL d22078273cf485e3355d00c10bbe334ff71cea965802dcf6b93c5a650201deed8469e67f2a6dc06782949e8341c20ba929f3341f2d9031e60a6bd1f796ce59f2 +AUX sogod.confd 350 SHA256 d32191995f2dfedc39be694996516a7800bfa6daaf50915fcf540e5544f4387d SHA512 f21e250361af5d72dc370801278ceed6ff5653922826df8fcb9043cae98b3de34adbfa8380157d4bd532f718b3e105ecbb10e379ba81f90a22edcfa20ed248ab WHIRLPOOL 7aa23c03131f643170fc10f15498868a121df3ad018ddccb6a5cac77dbe842587b315870f4c35e1519121e7d38deb50da24f4d79298057879e82271664527601 +AUX sogod.initd 672 SHA256 d7be6c68e6fba0194f18ea0edb3caba7a86b41349bd8d3c9084b714a7595f34f SHA512 3217c217dd8e2e2882caf584ecd41af1552decea1d60d1dbd4f2b026e81d18ab42938778a9aa54ff96b8cfcf90d95811139107c7d565d68c3131aad398a3362a WHIRLPOOL db8e750af0defcf423ca571bec04a5a6fd1400610ee04dcaebed74eb669cdf08614a214d144bd58478d85d1b6c856a2d6f72e2307025eae99a22b1c1fcd64df7 +AUX sogod.service 946 SHA256 3266e5b256c84bffe366b6cde50f522b2e720bc7e81e3732b4f54c6acb292cc5 SHA512 9ad0d6c5db85cb7987be1f0e5400de3ffac6fb62387d617b4e7b3929e84f8d3b575d4d40882cffbdf82cbf98692540430f36eb67d7f5966de3e03cfaf260ff27 WHIRLPOOL ec735f68d2586dc68494ed0724e6dec63d0fb2d120db89e7d8ee10c87dd5a84ad77e3e9bfa1fdf2b0723b52ba1138d857a589441a788fb08505ae4336c049acc DIST sogo-3.2.1.tar.gz 32210103 SHA256 9faef922937f1413c1567e91cf865f577be43cc455c7124e3711bcdb49c7ded3 SHA512 0f8207d1f555982965870971f7130ad7868f4b904e3d6c8a2af9b0226820008174867a8515cd6e7775e9e0e4a3f1de98f73482425bec0c81b6d382ff9fe4a5ee WHIRLPOOL 529b03fd216289701d0af3a77236cc103693a366d597d6992c22d863bb9f7562462c906c1b2e78a72d922770dad953035b3e0c21d9ec3752ff7e8ac0d0bc7686 DIST sogo-3.2.10.tar.gz 32528115 SHA256 3bad2d871c750346624bae3b66e25080727391be40f71477f7c3102c7bc559ce SHA512 3dbd465592fd98968b32e251659a70306a781999bcfa9e63e142d75d7c9274edc7cbe5069881e939f0e9472f0ef8580e4e0f20059bfc97f8c69893d86c8cadf3 WHIRLPOOL 99e47eb3f95e04b07e354d0522e186c5c27ed0e74012e1cacf06cfbdbe083002184123b602e7ad1c062ef2ab3fff865e54d921b1a1474331756552db53335aad EBUILD sogo-3.2.1.ebuild 2325 SHA256 79f42b4c4d079e81ba1fe98d2b48bc6c308526ff3cb160316491c1770d2f7f9e SHA512 7aac40a8ca52e0a3ff67f4df0ecd991e1cfc3c33486eace451f77eee2e60d802f10c99ce5c6205084f5ce5f8be217639ed2490a69e6e80688836f7094aedc635 WHIRLPOOL 95fbab8909bf4b443dc7cb61e4694575cd94112df9d2c8fd8c938a50eb31338427bfb1e046c5764ceee0c7d0fdf94e98c34139ca6d43b9498208824ed6e8d124 -EBUILD sogo-3.2.10-r99.ebuild 2325 SHA256 1829cf8f8e7f24519f38b08585461d8a67e4137f68a2d10bce41e2f361b1bb51 SHA512 ae708046ba006e844f94d9bdc0dd99e8798ae79a9c7fabccdcc03d42fbcebb89685f7fb30e1c6947e1ffee1935e322373ff048e05a1a07412ec7d85fce1a49dc WHIRLPOOL 26320671bab327c1911fe12756bcaf8e8391068afb7acf42bacabb828603189bcd936c63f8dc90e18b7387e47928238d54537fa1f3c444b25130bb8e4075a636 +EBUILD sogo-3.2.10-r99.ebuild 2377 SHA256 200a8e9c892798f983aaf2be92e848bd1014a2ae7543902e0a839f3ad55c1d45 SHA512 0872924a695ce023dd8fbf7c8861f9d79c7edca97d38e7238f54c45516bae889da8279b07e1d4d0d695b7f51e93a11288a2a2591d93501a5140ffd7d76b06ccd WHIRLPOOL 6a595acc6b90519ffb107577c9ec2a936b9444d3a28f2c53e6c00ed96080c830546e9c9532a0605b71216ad236775b03da7ee5e1a025b8c76b5d7829213de824 diff --git a/gnustep-apps/sogo/files/sogod.confd b/gnustep-apps/sogo/files/sogod.confd index 906a697..1b3db4b 100644 --- a/gnustep-apps/sogo/files/sogod.confd +++ b/gnustep-apps/sogo/files/sogod.confd @@ -2,5 +2,11 @@ SOGOD_WORKERS=3 +# Systemd logging options +# Log to stdout by default (systemd journal) +# Comment the following line to log based on GNUStep or sogo.conf parameters +SOGOD_LOGOPTS="-WOLogFile '-'" +##SOGOD_LOGOPTS="-WOLogFile /var/log/sogo/sogod.log" + # Additional options for SOGo SOGOD_OPTS="" diff --git a/gnustep-apps/sogo/files/sogod.initd b/gnustep-apps/sogo/files/sogod.initd index 1d16c78..1b6a127 100644 --- a/gnustep-apps/sogo/files/sogod.initd +++ b/gnustep-apps/sogo/files/sogod.initd @@ -19,8 +19,8 @@ start() { start-stop-daemon --start --quiet \ --user sogo --exec /usr/sbin/sogod \ -- -WOWorkersCount ${SOGOD_WORKERS} \ - -WOLogFile /var/log/sogo/sogod.log \ -WOPidFile "${SOGOD_PID}" \ + "${SOGOD_LOGOPTS}" \ "${SOGOD_OPTS}" eend ${?} } diff --git a/gnustep-apps/sogo/files/sogod.service b/gnustep-apps/sogo/files/sogod.service new file mode 100644 index 0000000..bd863b4 --- /dev/null +++ b/gnustep-apps/sogo/files/sogod.service @@ -0,0 +1,41 @@ +[Unit] +Description=Sogo Daemon +After=network.target slapd.service memcached.service postfix.service dovecot.service postgresql.service mariadb.service + +[Service] +User=sogo +RuntimeDirectory=sogo +EnvironmentFile=-/etc/conf.d/sogod +ExecStart=/usr/bin/sogod -WOPidFile /var/run/sogo/sogo.pid -WONoDetach YES -WOWorkersCount $SOGOD_WORKERS $SOGOD_LOGOPTS $SOGOD_OPTS + +[Install] +WantedBy=multi-user.target + +#################### + +depend() { + need net + need memcached + after postgresql mysql + after slapd + after mta +} + +start() { + checkpath -q -d -m 0755 -o sogo:sogo $(dirname "${SOGOD_PID}") + ebegin "Starting SOGo service" + start-stop-daemon --start --quiet \ + --user sogo --exec /usr/sbin/sogod \ + -- -WOWorkersCount ${SOGOD_WORKERS} \ + -WOLogFile /var/log/sogo/sogod.log \ + -WOPidFile "${SOGOD_PID}" \ + "${SOGOD_OPTS}" + eend ${?} +} + +stop() { + ebegin "Stopping SOGo service" + start-stop-daemon --stop \ + --pidfile "${SOGOD_PID}" + eend ${?} +} diff --git a/gnustep-apps/sogo/sogo-3.2.10-r99.ebuild b/gnustep-apps/sogo/sogo-3.2.10-r99.ebuild index 897e515..83ce14b 100644 --- a/gnustep-apps/sogo/sogo-3.2.10-r99.ebuild +++ b/gnustep-apps/sogo/sogo-3.2.10-r99.ebuild @@ -4,7 +4,7 @@ EAPI=6 -inherit gnustep-2 user vcs-snapshot +inherit gnustep-2 systemd user vcs-snapshot DESCRIPTION="Groupware server built around OpenGroupware.org and the SOPE application server" HOMEPAGE="http://www.sogo.nu" @@ -85,6 +85,7 @@ src_install() { newconfd "${FILESDIR}"/sogod.confd sogod newinitd "${FILESDIR}"/sogod.initd sogod + systemd_dounit "${FILESDIR}/sogod.service" insinto /etc/logrotate.d newins Scripts/logrotate sogo