Merge pull request #17 from nxshock/patch-1
Run service as separate user
This commit is contained in:
@@ -72,6 +72,8 @@ EOF
|
|||||||
cat > /tmp/$PKGNAME/debian/postinst << EOF
|
cat > /tmp/$PKGNAME/debian/postinst << EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
id -u alfis &>/dev/null || useradd --system alfis || echo "Failed to create user 'alfis' - please create it manually and reinstall"
|
||||||
|
|
||||||
if ! getent group alfis 2>&1 > /dev/null; then
|
if ! getent group alfis 2>&1 > /dev/null; then
|
||||||
groupadd --system --force alfis || echo "Failed to create group 'alfis' - please create it manually and reinstall"
|
groupadd --system --force alfis || echo "Failed to create group 'alfis' - please create it manually and reinstall"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -6,11 +6,12 @@ After=network.target
|
|||||||
After=alfis-default-config.service
|
After=alfis-default-config.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
User=alfis
|
||||||
Group=alfis
|
Group=alfis
|
||||||
ProtectHome=true
|
ProtectHome=true
|
||||||
ProtectSystem=true
|
ProtectSystem=true
|
||||||
SyslogIdentifier=alfis
|
SyslogIdentifier=alfis
|
||||||
CapabilityBoundingSet=CAP_NET_ADMIN
|
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
|
||||||
WorkingDirectory=/var/lib/alfis
|
WorkingDirectory=/var/lib/alfis
|
||||||
ExecStart=/usr/bin/alfis -n -c /etc/alfis.conf
|
ExecStart=/usr/bin/alfis -n -c /etc/alfis.conf
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
|||||||
Reference in New Issue
Block a user