mirror of
https://github.com/ntop/n2n.git
synced 2024-09-20 00:51:10 +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
|
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..."
|
echo "Rebuilding ld cache..."
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@ Wants=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStartPre=
|
User=n2n
|
||||||
|
Group=n2n
|
||||||
ExecStart=/usr/sbin/supernode /etc/n2n/supernode.conf -f
|
ExecStart=/usr/sbin/supernode /etc/n2n/supernode.conf -f
|
||||||
Restart=on-abnormal
|
Restart=on-abnormal
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
|
@ -69,6 +69,16 @@ rm -fr $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%pre
|
%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
|
%post
|
||||||
if [ ! -f /.dockerenv ]; then
|
if [ ! -f /.dockerenv ]; then
|
||||||
/bin/systemctl daemon-reload
|
/bin/systemctl daemon-reload
|
||||||
|
|
Loading…
Reference in New Issue
Block a user