diff options
author | Donald Webster | 2019-05-29 08:26:32 -0700 |
---|---|---|
committer | Donald Webster | 2019-05-29 08:28:50 -0700 |
commit | 2dc314550286aa995f65920528413f893f61a722 (patch) | |
tree | d1c852aa6275d644fc724c8df79d57c3f6fcd96a | |
parent | 0fb2a05ca59b6b0891f1bbcd049ae74cec248a3a (diff) | |
download | aur-2dc314550286aa995f65920528413f893f61a722.tar.gz |
Switch to systemds sysusers.
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 13 | ||||
-rw-r--r-- | sabnzbd.install | 14 | ||||
-rw-r--r-- | sabnzbd.sysusers | 1 |
4 files changed, 15 insertions, 15 deletions
@@ -28,6 +28,7 @@ pkgbase = sabnzbd source = sabnzbd.png source = x-nzb.xml source = sabnzbd.service + source = sabnzbd.sysusers source = sabnzbd.confd md5sums = 6845962498a6c3629818e28b32edeac6 md5sums = 48d60a1c626503c7fef1bc5374390513 @@ -37,6 +38,7 @@ pkgbase = sabnzbd md5sums = b834ca5dfb63a5d06041c3174172ec09 md5sums = 11fb2cd1451e3725b08bfc2bd045be54 md5sums = da07971fa3790ea4824ed4ce611b38f3 + md5sums = 39415e41f0e29996b1aa16444258b33a md5sums = 8fc2607a7961fc643ef4f6640166322a pkgname = sabnzbd @@ -13,7 +13,16 @@ optdepends=("xdg-utils: registration of .nzb files" "python2-feedparser: rss sup install="${pkgname}.install" backup=("etc/conf.d/sabnzbd" "opt/${pkgname}/${pkgname}.ini") source=("https://github.com/${pkgname}/${pkgname}/releases/download/${pkgver}/${_pkgname}-${pkgver}-src.tar.gz" - "${pkgname}" "${pkgname}.desktop" "addnzb.sh" "nzb.png" "sabnzbd.png" "x-nzb.xml" "${pkgname}.service" "${pkgname}.confd") + "${pkgname}" + "${pkgname}.desktop" + "addnzb.sh" + "nzb.png" + "sabnzbd.png" + "x-nzb.xml" + "${pkgname}.service" + "sabnzbd.sysusers" + "${pkgname}.confd") + md5sums=('6845962498a6c3629818e28b32edeac6' '48d60a1c626503c7fef1bc5374390513' '36e5f0f60f28f67102682f80e33c6d4b' @@ -22,6 +31,7 @@ md5sums=('6845962498a6c3629818e28b32edeac6' 'b834ca5dfb63a5d06041c3174172ec09' '11fb2cd1451e3725b08bfc2bd045be54' 'da07971fa3790ea4824ed4ce611b38f3' + '39415e41f0e29996b1aa16444258b33a' '8fc2607a7961fc643ef4f6640166322a') package() { @@ -38,6 +48,7 @@ package() { install -Dm755 "${srcdir}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}" install -Dm644 "${srcdir}/${pkgname}.confd" "${pkgdir}/etc/conf.d/${pkgname}" install -Dm644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service" + install -Dm644 "${srcdir}/sabnzbd.sysusers" "${pkgdir}/usr/lib/sysusers.d/sabnzbd.conf" install -Dm755 "${srcdir}/${pkgname}.desktop" \ "${pkgdir}/usr/share/applications/${pkgname}.desktop" install -Dm755 "${srcdir}/addnzb.sh" "${pkgdir}/opt/${pkgname}/addnzb.sh" diff --git a/sabnzbd.install b/sabnzbd.install index cf84a4790565..dc62db60b8ec 100644 --- a/sabnzbd.install +++ b/sabnzbd.install @@ -34,17 +34,6 @@ pre_upgrade() { ## arg 1: the new package version ## arg 2: the old package version post_upgrade() { - # if the group or user already exists, the request will be denied - # and all original settings will be retained - if [ "$SABNZBD_GROUP" == "sabnzbd" ]; then - groupadd -r sabnzbd &> /dev/null - fi - - if [ "$SABNZBD_USER" == "sabnzbd" ]; then - useradd -s /sbin/nologin -c "SABnzbd user" -d "${SABNZBD_DIR}" \ - -g sabnzbd -r sabnzbd &> /dev/null - fi - chown -R "${SABNZBD_USER}:${SABNZBD_GROUP}" "${SABNZBD_DIR}" } @@ -60,9 +49,6 @@ pre_remove() { ## arg 1: the old package version post_remove() { - # only delete if user is sabnzbd - userdel sabnzbd &> /dev/null - groupdel sabnzbd &> /dev/null || /bin/true echo "==> There may be some files left in ${SABNZBD_DIR}." } diff --git a/sabnzbd.sysusers b/sabnzbd.sysusers new file mode 100644 index 000000000000..fc46a6c0ed75 --- /dev/null +++ b/sabnzbd.sysusers @@ -0,0 +1 @@ +u sabnzbd - "SABnzbd daemon" /opt/sabnzbd |