diff --git a/debian/i2p.config b/debian/i2p.config index 522857c5d..dab3fe2ac 100755 --- a/debian/i2p.config +++ b/debian/i2p.config @@ -7,16 +7,24 @@ conffile="/etc/default/i2p" # Load config file if it exists if [ -e $conffile ]; then - . $conffile + . $conffile - db_set i2p/daemon "$RUN_DAEMON" - db_set i2p/user "$I2PUSER" + # wrapper.config always takes priority + MEMORYLIMIT=$(sed -e '/^wrapper\.java\.maxmemory/!d' -e 's/^wrapper\.java\.maxmemory\ *=\ *//' /etc/i2p/wrapper.config) + + + db_set i2p/daemon "$RUN_DAEMON" + db_set i2p/user "$I2PUSER" + db_set i2p/memory "$MEMORYLIMIT" 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 diff --git a/debian/i2p.postinst b/debian/i2p.postinst index 85fac5532..3503edee2 100755 --- a/debian/i2p.postinst +++ b/debian/i2p.postinst @@ -12,75 +12,88 @@ db_version 2.0 case "$1" in - configure|reconfigure) - if [ ! -e $conffile ]; then - echo "# Defaults for i2p initscript (/etc/init.d/i2p" >> $conffile - echo "# This is a posix shell fragment" >> $conffile - echo >> $conffile - echo "# [automatically edited by postinst, do not change line format ]" >> $conffile - echo "# Run 'dpkg-reconfigure -plow i2p' to change these values." >> $conffile - echo >> $conffile - echo "RUN_DAEMON=" >> $conffile - echo "I2PUSER=" >> $conffile - fi + configure|reconfigure) + if [ ! -e $conffile ]; then + echo "# Defaults for i2p initscript (/etc/init.d/i2p" >> $conffile + echo "# This is a posix shell fragment" >> $conffile + echo >> $conffile + echo "# [automatically edited by postinst, do not change line format ]" >> $conffile + echo "# Run 'dpkg-reconfigure -plow i2p' to change these values." >> $conffile + echo >> $conffile + echo "RUN_DAEMON=" >> $conffile + echo "I2PUSER=" >> $conffile + echo "# The next value is also wrapper.java.maxmemory in /etc/i2p/wrapper.config" >> $conffile + echo "MEMORYLIMIT=" >> $conffile + fi - db_get i2p/daemon - RUN_DAEMON="$RET" - db_get i2p/user - I2PUSER="$RET" + db_get i2p/daemon + RUN_DAEMON="$RET" + db_get i2p/user + I2PUSER="$RET" + db_get i2p/memory + MEMORYLIMIT="$RET" - cp -a -f $conffile $conffile.tmp + cp -a -f $conffile $conffile.tmp - # If the admin deleted or commented some variables but then set them via debconf, - # (re-)add them to the conffile. - test -z "$RUN_DAEMON" || grep -Eq '^ *RUN_DAEMON=' $conffile || \ - echo "RUN_DAEMON=" >> $conffile - test -z "$I2PUSER" || grep -Eq '^ *I2PUSER=' $conffile || \ - echo "I2PUSER=" >> $conffile + # If the admin deleted or commented some variables but then set them via debconf, + # (re-)add them to the conffile. + test -z "$RUN_DAEMON" || grep -Eq '^ *RUN_DAEMON=' $conffile || \ + echo "RUN_DAEMON=" >> $conffile + test -z "$I2PUSER" || grep -Eq '^ *I2PUSER=' $conffile || \ + echo "I2PUSER=" >> $conffile + test -z "$MEMORYLIMIT" || grep -Eq '^ *MEMORYLIMIT=' $conffile || \ + echo "MEMORYLIMIT=" >> $conffile - if [ -z $RUN_DAEMON ]; then - RUN_DAEMON="false" - I2PUSER="i2psvc" - fi + if [ -z $RUN_DAEMON ]; then + RUN_DAEMON="false" + I2PUSER="i2psvc" + fi - sed -e "s/^ *RUN_DAEMON=.*/RUN_DAEMON=\"$RUN_DAEMON\"/" \ - -e "s/^ *I2PUSER=.*/I2PUSER=\"$I2PUSER\"/" \ - < $conffile > $conffile.tmp - mv -f $conffile.tmp $conffile - migrate_existing_user(){ - # Adjust the user/group in /etc/passwd, mainly for upgrades from old packages that didn't - # create $I2PSYSUSER as a system group/user - usermod -c "I2P Router Daemon" -m -d $I2PHOME -g $I2PSYSUSER -s "/bin/false" \ - -l $I2PSYSUSER -e 1 > /dev/null 2>&1 - echo "Existing user migrated, home directory moved to $I2PHOME" - } - # Create user and group as a system user. - adduser --system --quiet --group --home $I2PHOME $I2PSYSUSER || migrate_existing_user + sed -e "s/^ *RUN_DAEMON=.*/RUN_DAEMON=\"$RUN_DAEMON\"/" \ + -e "s/^ *I2PUSER=.*/I2PUSER=\"$I2PUSER\"/" \ + -e "s/^ *MEMORYLIMIT=.*/MEMORYLIMIT=\"$MEMORYLIMIT\"/" \ + < $conffile > $conffile.tmp + mv -f $conffile.tmp $conffile - [ -d /var/log/i2p ] || mkdir -m0750 /var/log/i2p - chown -f -R $I2PSYSUSER:adm /var/log/i2p + sed -e "s/^ *wrapper\.java\.maxmemory=.*/wrapper\.java\.maxmemory=$MEMORYLIMIT/" \ + < /etc/i2p/wrapper.config > /etc/i2p/wrapper.config.tmp + mv -f /etc/i2p/wrapper.config.tmp /etc/i2p/wrapper.config - # Has someone set the permissions with dpkg-statoverride? If so, obey them. - if ! dpkg-statoverride --list $I2PHOME > /dev/null 2>&1 - then - chown -f -R $I2PSYSUSER:$I2PSYSUSER $I2PHOME - chmod -f u=rwx,g=rxs,o= $I2PHOME - fi + migrate_existing_user(){ + # Adjust the user/group in /etc/passwd, mainly for upgrades from old packages that didn't + # create $I2PSYSUSER as a system group/user + usermod -c "I2P Router Daemon" -m -d $I2PHOME -g $I2PSYSUSER -s "/bin/false" \ + -l $I2PSYSUSER -e 1 > /dev/null 2>&1 + echo "Existing user migrated, home directory moved to $I2PHOME" + } - db_stop + # Create user and group as a system user. + adduser --system --quiet --group --home $I2PHOME $I2PSYSUSER || migrate_existing_user + + [ -d /var/log/i2p ] || mkdir -m0750 /var/log/i2p + chown -f -R $I2PSYSUSER:adm /var/log/i2p + + # Has someone set the permissions with dpkg-statoverride? If so, obey them. + if ! dpkg-statoverride --list $I2PHOME > /dev/null 2>&1 + then + chown -f -R $I2PSYSUSER:$I2PSYSUSER $I2PHOME + chmod -f u=rwx,g=rxs,o= $I2PHOME + fi + + db_stop ;; abort-upgrade|abort-remove|abort-deconfigure) - echo "Aborting upgrade" - exit 0 - ;; + echo "Aborting upgrade" + exit 0 + ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 0 ;; esac - + #DEBHELPER# exit 0 diff --git a/debian/i2p.templates b/debian/i2p.templates index 7adf437b6..1308ae55c 100644 --- a/debian/i2p.templates +++ b/debian/i2p.templates @@ -2,7 +2,7 @@ ##Type: boolean ##Default: false ##_Description: Automatically stop I2P when there are upgrades? -## To update this package the I2P router will need to be restarted. +## To update this package the I2P router will need to be restarted. ## Any activity on the I2P network will be briefly interrupted ## during the upgrade. @@ -20,6 +20,15 @@ _Description: I2P daemon user: By default I2P is configured to run under the account i2psvc when running as a daemon. To use an **existing** I2P profile you may enter a different account name here. For example, if your previous I2P installation is at - /home/user/i2p, you may enter 'user' here. + /home/user/i2p, you may enter 'user' here. . Very important: The account specified here *MUST* already exist. + +Template: i2p/memory +Type: string +Default: 128 +_Description: Memory that can be allocated to I2P: + By default, I2P will only be allowed to use up to 128MB of RAM. + . + High bandwidth routers, as well as routers with a lot of active torrents / plugins, may + need to have this value increased. diff --git a/debian/po/de.po b/debian/po/de.po index 2aaa82c47..9b3be4378 100644 --- a/debian/po/de.po +++ b/debian/po/de.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: i2p 0.8.9-1\n" -"Report-Msgid-Bugs-To: killyourtv@mail.i2p\n" -"POT-Creation-Date: 2011-06-16 17:09+0000\n" +"Report-Msgid-Bugs-To: i2p@packages.debian.org\n" +"POT-Creation-Date: 2011-12-10 04:00+0000\n" "PO-Revision-Date: 2011-07-20 04:30+0100\n" "Last-Translator: mixxy \n" "Language-Team: de\n" @@ -25,8 +25,12 @@ msgstr "Soll der I2P-Router beim Hochfahren mitgestartet werden?" #. Type: boolean #. Description #: ../i2p.templates:2001 -msgid "The I2P router can be run as a daemon that starts automatically when your computer boots up. This is the recommended configuration." -msgstr "Der I2P-Router kann als Dämon laufen und beim Hochfahren des Betriebssystems mitgestartet werden. Diese Option wird empfohlen." +msgid "" +"The I2P router can be run as a daemon that starts automatically when your " +"computer boots up. This is the recommended configuration." +msgstr "" +"Der I2P-Router kann als Dämon laufen und beim Hochfahren des Betriebssystems " +"mitgestartet werden. Diese Option wird empfohlen." #. Type: string #. Description @@ -37,8 +41,16 @@ msgstr "Benutzer für den I2P-Dämon" #. Type: string #. Description #: ../i2p.templates:3001 -msgid "By default I2P is configured to run under the account i2psvc when running as a daemon. To use an **existing** I2P profile you may enter a different account name here. For example, if your previous I2P installation is at /home/user/i2p, you may enter 'user' here." -msgstr "Standardmäßig ist I2P so eingestellt, dass es im Dämonmodus der unter dem Benutzer i2psvc läuft. Um ein bereits **vorhandenes** I2P-Profil zu benutzen, kannst du hier einen anderen Benutzer angeben. Beispiel: Wenn deine alte I2P-Installation in /home/ich/i2p residiert, gib hier 'ich' ein." +msgid "" +"By default I2P is configured to run under the account i2psvc when running as " +"a daemon. To use an **existing** I2P profile you may enter a different " +"account name here. For example, if your previous I2P installation is at /" +"home/user/i2p, you may enter 'user' here." +msgstr "" +"Standardmäßig ist I2P so eingestellt, dass es im Dämonmodus der unter dem " +"Benutzer i2psvc läuft. Um ein bereits **vorhandenes** I2P-Profil zu " +"benutzen, kannst du hier einen anderen Benutzer angeben. Beispiel: Wenn " +"deine alte I2P-Installation in /home/ich/i2p residiert, gib hier 'ich' ein." #. Type: string #. Description @@ -46,3 +58,22 @@ msgstr "Standardmäßig ist I2P so eingestellt, dass es im Dämonmodus der unter msgid "Very important: The account specified here *MUST* already exist." msgstr "WICHTIG; Der hier angegebene Benutzer *MUSS* bereits existieren!" +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "Memory that can be allocated to I2P:" +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "By default, I2P will only be allowed to use up to 128MB of RAM." +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "" +"High bandwidth routers, as well as routers with a lot of active torrents / " +"plugins, may need to have this value increased." +msgstr "" diff --git a/debian/po/es.po b/debian/po/es.po index 61e14cf30..75ece4b07 100644 --- a/debian/po/es.po +++ b/debian/po/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: i2p 0.8.9-1\n" -"Report-Msgid-Bugs-To: killyourtv@mail.i2p\n" -"POT-Creation-Date: 2011-06-16 17:09+0000\n" +"Report-Msgid-Bugs-To: i2p@packages.debian.org\n" +"POT-Creation-Date: 2011-12-10 04:00+0000\n" "PO-Revision-Date: 2011-07-20 04:33+0100\n" "Last-Translator: mixxy \n" "Language-Team: es\n" @@ -25,8 +25,12 @@ msgstr "Iniciar I2P automáticamente en el arranque?" #. Type: boolean #. Description #: ../i2p.templates:2001 -msgid "The I2P router can be run as a daemon that starts automatically when your computer boots up. This is the recommended configuration." -msgstr "El router I2P se puede ejecutar como demonio que inicia automaticamente al arrancar la computadora. Ésta es la opción recomendada." +msgid "" +"The I2P router can be run as a daemon that starts automatically when your " +"computer boots up. This is the recommended configuration." +msgstr "" +"El router I2P se puede ejecutar como demonio que inicia automaticamente al " +"arrancar la computadora. Ésta es la opción recomendada." #. Type: string #. Description @@ -37,8 +41,17 @@ msgstr "Usuario del demonio I2P:" #. Type: string #. Description #: ../i2p.templates:3001 -msgid "By default I2P is configured to run under the account i2psvc when running as a daemon. To use an **existing** I2P profile you may enter a different account name here. For example, if your previous I2P installation is at /home/user/i2p, you may enter 'user' here." -msgstr "Por defecto, I2P está configurado para ejecutarse con el usuario i2psvc si el modo de demonio está activado. Para usar un perfil **ya existente** de I2P, puedes especificar aquí un nombre de cuenta diferente. Por ejemplo, si tu anterior instalación de I2P se halla en /home/pepe/i2p, puedes entrar aquí 'pepe'." +msgid "" +"By default I2P is configured to run under the account i2psvc when running as " +"a daemon. To use an **existing** I2P profile you may enter a different " +"account name here. For example, if your previous I2P installation is at /" +"home/user/i2p, you may enter 'user' here." +msgstr "" +"Por defecto, I2P está configurado para ejecutarse con el usuario i2psvc si " +"el modo de demonio está activado. Para usar un perfil **ya existente** de " +"I2P, puedes especificar aquí un nombre de cuenta diferente. Por ejemplo, si " +"tu anterior instalación de I2P se halla en /home/pepe/i2p, puedes entrar " +"aquí 'pepe'." #. Type: string #. Description @@ -46,3 +59,22 @@ msgstr "Por defecto, I2P está configurado para ejecutarse con el usuario i2psvc msgid "Very important: The account specified here *MUST* already exist." msgstr "Muy importante: El usuario especificado aquí *YA TIENE QUE* existir." +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "Memory that can be allocated to I2P:" +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "By default, I2P will only be allowed to use up to 128MB of RAM." +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "" +"High bandwidth routers, as well as routers with a lot of active torrents / " +"plugins, may need to have this value increased." +msgstr "" diff --git a/debian/po/pl.po b/debian/po/pl.po index 1768337bd..3cd968c3a 100644 --- a/debian/po/pl.po +++ b/debian/po/pl.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: I2P\n" -"Report-Msgid-Bugs-To: killyourtv@mail.i2p\n" -"POT-Creation-Date: 2011-06-16 17:09+0000\n" +"Report-Msgid-Bugs-To: i2p@packages.debian.org\n" +"POT-Creation-Date: 2011-12-10 04:00+0000\n" "PO-Revision-Date: 2011-10-08 12:41+0000\n" "Last-Translator: PolishAnon \n" "Language-Team: Polish (http://www.transifex.net/projects/p/I2P/team/pl/)\n" @@ -60,3 +60,23 @@ msgstr "" #: ../i2p.templates:3001 msgid "Very important: The account specified here *MUST* already exist." msgstr "Bardzo ważne: Podane tutaj konto *MUSI* istnieć." + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "Memory that can be allocated to I2P:" +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "By default, I2P will only be allowed to use up to 128MB of RAM." +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "" +"High bandwidth routers, as well as routers with a lot of active torrents / " +"plugins, may need to have this value increased." +msgstr "" diff --git a/debian/po/ru.po b/debian/po/ru.po index 9e007289d..d1c39bed4 100644 --- a/debian/po/ru.po +++ b/debian/po/ru.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: i2p 0.8.9-1\n" -"Report-Msgid-Bugs-To: killyourtv@mail.i2p\n" -"POT-Creation-Date: 2011-06-16 17:09+0000\n" +"Report-Msgid-Bugs-To: i2p@packages.debian.org\n" +"POT-Creation-Date: 2011-12-10 04:00+0000\n" "PO-Revision-Date: 2011-06-21 20:59+0500\n" "Last-Translator: Hidden Z \n" "Language-Team: ru\n" @@ -58,3 +58,23 @@ msgstr "" msgid "Very important: The account specified here *MUST* already exist." msgstr "" "Очень важно: аккаунт, указанный здесь, обязательно должен существовать." + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "Memory that can be allocated to I2P:" +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "By default, I2P will only be allowed to use up to 128MB of RAM." +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "" +"High bandwidth routers, as well as routers with a lot of active torrents / " +"plugins, may need to have this value increased." +msgstr "" diff --git a/debian/po/sv.po b/debian/po/sv.po index 35c56aaa0..01879f1bb 100644 --- a/debian/po/sv.po +++ b/debian/po/sv.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: I2P 0.8.9 \n" -"Report-Msgid-Bugs-To: killyourtv@mail.i2p\n" -"POT-Creation-Date: 2011-06-16 17:09+0000\n" +"Report-Msgid-Bugs-To: i2p@packages.debian.org\n" +"POT-Creation-Date: 2011-12-10 04:00+0000\n" "PO-Revision-Date: 2011-10-11 17:20+0000\n" "Last-Translator: digitalmannen \n" "Language-Team: Swedish (Sweden) (http://www.transifex.net/projects/p/I2P/" @@ -59,3 +59,23 @@ msgstr "" #: ../i2p.templates:3001 msgid "Very important: The account specified here *MUST* already exist." msgstr "*OBS!* Kontot som anges *måste* existera." + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "Memory that can be allocated to I2P:" +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "By default, I2P will only be allowed to use up to 128MB of RAM." +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "" +"High bandwidth routers, as well as routers with a lot of active torrents / " +"plugins, may need to have this value increased." +msgstr "" diff --git a/debian/po/templates.pot b/debian/po/templates.pot index 39666c6e3..eaf75ba1c 100644 --- a/debian/po/templates.pot +++ b/debian/po/templates.pot @@ -1,14 +1,14 @@ -# debconf translation -# Copyright (C) 2011 The I2P Project -# This file is distributed under the same license as the i2p package. +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: killyourtv@mail.i2p\n" -"POT-Creation-Date: 2011-06-16 17:09+0000\n" +"Report-Msgid-Bugs-To: i2p@packages.debian.org\n" +"POT-Creation-Date: 2011-12-10 04:00+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -52,3 +52,23 @@ msgstr "" #: ../i2p.templates:3001 msgid "Very important: The account specified here *MUST* already exist." msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "Memory that can be allocated to I2P:" +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "By default, I2P will only be allowed to use up to 128MB of RAM." +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "" +"High bandwidth routers, as well as routers with a lot of active torrents / " +"plugins, may need to have this value increased." +msgstr "" diff --git a/debian/po/uk.po b/debian/po/uk.po index 82ffed5a1..99d82cd02 100644 --- a/debian/po/uk.po +++ b/debian/po/uk.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: I2P\n" -"Report-Msgid-Bugs-To: killyourtv@mail.i2p\n" -"POT-Creation-Date: 2011-06-16 17:09+0000\n" +"Report-Msgid-Bugs-To: i2p@packages.debian.org\n" +"POT-Creation-Date: 2011-12-10 04:00+0000\n" "PO-Revision-Date: 2011-10-29 19:10+0000\n" "Last-Translator: Pharmasolin \n" "Language-Team: Ukrainian (Ukraine) (http://www.transifex.net/projects/p/I2P/" @@ -61,3 +61,23 @@ msgstr "" #: ../i2p.templates:3001 msgid "Very important: The account specified here *MUST* already exist." msgstr "Дуже важливо: Аккаунт, вказаний тут * ПОВИНЕН * вже існувати." + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "Memory that can be allocated to I2P:" +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "By default, I2P will only be allowed to use up to 128MB of RAM." +msgstr "" + +#. Type: string +#. Description +#: ../i2p.templates:4001 +msgid "" +"High bandwidth routers, as well as routers with a lot of active torrents / " +"plugins, may need to have this value increased." +msgstr ""