mirror of
https://github.com/ntop/n2n.git
synced 2024-09-19 16:41:11 +02:00
Create n2n user and use in the supernode service
This commit is contained in:
parent
4ca0ae34a4
commit
636c57768f
|
@ -17,6 +17,16 @@ esac
|
|||
|
||||
umask 022
|
||||
|
||||
if ! grep -q n2n /etc/group; then
|
||||
echo 'Creating n2n group'
|
||||
/usr/sbin/groupadd -r n2n
|
||||
fi
|
||||
|
||||
if ! /usr/bin/id -u n2n > /dev/null 2>&1; then
|
||||
echo "Creating n2n user..."
|
||||
/usr/sbin/useradd -M -N -g n2n -r -s /bin/false n2n
|
||||
fi
|
||||
|
||||
echo "Rebuilding ld cache..."
|
||||
/sbin/ldconfig
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@ Wants=network-online.target
|
|||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStartPre=
|
||||
User=n2n
|
||||
Group=n2n
|
||||
ExecStart=/usr/sbin/supernode /etc/n2n/supernode.conf -f
|
||||
Restart=on-abnormal
|
||||
RestartSec=5
|
||||
|
|
|
@ -69,6 +69,16 @@ rm -fr $RPM_BUILD_ROOT
|
|||
|
||||
%pre
|
||||
|
||||
if ! grep -q n2n /etc/group; then
|
||||
echo 'Creating n2n group'
|
||||
/usr/sbin/groupadd -r n2n
|
||||
fi
|
||||
|
||||
if ! /usr/bin/id -u n2n > /dev/null 2>&1; then
|
||||
echo 'Creating n2n user'
|
||||
/usr/sbin/useradd -M -N -g n2n -r -s /bin/false n2n
|
||||
fi
|
||||
|
||||
%post
|
||||
if [ ! -f /.dockerenv ]; then
|
||||
/bin/systemctl daemon-reload
|
||||
|
|
Loading…
Reference in New Issue
Block a user