forked from I2P_Developers/i2p.i2p
Debian: Fix postinst script
On systems without an i2psvc group, the postinstall would fail. This change will add the group if it doesn't exist. Also adding "||true" to the usermod command in case the command returns a non-zero status.
This commit is contained in:
5
debian/i2p.postinst
vendored
5
debian/i2p.postinst
vendored
@@ -63,14 +63,15 @@ case "$1" in
|
||||
|
||||
# Create user and group as a system user.
|
||||
if getent passwd i2psvc > /dev/null 2>&1 ; then
|
||||
groupadd -f $I2PSYSUSER || true
|
||||
usermod -c "I2P Router Daemon" -d $I2PHOME -g $I2PSYSUSER -s "/bin/false" \
|
||||
$I2PSYSUSER -e 1 > /dev/null 2>&1
|
||||
$I2PSYSUSER -e 1 > /dev/null 2>&1 || true
|
||||
else
|
||||
adduser --system --quiet --group --home $I2PHOME $I2PSYSUSER
|
||||
fi
|
||||
|
||||
[ -d /var/log/i2p ] || mkdir -m0750 /var/log/i2p
|
||||
chown -f -R $I2PSYSUSER:adm /var/log/i2p
|
||||
chown -f -R $I2PSYSUSER:i2psvc /var/log/i2p
|
||||
|
||||
# Has someone set the permissions with dpkg-statoverride? If so, obey them.
|
||||
if ! dpkg-statoverride --list $I2PHOME > /dev/null 2>&1
|
||||
|
||||
Reference in New Issue
Block a user