diff options
author | Alive 4ever | 2016-07-01 09:37:20 +0000 |
---|---|---|
committer | Quint Guvernator | 2016-07-01 10:58:09 -0400 |
commit | d30047000fdc69c762585eb8d4bab32a85396302 (patch) | |
tree | ae0280136f87d2f298c1f6fa1471b8184540b8e4 | |
parent | 08525aa938c2a539f1c9e8880ee51a718be7482f (diff) | |
download | aur-d30047000fdc69c762585eb8d4bab32a85396302.tar.gz |
Run the service under its own uid
Create a separate user to run btpd.service
Since btpd is a long running network service, it's better to run it
under it's own user id. This would cause no problem, because btpd
service doesn't need to open privileged port (<1024).
----
Signed-off-by: alive4ever <alive4ever at live dot com>
.SRCINFO | 6 ++----
PKGBUILD | 4 ++--
btpd.install | 14 ++++++++++++++
btpd.service | 1 +
4 files changed, 19 insertions(+), 6 deletions(-)
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | btpd.install | 13 | ||||
-rw-r--r-- | btpd.service | 1 |
4 files changed, 22 insertions, 5 deletions
@@ -1,10 +1,11 @@ # Generated by mksrcinfo v8 -# Mon Feb 1 19:18:24 UTC 2016 +# Fri Jul 1 14:49:22 UTC 2016 pkgbase = btpd pkgdesc = BitTorrent client consisting of a daemon and client commands to control the daemon pkgver = 0.16 - pkgrel = 4 + pkgrel = 5 url = http://github.com/btpd/btpd + install = btpd.install arch = i686 arch = x86_64 license = custom @@ -12,7 +13,7 @@ pkgbase = btpd source = http://cloud.github.com/downloads/btpd/btpd/btpd-0.16.tar.gz source = btpd.service sha512sums = 719778762a90f62942ae235c4c3fcd92d859d0c7d977e9fb0d7f3149c4c35c649eadc0a648b8a79c547dae8060ff3dcde1afb38081d55d15ae618039acdafb0f - sha512sums = 82d5651a3a71e90aef1b3bcfcba2d3580e70220cfa814c2b810d6873b889db2c4fa2b620b96e3821bb510ea88bf0a15ac7d94b29ebd91b627ad651fd5a4cb687 + sha512sums = 35f7abc7341b7a0705f09388460fd73d61afcb863a0cdcf9e5fcc8981aecae3348fb8f592cdb518654a4649563befaea8457853cb0427ce8391fe77109a54c37 pkgname = btpd @@ -1,18 +1,20 @@ # Maintainer: Quint Guvernator <quint@guvernator.net> # Contributor: Marq Schneider <queueRAM@gmail.com> +# Contributor: Alive 4ever <alive4ever@live.com> pkgname=btpd pkgver=0.16 -pkgrel=4 +pkgrel=5 pkgdesc="BitTorrent client consisting of a daemon and client commands to control the daemon" arch=('i686' 'x86_64') url="http://github.com/btpd/btpd" license=('custom') depends=('openssl') +install="$pkgname.install" source=(http://cloud.github.com/downloads/$pkgname/$pkgname/$pkgname-$pkgver.tar.gz \ $pkgname.service) sha512sums=('719778762a90f62942ae235c4c3fcd92d859d0c7d977e9fb0d7f3149c4c35c649eadc0a648b8a79c547dae8060ff3dcde1afb38081d55d15ae618039acdafb0f' - '82d5651a3a71e90aef1b3bcfcba2d3580e70220cfa814c2b810d6873b889db2c4fa2b620b96e3821bb510ea88bf0a15ac7d94b29ebd91b627ad651fd5a4cb687') + '35f7abc7341b7a0705f09388460fd73d61afcb863a0cdcf9e5fcc8981aecae3348fb8f592cdb518654a4649563befaea8457853cb0427ce8391fe77109a54c37') build() { cd "$srcdir/$pkgname-$pkgver" diff --git a/btpd.install b/btpd.install new file mode 100644 index 000000000000..e10968f6e361 --- /dev/null +++ b/btpd.install @@ -0,0 +1,13 @@ +post_install() { + getent passwd btpd > /dev/null 2>&1 || \ + useradd -r -m -d /var/btpd -s /bin/nologin btpd +} + +post_upgrade() { + post_install +} + +post_remove() { + getent passwd btpd > /dev/null 2>&1 || \ + userdel -r btpd > /dev/null 2>&1 +} diff --git a/btpd.service b/btpd.service index 8e984afa4b10..ebd4afc56336 100644 --- a/btpd.service +++ b/btpd.service @@ -4,6 +4,7 @@ After=network-up.target [Service] Type=simple +User=btpd ExecStart=/usr/bin/btpd --no-daemon [Install] |