diff options
author | Lisa White | 2019-11-18 13:08:36 +0000 |
---|---|---|
committer | Lisa White | 2019-11-18 13:11:07 +0000 |
commit | df79050281e52720fe151116c3acd389ffd00376 (patch) | |
tree | 55f62c75d19b1cc8db0d038d3eb068ede7a18c48 | |
parent | a2c48b1695b8365dca9488a6a2c7d025b03bde6b (diff) | |
download | aur-df79050281e52720fe151116c3acd389ffd00376.tar.gz |
Restart mtproxy after config update and on failure, patch out 'pid is 32 bit' assertion
Co-authored-by: Yaroslav Dronskiy <jaroslav@dronsky.ru>
-rw-r--r-- | .SRCINFO | 12 | ||||
-rw-r--r-- | PKGBUILD | 19 | ||||
-rw-r--r-- | mtproxy-config.service | 1 | ||||
-rw-r--r-- | mtproxy.service | 1 | ||||
-rw-r--r-- | pid_assertion.patch | 12 |
5 files changed, 34 insertions, 11 deletions
@@ -1,9 +1,7 @@ -# Generated by mksrcinfo v8 -# Wed Jun 6 10:33:53 UTC 2018 pkgbase = mtproxy-git pkgdesc = Proxy server for Telegram messaging app - pkgver = 17.580909c - pkgrel = 2 + pkgver = 47.dc0c7f3 + pkgrel = 1 url = https://github.com/TelegramMessenger/MTProxy arch = i686 arch = x86_64 @@ -17,11 +15,13 @@ pkgbase = mtproxy-git source = mtproxy-config.service source = mtproxy-config.timer source = mtproxy.service + source = pid_assertion.patch md5sums = SKIP md5sums = 1a9cdcef498d2e9ffb5def0112c3e2b0 - md5sums = 6ceb39b6a8462bc21c0940fd6ca5650e + md5sums = a67f6a3b3874d9dac15c7cf620d696c2 md5sums = aa2367c3f759632473824fabcc3544ff - md5sums = c08b4b281c1e8c8587b04743f70cff0d + md5sums = 1ee66acee6c42aca9160b9ccfe534bc3 + md5sums = 50233354ac78d52280a93092b809f7aa pkgname = mtproxy-git @@ -12,11 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Maintainer: Aleksey Filippov <sarum9in@gmail.com> +# Maintainer: Lisa White <lisa.rsfp+dev@gmail.com> +# Contributor: Yaroslav Dronskiy <jaroslav@dronsky.ru> +# Contributor: Aleksey Filippov <sarum9in@gmail.com> pkgname=mtproxy-git -pkgver=17.580909c -pkgrel=2 +pkgver=47.dc0c7f3 +pkgrel=1 pkgdesc="Proxy server for Telegram messaging app" arch=('i686' 'x86_64') url='https://github.com/TelegramMessenger/MTProxy' @@ -28,13 +30,15 @@ source=( mtproxy-config.service mtproxy-config.timer mtproxy.service + pid_assertion.patch ) noextract=() md5sums=('SKIP' '1a9cdcef498d2e9ffb5def0112c3e2b0' - '6ceb39b6a8462bc21c0940fd6ca5650e' + 'a67f6a3b3874d9dac15c7cf620d696c2' 'aa2367c3f759632473824fabcc3544ff' - 'c08b4b281c1e8c8587b04743f70cff0d') + '1ee66acee6c42aca9160b9ccfe534bc3' + '50233354ac78d52280a93092b809f7aa') backup=('etc/mtproxy.conf') pkgver() { @@ -42,6 +46,11 @@ pkgver() { echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD) } +prepare() { + cd "$srcdir/$pkgname" + patch --forward --strip=1 --input="$srcdir/pid_assertion.patch" +} + build() { cd "$srcdir/$pkgname" make $MFLAGS diff --git a/mtproxy-config.service b/mtproxy-config.service index 7ec0135cd6ab..74edb8135b89 100644 --- a/mtproxy-config.service +++ b/mtproxy-config.service @@ -7,4 +7,5 @@ Wants=network-online.target Type=oneshot ExecStart=/usr/bin/curl -s https://core.telegram.org/getProxyConfig -o /var/lib/mtproxy/multi.conf ExecStart=/usr/bin/curl -s https://core.telegram.org/getProxySecret -o /var/lib/mtproxy/secret.conf +ExecStartPost=/usr/bin/systemctl try-restart mtproxy.service StandardError=journal diff --git a/mtproxy.service b/mtproxy.service index d91010d225b5..3934b411065f 100644 --- a/mtproxy.service +++ b/mtproxy.service @@ -7,6 +7,7 @@ Wants=network-online.target [Service] Type=simple EnvironmentFile=/etc/mtproxy.conf +Restart=on-failure ExecStart=/usr/bin/mtproto-proxy \ --user=${USER} \ --port=${STATS_PORT} \ diff --git a/pid_assertion.patch b/pid_assertion.patch new file mode 100644 index 000000000000..1e55b673b7fd --- /dev/null +++ b/pid_assertion.patch @@ -0,0 +1,12 @@ +diff --git a/common/pid.c b/common/pid.c +index 7bd4b8d..8904cc7 100644 +--- a/common/pid.c ++++ b/common/pid.c +@@ -39,7 +39,6 @@ npid_t PID; + void init_common_PID (void) { + if (!PID.pid) { + int p = getpid (); +- assert (!(p & 0xffff0000)); + PID.pid = p; + } + if (!PID.utime) { |