I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit bfba732f authored by kytv's avatar kytv
Browse files

Debian: Add systemd support (ticket #1208)

Currently just for Debian unstable and Ubuntu Saucy and newer.
parent 738c5ed1
No related branches found
No related tags found
No related merge requests found
i2p (0.9.11-2) UNRELEASED; urgency=medium
* systemd support in Ubuntu Saucy (and newer) and Debian unstable (ticket
#1208)
* Set homepage address to geti2p.net
* Bump standards version (no source changes needed)
-- Kill Your TV <killyourtv@i2pmail.org> Thu, 13 Mar 2014 01:10:46 +0000
i2p (0.9.11-1) unstable; urgency=medium i2p (0.9.11-1) unstable; urgency=medium
* New release * New release
......
Source: i2p Source: i2p
Maintainer: Kill Your TV <killyourtv@i2pmail.org> Maintainer: Kill Your TV <killyourtv@i2pmail.org>
Section: net Section: net
Standards-Version: 3.9.4 Standards-Version: 3.9.5
Priority: optional Priority: optional
Bugs: mailto:killyourtv@i2pmail.org Bugs: mailto:killyourtv@i2pmail.org
Homepage: http://www.i2p2.de/ Homepage: https://geti2p.net
Build-Depends: debhelper (>= 7.0.50~), Build-Depends: debhelper (>= 7.0.50~)
ant, ,ant (>= 1.8)
debconf, ,ant-optional
default-jdk, ,debconf
gettext, ,default-jdk | openjdk-7-jdk | openjdk-6-jdk
libgmp3-dev, ,gettext
# uncomment the next line for PPA builds ,libgmp3-dev
# libservice-wrapper-java, # uncomment the next line for official builds
libcommons-logging-java, # ,libservice-wrapper-java
po-debconf ,libcommons-logging-java
,hardening-wrapper
,po-debconf
# Uncomment the next line for Debian unstable or Ubuntu Saucy (and newer)
# ,dh-systemd
Package: i2p Package: i2p
Architecture: all Architecture: all
...@@ -49,46 +53,44 @@ Description: Java Big Integer library ...@@ -49,46 +53,44 @@ Description: Java Big Integer library
the ones used by I2P. You can expect to see a 5-7x speed improvement on certain the ones used by I2P. You can expect to see a 5-7x speed improvement on certain
tasks, such as elGamal encryption/decryption. tasks, such as elGamal encryption/decryption.
Package: i2p-doc #Package: i2p-doc
Architecture: all #Architecture: all
Section: doc #Section: doc
Depends: ${misc:Depends} #Depends: ${misc:Depends}
Suggests: i2p, default-jdk-doc #Suggests: i2p, default-jdk-doc
Description: Documentation for I2P #Description: Documentation for I2P
I2P is an anonymizing network, offering a simple layer that identity-sensitive # I2P is an anonymizing network, offering a simple layer that identity-sensitive
applications can use to securely communicate. All data is wrapped with several # applications can use to securely communicate. All data is wrapped with several
layers of encryption, and the network is both distributed and dynamic, with no # layers of encryption, and the network is both distributed and dynamic, with no
trusted parties. # trusted parties.
. # .
This package contains the Javadoc files. # This package contains the Javadoc files.
Package: i2p-router Package: i2p-router
Architecture: all Architecture: all
Section: net Section: net
Priority: optional Priority: optional
Depends: ${misc:Depends}, ${java:Depends}, ${shlibs:Depends}, Depends: ${misc:Depends}, ${java:Depends}, ${shlibs:Depends},
openjdk-6-jre-headless | openjdk-7-jre-headless | default-jre-headless | java5-runtime-headless | java6-runtime-headless, libecj-java openjdk-7-jre-headless | openjdk-6-jre-headless | default-jre-headless | java7-runtime-headless | java6-runtime-headless, libecj-java
Replaces: i2p ( << 0.8.6-5) Replaces: i2p ( << 0.8.6-5)
Breaks: i2p (<< 0.8.6-5) Breaks: i2p (<< 0.8.6-5)
Recommends: libjbigi-jni (>= ${source:Version}), libjbigi-jni (<< ${source:Version}.1~), ttf-dejavu Recommends: libjbigi-jni, ttf-dejavu
Suggests: tor, Suggests: tor
i2p-messenger, ,i2p-messenger
i2phex, ,i2phex
i2p-tahoe-lafs, ,i2p-tahoe-lafs
imule, ,imule
i2pfox, ,irc-client
irc-client, ,itoopie
itoopie, ,mail-client
jircii, ,mail-reader
mail-client, ,news-reader
mail-reader, ,polipo
news-reader, ,privox
polipo, ,robert
privoxy, ,syndie
robert, ,www-browser
syndie, ,xul-ext-torbutton
www-browser,
xul-ext-torbutton
Description: Load-balanced unspoofable packet switching network Description: Load-balanced unspoofable packet switching network
I2P is an anonymizing network, offering a simple layer that identity-sensitive I2P is an anonymizing network, offering a simple layer that identity-sensitive
applications can use to securely communicate. All data is wrapped with several applications can use to securely communicate. All data is wrapped with several
......
#!/bin/sh -e #!/bin/sh
set -e
I2PHOME=/var/lib/i2p I2PHOME=/var/lib/i2p
I2PSYSUSER=i2psvc I2PSYSUSER=i2psvc
conffile="/etc/default/i2p" conffile="/etc/default/i2p"
systemdservice="/lib/systemd/system/i2p.service"
# Source debconf library -- we have a Depends line # Source debconf library -- we have a Depends line
# to make sure it is there... # to make sure it is there...
...@@ -57,6 +60,20 @@ case "$1" in ...@@ -57,6 +60,20 @@ case "$1" in
< $conffile > $conffile.tmp < $conffile > $conffile.tmp
mv -f $conffile.tmp $conffile mv -f $conffile.tmp $conffile
if [ -e "$systemdservice" ]; then
sed -e "s/User=.*/User=$I2PUSER/" < "$systemdservice" > "$systemdservice.tmp"
mv -f "$systemdservice.tmp" "$systemdservice"
chmod 0644 -f "$systemdservice"
if [ -x /bin/systemctl ]; then
systemctl --system daemon-reload
if [ $RUN_DAEMON = 'true' ]; then
systemctl enable i2p.service
else
systemctl disable i2p.service
fi
fi
fi
sed -e "s/^ *wrapper\.java\.maxmemory=.*/wrapper\.java\.maxmemory=$MEMORYLIMIT/" \ sed -e "s/^ *wrapper\.java\.maxmemory=.*/wrapper\.java\.maxmemory=$MEMORYLIMIT/" \
< /etc/i2p/wrapper.config > /etc/i2p/wrapper.config.tmp < /etc/i2p/wrapper.config > /etc/i2p/wrapper.config.tmp
mv -f /etc/i2p/wrapper.config.tmp /etc/i2p/wrapper.config mv -f /etc/i2p/wrapper.config.tmp /etc/i2p/wrapper.config
...@@ -72,7 +89,7 @@ case "$1" in ...@@ -72,7 +89,7 @@ case "$1" in
usermod -c "I2P Router Daemon" -d $I2PHOME -g $I2PSYSUSER -s "/bin/false" \ usermod -c "I2P Router Daemon" -d $I2PHOME -g $I2PSYSUSER -s "/bin/false" \
$I2PSYSUSER -e 1 > /dev/null 2>&1 || true $I2PSYSUSER -e 1 > /dev/null 2>&1 || true
else else
adduser --system --quiet --group --home $I2PHOME $I2PSYSUSER adduser --system --quiet --group --home $I2PHOME $I2PSYSUSER > /dev/null 2>&1
fi fi
[ -d /var/log/i2p ] || mkdir -m0750 /var/log/i2p [ -d /var/log/i2p ] || mkdir -m0750 /var/log/i2p
......
[Unit]
Description=load-balanced unspoofable packet switching network
After=network.target
[Service]
Type=forking
EnvironmentFile=/etc/default/i2p
Environment="I2P_ARGS=/etc/i2p/wrapper.config \
wrapper.java.additional.1=-DloggerFilenameOverride=/var/log/i2p/log-router-@.txt \
wrapper.java.additional.10=-Dwrapper.logfile=/var/log/i2p/wrapper.log \
wrapper.java.additional.11=-Di2p.dir.pid=/run/i2p \
wrapper.java.additional.12=-Di2p.dir.temp=/tmp/i2p-daemon \
wrapper.logfile=/var/log/i2p/wrapper.log \
wrapper.pidfile=/run/i2p/i2p.pid\
wrapper.java.pidfile=/run/i2p/routerjvm.pid \
wrapper.daemonize=TRUE" TZ=UTC
User=i2psvc
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/i2p /tmp/i2p-daemon
ExecStartPre=/bin/chown -R ${I2PUSER}:${I2PUSER} /var/log/i2p /run/i2p /tmp/i2p-daemon
ExecStartPre=/bin/chmod 750 /var/log/i2p
ExecStart=/usr/sbin/wrapper "$I2P_ARGS"
ExecStopPost=/bin/rm -rf /run/i2p /tmp/i2p-daemon
[Install]
WantedBy=multi-user.target
...@@ -36,6 +36,10 @@ export DEBIANVERSION := $(shell dpkg-parsechangelog |awk -F' ' '/^Version:/{prin ...@@ -36,6 +36,10 @@ export DEBIANVERSION := $(shell dpkg-parsechangelog |awk -F' ' '/^Version:/{prin
%: %:
dh $@ --with quilt dh $@ --with quilt
# with systemd needs dh-systemd which isn't available in Wheezy (except from backports),
# and is only Ubuntu as of "Saucy". The official packages will enable this for Debian unstable and
# Ubuntu Saucy (and newer)
#dh $@ --with systemd,quilt
clean: createcopyright clean: createcopyright
...@@ -50,6 +54,13 @@ override_dh_auto_clean: ...@@ -50,6 +54,13 @@ override_dh_auto_clean:
override_dh_auto_build: override_dh_auto_build:
# Uncomment the next override line for systems that support dh-systemd
# (currently Debian unstable and Ubuntu Saucy (and newer))
#override_dh_systemd_enable:
# We purposely do not set I2P to start at boot.
# This matches the behavior of the initscript
# and the setting RUN_DAEMON=false in /etc/default/i2p
binary-indep: build-indep binary-indep: build-indep
build-indep: build-indep:
dh_prep dh_prep
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment