Merge pull request #475 from cffls/develop

Add 'bor' user during package installation
This commit is contained in:
Jerry 2022-07-29 13:57:36 -07:00 committed by GitHub
commit 7e79f82a31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 1 deletions

View file

@ -75,12 +75,18 @@ nfpms:
description: Polygon Blockchain
license: GPLv3 LGPLv3
bindir: /usr/local/bin
formats:
- apk
- deb
- rpm
contents:
- dst: /var/lib/bor
type: dir
file_info:
mode: 0777
- src: builder/files/bor.service
dst: /lib/systemd/system/bor.service
type: config
@ -94,6 +100,9 @@ nfpms:
dst: /var/lib/bor/config.toml
type: config
scripts:
postinstall: builder/files/bor-post-install.sh
overrides:
rpm:
replacements:

View file

@ -0,0 +1,9 @@
#!/bin/sh
set -e
PKG="bor"
if ! getent passwd $PKG >/dev/null ; then
adduser --disabled-password --disabled-login --shell /usr/sbin/nologin --quiet --system --no-create-home --home /nonexistent $PKG
echo "Created system user $PKG"
fi

View file

@ -8,7 +8,7 @@
RestartSec=5s
ExecStart=/usr/local/bin/bor server -config="/var/lib/bor/config.toml"
Type=simple
User=ubuntu
User=bor
KillSignal=SIGINT
TimeoutStopSec=120