Changeset 03ff4dc0 for debian


Ignore:
Timestamp:
Dec 10, 2011 2:17:37 AM (9 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
fc7d8f7
Parents:
1d842f02
Message:

Add wrapper.java.maxmemory to debconf

The amount of RAM that I2P is limited to can be adjusted using debconf. The
value in /etc/i2p/wrapper.config is stored in the debconf db and is written to
/etc/default/i2p.

Location:
debian
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • debian/i2p.config

    r1d842f02 r03ff4dc0  
    88# Load config file if it exists
    99if [ -e $conffile ]; then
    10         . $conffile
     10        . $conffile
    1111
    12         db_set i2p/daemon "$RUN_DAEMON"
    13         db_set i2p/user "$I2PUSER"
     12        # wrapper.config always takes priority
     13        MEMORYLIMIT=$(sed -e '/^wrapper\.java\.maxmemory/!d' -e 's/^wrapper\.java\.maxmemory\ *=\ *//' /etc/i2p/wrapper.config)
     14
     15
     16        db_set i2p/daemon "$RUN_DAEMON"
     17        db_set i2p/user "$I2PUSER"
     18        db_set i2p/memory "$MEMORYLIMIT"
    1419fi
    1520
     
    1823db_get i2p/daemon || true
    1924if [ "$RET" = "true" ]; then
    20         db_input medium i2p/user || true
    21         db_go
     25        db_input medium i2p/user || true
     26        db_go
    2227fi
     28
     29db_input medium i2p/memory || true
     30db_go
  • debian/i2p.postinst

    r1d842f02 r03ff4dc0  
    1313
    1414case "$1" in
    15         configure|reconfigure)
    16                 if [ ! -e $conffile ]; then
    17                         echo "# Defaults for i2p initscript (/etc/init.d/i2p" >> $conffile
    18                         echo "# This is a posix shell fragment" >> $conffile
    19                         echo >> $conffile
    20                         echo "# [automatically edited by postinst, do not change line format ]" >> $conffile
    21                         echo "# Run 'dpkg-reconfigure -plow i2p' to change these values." >> $conffile
    22                         echo >> $conffile
    23                         echo "RUN_DAEMON=" >> $conffile
    24                         echo "I2PUSER=" >> $conffile
    25                 fi
     15    configure|reconfigure)
     16        if [ ! -e $conffile ]; then
     17            echo "# Defaults for i2p initscript (/etc/init.d/i2p" >> $conffile
     18            echo "# This is a posix shell fragment" >> $conffile
     19            echo >> $conffile
     20            echo "# [automatically edited by postinst, do not change line format ]" >> $conffile
     21            echo "# Run 'dpkg-reconfigure -plow i2p' to change these values." >> $conffile
     22            echo >> $conffile
     23            echo "RUN_DAEMON=" >> $conffile
     24            echo "I2PUSER=" >> $conffile
     25            echo "# The next value is also wrapper.java.maxmemory in /etc/i2p/wrapper.config" >> $conffile
     26            echo "MEMORYLIMIT=" >> $conffile
     27        fi
    2628
    27                 db_get i2p/daemon
    28                 RUN_DAEMON="$RET"
    29                 db_get i2p/user
    30                 I2PUSER="$RET"
     29        db_get i2p/daemon
     30        RUN_DAEMON="$RET"
     31        db_get i2p/user
     32        I2PUSER="$RET"
     33        db_get i2p/memory
     34        MEMORYLIMIT="$RET"
    3135
    32                 cp -a -f $conffile $conffile.tmp
     36        cp -a -f $conffile $conffile.tmp
    3337
    34                 # If the admin deleted or commented some variables but then set them via debconf,
    35                 # (re-)add them to the conffile.
    36                 test -z "$RUN_DAEMON" || grep -Eq '^ *RUN_DAEMON=' $conffile || \
    37                         echo "RUN_DAEMON=" >> $conffile
    38                 test -z "$I2PUSER" || grep -Eq '^ *I2PUSER=' $conffile || \
    39                         echo "I2PUSER=" >> $conffile
     38        # If the admin deleted or commented some variables but then set them via debconf,
     39        # (re-)add them to the conffile.
     40        test -z "$RUN_DAEMON" || grep -Eq '^ *RUN_DAEMON=' $conffile || \
     41            echo "RUN_DAEMON=" >> $conffile
     42        test -z "$I2PUSER" || grep -Eq '^ *I2PUSER=' $conffile || \
     43            echo "I2PUSER=" >> $conffile
     44        test -z "$MEMORYLIMIT" || grep -Eq '^ *MEMORYLIMIT=' $conffile || \
     45            echo "MEMORYLIMIT=" >> $conffile
    4046
    41                 if [ -z $RUN_DAEMON ]; then
    42                         RUN_DAEMON="false"
    43                         I2PUSER="i2psvc"
    44                 fi
     47        if [ -z $RUN_DAEMON ]; then
     48            RUN_DAEMON="false"
     49            I2PUSER="i2psvc"
     50        fi
    4551
    46                 sed -e "s/^ *RUN_DAEMON=.*/RUN_DAEMON=\"$RUN_DAEMON\"/" \
    47                         -e "s/^ *I2PUSER=.*/I2PUSER=\"$I2PUSER\"/" \
    48                         < $conffile > $conffile.tmp
    49                 mv -f $conffile.tmp $conffile
    5052
    51         migrate_existing_user(){
    52                 # Adjust the user/group in /etc/passwd, mainly for upgrades from old packages that didn't
    53                 # create $I2PSYSUSER as a system group/user
    54                 usermod -c "I2P Router Daemon" -m -d $I2PHOME -g $I2PSYSUSER -s "/bin/false" \
    55                         -l $I2PSYSUSER -e 1 > /dev/null 2>&1
    56                 echo "Existing user migrated, home directory moved to $I2PHOME"
    57         }
    5853
    59         # Create user and group as a system user.
    60         adduser --system --quiet --group --home $I2PHOME $I2PSYSUSER || migrate_existing_user
     54        sed -e "s/^ *RUN_DAEMON=.*/RUN_DAEMON=\"$RUN_DAEMON\"/" \
     55            -e "s/^ *I2PUSER=.*/I2PUSER=\"$I2PUSER\"/" \
     56            -e "s/^ *MEMORYLIMIT=.*/MEMORYLIMIT=\"$MEMORYLIMIT\"/" \
     57            < $conffile > $conffile.tmp
     58        mv -f $conffile.tmp $conffile
    6159
    62         [ -d /var/log/i2p ] || mkdir -m0750 /var/log/i2p
    63         chown -f -R $I2PSYSUSER:adm /var/log/i2p
     60        sed -e "s/^ *wrapper\.java\.maxmemory=.*/wrapper\.java\.maxmemory=$MEMORYLIMIT/" \
     61            < /etc/i2p/wrapper.config > /etc/i2p/wrapper.config.tmp
     62        mv -f /etc/i2p/wrapper.config.tmp /etc/i2p/wrapper.config
    6463
    65         # Has someone set the permissions with dpkg-statoverride? If so, obey them.
    66         if ! dpkg-statoverride --list $I2PHOME > /dev/null 2>&1
    67         then
    68                 chown -f -R $I2PSYSUSER:$I2PSYSUSER $I2PHOME
    69                 chmod -f u=rwx,g=rxs,o= $I2PHOME
    70         fi
     64    migrate_existing_user(){
     65        # Adjust the user/group in /etc/passwd, mainly for upgrades from old packages that didn't
     66        # create $I2PSYSUSER as a system group/user
     67        usermod -c "I2P Router Daemon" -m -d $I2PHOME -g $I2PSYSUSER -s "/bin/false" \
     68            -l $I2PSYSUSER -e 1 > /dev/null 2>&1
     69        echo "Existing user migrated, home directory moved to $I2PHOME"
     70    }
    7171
    72         db_stop
     72    # Create user and group as a system user.
     73    adduser --system --quiet --group --home $I2PHOME $I2PSYSUSER || migrate_existing_user
     74
     75    [ -d /var/log/i2p ] || mkdir -m0750 /var/log/i2p
     76    chown -f -R $I2PSYSUSER:adm /var/log/i2p
     77
     78    # Has someone set the permissions with dpkg-statoverride? If so, obey them.
     79    if ! dpkg-statoverride --list $I2PHOME > /dev/null 2>&1
     80    then
     81        chown -f -R $I2PSYSUSER:$I2PSYSUSER $I2PHOME
     82        chmod -f u=rwx,g=rxs,o= $I2PHOME
     83    fi
     84
     85    db_stop
    7386;;
    7487abort-upgrade|abort-remove|abort-deconfigure)
    75         echo "Aborting upgrade"
    76         exit 0
    77         ;;
     88    echo "Aborting upgrade"
     89    exit 0
     90    ;;
    7891*)
    7992        echo "postinst called with unknown argument \`$1'" >&2
     
    8194                ;;
    8295esac
    83        
     96   
    8497#DEBHELPER#
    8598
  • debian/i2p.templates

    r1d842f02 r03ff4dc0  
    33##Default: false
    44##_Description: Automatically stop I2P when there are upgrades?
    5 ## To update this package the I2P router will need to be restarted. 
     5## To update this package the I2P router will need to be restarted.
    66## Any activity on the I2P network will be briefly interrupted
    77## during the upgrade.
     
    2121 as a daemon. To use an **existing** I2P profile you may enter a different
    2222 account name here. For example, if your previous I2P installation is at
    23  /home/user/i2p, you may enter 'user' here. 
     23 /home/user/i2p, you may enter 'user' here.
    2424 .
    2525 Very important: The account specified here *MUST* already exist.
     26
     27Template: i2p/memory
     28Type: string
     29Default: 128
     30_Description: Memory that can be allocated to I2P:
     31 By default, I2P will only be allowed to use up to 128MB of RAM.
     32 .
     33 High bandwidth routers, as well as routers with a lot of active torrents / plugins, may
     34 need to have this value increased.
  • debian/po/de.po

    r1d842f02 r03ff4dc0  
    77msgstr ""
    88"Project-Id-Version: i2p 0.8.9-1\n"
    9 "Report-Msgid-Bugs-To: killyourtv@mail.i2p\n"
    10 "POT-Creation-Date: 2011-06-16 17:09+0000\n"
     9"Report-Msgid-Bugs-To: i2p@packages.debian.org\n"
     10"POT-Creation-Date: 2011-12-10 04:00+0000\n"
    1111"PO-Revision-Date: 2011-07-20 04:30+0100\n"
    1212"Last-Translator: mixxy <m1xxy@mail.i2p>\n"
     
    2626#. Description
    2727#: ../i2p.templates:2001
    28 msgid "The I2P router can be run as a daemon that starts automatically when your computer boots up. This is the recommended configuration."
    29 msgstr "Der I2P-Router kann als Dämon laufen und beim Hochfahren des Betriebssystems mitgestartet werden. Diese Option wird empfohlen."
     28msgid ""
     29"The I2P router can be run as a daemon that starts automatically when your "
     30"computer boots up. This is the recommended configuration."
     31msgstr ""
     32"Der I2P-Router kann als Dämon laufen und beim Hochfahren des Betriebssystems "
     33"mitgestartet werden. Diese Option wird empfohlen."
    3034
    3135#. Type: string
     
    3842#. Description
    3943#: ../i2p.templates:3001
    40 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."
    41 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."
     44msgid ""
     45"By default I2P is configured to run under the account i2psvc when running as "
     46"a daemon. To use an **existing** I2P profile you may enter a different "
     47"account name here. For example, if your previous I2P installation is at /"
     48"home/user/i2p, you may enter 'user' here."
     49msgstr ""
     50"Standardmäßig ist I2P so eingestellt, dass es im Dämonmodus der unter dem "
     51"Benutzer i2psvc läuft. Um ein bereits **vorhandenes** I2P-Profil zu "
     52"benutzen, kannst du hier einen anderen Benutzer angeben. Beispiel: Wenn "
     53"deine alte I2P-Installation in /home/ich/i2p residiert, gib hier 'ich' ein."
    4254
    4355#. Type: string
     
    4759msgstr "WICHTIG; Der hier angegebene Benutzer *MUSS* bereits existieren!"
    4860
     61#. Type: string
     62#. Description
     63#: ../i2p.templates:4001
     64msgid "Memory that can be allocated to I2P:"
     65msgstr ""
     66
     67#. Type: string
     68#. Description
     69#: ../i2p.templates:4001
     70msgid "By default, I2P will only be allowed to use up to 128MB of RAM."
     71msgstr ""
     72
     73#. Type: string
     74#. Description
     75#: ../i2p.templates:4001
     76msgid ""
     77"High bandwidth routers, as well as routers with a lot of active torrents / "
     78"plugins, may need to have this value increased."
     79msgstr ""
  • debian/po/es.po

    r1d842f02 r03ff4dc0  
    77msgstr ""
    88"Project-Id-Version: i2p 0.8.9-1\n"
    9 "Report-Msgid-Bugs-To: killyourtv@mail.i2p\n"
    10 "POT-Creation-Date: 2011-06-16 17:09+0000\n"
     9"Report-Msgid-Bugs-To: i2p@packages.debian.org\n"
     10"POT-Creation-Date: 2011-12-10 04:00+0000\n"
    1111"PO-Revision-Date: 2011-07-20 04:33+0100\n"
    1212"Last-Translator: mixxy <m1xxy@mail.i2p>\n"
     
    2626#. Description
    2727#: ../i2p.templates:2001
    28 msgid "The I2P router can be run as a daemon that starts automatically when your computer boots up. This is the recommended configuration."
    29 msgstr "El router I2P se puede ejecutar como demonio que inicia automaticamente al arrancar la computadora. Ésta es la opción recomendada."
     28msgid ""
     29"The I2P router can be run as a daemon that starts automatically when your "
     30"computer boots up. This is the recommended configuration."
     31msgstr ""
     32"El router I2P se puede ejecutar como demonio que inicia automaticamente al "
     33"arrancar la computadora. Ésta es la opción recomendada."
    3034
    3135#. Type: string
     
    3842#. Description
    3943#: ../i2p.templates:3001
    40 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."
    41 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'."
     44msgid ""
     45"By default I2P is configured to run under the account i2psvc when running as "
     46"a daemon. To use an **existing** I2P profile you may enter a different "
     47"account name here. For example, if your previous I2P installation is at /"
     48"home/user/i2p, you may enter 'user' here."
     49msgstr ""
     50"Por defecto, I2P está configurado para ejecutarse con el usuario i2psvc si "
     51"el modo de demonio está activado. Para usar un perfil **ya existente** de "
     52"I2P, puedes especificar aquí un nombre de cuenta diferente. Por ejemplo, si "
     53"tu anterior instalación de I2P se halla en /home/pepe/i2p, puedes entrar "
     54"aquí 'pepe'."
    4255
    4356#. Type: string
     
    4760msgstr "Muy importante: El usuario especificado aquí *YA TIENE QUE* existir."
    4861
     62#. Type: string
     63#. Description
     64#: ../i2p.templates:4001
     65msgid "Memory that can be allocated to I2P:"
     66msgstr ""
     67
     68#. Type: string
     69#. Description
     70#: ../i2p.templates:4001
     71msgid "By default, I2P will only be allowed to use up to 128MB of RAM."
     72msgstr ""
     73
     74#. Type: string
     75#. Description
     76#: ../i2p.templates:4001
     77msgid ""
     78"High bandwidth routers, as well as routers with a lot of active torrents / "
     79"plugins, may need to have this value increased."
     80msgstr ""
  • debian/po/pl.po

    r1d842f02 r03ff4dc0  
    88msgstr ""
    99"Project-Id-Version: I2P\n"
    10 "Report-Msgid-Bugs-To: killyourtv@mail.i2p\n"
    11 "POT-Creation-Date: 2011-06-16 17:09+0000\n"
     10"Report-Msgid-Bugs-To: i2p@packages.debian.org\n"
     11"POT-Creation-Date: 2011-12-10 04:00+0000\n"
    1212"PO-Revision-Date: 2011-10-08 12:41+0000\n"
    1313"Last-Translator: PolishAnon <b790979@klzlk.com>\n"
     
    6161msgid "Very important: The account specified here *MUST* already exist."
    6262msgstr "Bardzo ważne: Podane tutaj konto *MUSI* istnieć."
     63
     64#. Type: string
     65#. Description
     66#: ../i2p.templates:4001
     67msgid "Memory that can be allocated to I2P:"
     68msgstr ""
     69
     70#. Type: string
     71#. Description
     72#: ../i2p.templates:4001
     73msgid "By default, I2P will only be allowed to use up to 128MB of RAM."
     74msgstr ""
     75
     76#. Type: string
     77#. Description
     78#: ../i2p.templates:4001
     79msgid ""
     80"High bandwidth routers, as well as routers with a lot of active torrents / "
     81"plugins, may need to have this value increased."
     82msgstr ""
  • debian/po/ru.po

    r1d842f02 r03ff4dc0  
    77msgstr ""
    88"Project-Id-Version: i2p 0.8.9-1\n"
    9 "Report-Msgid-Bugs-To: killyourtv@mail.i2p\n"
    10 "POT-Creation-Date: 2011-06-16 17:09+0000\n"
     9"Report-Msgid-Bugs-To: i2p@packages.debian.org\n"
     10"POT-Creation-Date: 2011-12-10 04:00+0000\n"
    1111"PO-Revision-Date: 2011-06-21 20:59+0500\n"
    1212"Last-Translator: Hidden Z <hiddenz@mail.i2p>\n"
     
    5959msgstr ""
    6060"Очень важно: аккаунт, указанный здесь, обязательно должен существовать."
     61
     62#. Type: string
     63#. Description
     64#: ../i2p.templates:4001
     65msgid "Memory that can be allocated to I2P:"
     66msgstr ""
     67
     68#. Type: string
     69#. Description
     70#: ../i2p.templates:4001
     71msgid "By default, I2P will only be allowed to use up to 128MB of RAM."
     72msgstr ""
     73
     74#. Type: string
     75#. Description
     76#: ../i2p.templates:4001
     77msgid ""
     78"High bandwidth routers, as well as routers with a lot of active torrents / "
     79"plugins, may need to have this value increased."
     80msgstr ""
  • debian/po/sv.po

    r1d842f02 r03ff4dc0  
    77msgstr ""
    88"Project-Id-Version: I2P 0.8.9 \n"
    9 "Report-Msgid-Bugs-To: killyourtv@mail.i2p\n"
    10 "POT-Creation-Date: 2011-06-16 17:09+0000\n"
     9"Report-Msgid-Bugs-To: i2p@packages.debian.org\n"
     10"POT-Creation-Date: 2011-12-10 04:00+0000\n"
    1111"PO-Revision-Date: 2011-10-11 17:20+0000\n"
    1212"Last-Translator: digitalmannen <digitalmannen@gmail.com>\n"
     
    6060msgid "Very important: The account specified here *MUST* already exist."
    6161msgstr "*OBS!* Kontot som anges *måste* existera."
     62
     63#. Type: string
     64#. Description
     65#: ../i2p.templates:4001
     66msgid "Memory that can be allocated to I2P:"
     67msgstr ""
     68
     69#. Type: string
     70#. Description
     71#: ../i2p.templates:4001
     72msgid "By default, I2P will only be allowed to use up to 128MB of RAM."
     73msgstr ""
     74
     75#. Type: string
     76#. Description
     77#: ../i2p.templates:4001
     78msgid ""
     79"High bandwidth routers, as well as routers with a lot of active torrents / "
     80"plugins, may need to have this value increased."
     81msgstr ""
  • debian/po/templates.pot

    r1d842f02 r03ff4dc0  
    1 # debconf translation
    2 # Copyright (C) 2011 The I2P Project
    3 # This file is distributed under the same license as the i2p package.
     1# SOME DESCRIPTIVE TITLE.
     2# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
     3# This file is distributed under the same license as the PACKAGE package.
    44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
    55#
     
    88msgstr ""
    99"Project-Id-Version: PACKAGE VERSION\n"
    10 "Report-Msgid-Bugs-To: killyourtv@mail.i2p\n"
    11 "POT-Creation-Date: 2011-06-16 17:09+0000\n"
     10"Report-Msgid-Bugs-To: i2p@packages.debian.org\n"
     11"POT-Creation-Date: 2011-12-10 04:00+0000\n"
    1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    5353msgid "Very important: The account specified here *MUST* already exist."
    5454msgstr ""
     55
     56#. Type: string
     57#. Description
     58#: ../i2p.templates:4001
     59msgid "Memory that can be allocated to I2P:"
     60msgstr ""
     61
     62#. Type: string
     63#. Description
     64#: ../i2p.templates:4001
     65msgid "By default, I2P will only be allowed to use up to 128MB of RAM."
     66msgstr ""
     67
     68#. Type: string
     69#. Description
     70#: ../i2p.templates:4001
     71msgid ""
     72"High bandwidth routers, as well as routers with a lot of active torrents / "
     73"plugins, may need to have this value increased."
     74msgstr ""
  • debian/po/uk.po

    r1d842f02 r03ff4dc0  
    88msgstr ""
    99"Project-Id-Version: I2P\n"
    10 "Report-Msgid-Bugs-To: killyourtv@mail.i2p\n"
    11 "POT-Creation-Date: 2011-06-16 17:09+0000\n"
     10"Report-Msgid-Bugs-To: i2p@packages.debian.org\n"
     11"POT-Creation-Date: 2011-12-10 04:00+0000\n"
    1212"PO-Revision-Date: 2011-10-29 19:10+0000\n"
    1313"Last-Translator: Pharmasolin <gribua@gmail.com>\n"
     
    6262msgid "Very important: The account specified here *MUST* already exist."
    6363msgstr "Дуже важливо: Аккаунт, вказаний тут * ПОВИНЕН * вже існувати."
     64
     65#. Type: string
     66#. Description
     67#: ../i2p.templates:4001
     68msgid "Memory that can be allocated to I2P:"
     69msgstr ""
     70
     71#. Type: string
     72#. Description
     73#: ../i2p.templates:4001
     74msgid "By default, I2P will only be allowed to use up to 128MB of RAM."
     75msgstr ""
     76
     77#. Type: string
     78#. Description
     79#: ../i2p.templates:4001
     80msgid ""
     81"High bandwidth routers, as well as routers with a lot of active torrents / "
     82"plugins, may need to have this value increased."
     83msgstr ""
Note: See TracChangeset for help on using the changeset viewer.