Debian: confine daemon with apparmor (ticket #1061)

This commit is contained in:
kytv
2015-02-18 22:25:24 +00:00
parent bb9cef1e40
commit 29953ea5e4
15 changed files with 323 additions and 62 deletions

28
debian/i2p.config vendored
View File

@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/sh
set -e
# I2P package configuration script
conffile="/etc/default/i2p"
@@ -7,24 +9,30 @@ conffile="/etc/default/i2p"
# Load config file if it exists
if [ -e $conffile ]; then
. $conffile
. $conffile
# wrapper.config always takes priority
MEMORYLIMIT=$(sed -e '/^wrapper\.java\.maxmemory/!d' -e 's/^wrapper\.java\.maxmemory\ *=\ *//' /etc/i2p/wrapper.config)
# wrapper.config always takes priority
MEMORYLIMIT=$(awk -F= '/^wrapper\.java\.maxmemory/{print $2}' /etc/i2p/wrapper.config)
db_set i2p/daemon "$RUN_DAEMON"
db_set i2p/user "$I2PUSER"
db_set i2p/memory "$MEMORYLIMIT"
db_set i2p/daemon "$RUN_DAEMON"
db_set i2p/user "$I2PUSER"
db_set i2p/memory "$MEMORYLIMIT"
db_set i2p/aa "$CONFINE_WITH_APPARMOR"
fi
db_input medium i2p/daemon || true
db_go
db_get i2p/daemon || true
if [ "$RET" = "true" ]; then
db_input medium i2p/user || true
db_go
db_input medium i2p/user || true
db_go
fi
db_input medium i2p/memory || true
db_go
db_input medium i2p/aa || true
db_go
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4