From b096834a54e554ef419ece327da1d044bb1fb6f7 Mon Sep 17 00:00:00 2001 From: kytv Date: Wed, 15 May 2013 13:04:46 +0000 Subject: [PATCH] installer/resources/i2prouter: various bugfixes - Explicitly specify shell when RUN_AS_USER is set. This allows I2P to start under limited accounts that do not have a defined shell. - When installing as a service, point out that I2P_CONFIG_DIR may need to be set. I2P_CONFIG_DIR defaults to $HOME/.i2p for the user that installed I2P and when running as a service this may not be desired. (e.g., RUN_AS_USER=i2p & I2P_CONFIG_DIR=/root/.i2p) (The RUN_AS_USER shell problem was spotted at https://github.com/mattias-ohlsson/i2p/blob/master/i2p.spec) --- installer/resources/i2prouter | 13 +++++++++---- installer/resources/locale/po/messages_de.po | 8 ++++---- installer/resources/locale/po/messages_en.po | 4 ++-- installer/resources/locale/po/messages_fr.po | 4 ++-- installer/resources/locale/po/messages_it.po | 4 ++-- installer/resources/locale/po/messages_ru.po | 4 ++-- installer/resources/locale/po/messages_sv.po | 8 ++++---- 7 files changed, 25 insertions(+), 20 deletions(-) diff --git a/installer/resources/i2prouter b/installer/resources/i2prouter index 67df892093..0563c4eba4 100644 --- a/installer/resources/i2prouter +++ b/installer/resources/i2prouter @@ -702,9 +702,9 @@ checkUser() { # if test -f "/sbin/runuser" then - /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $ADDITIONAL_PARA" + /sbin/runuser -s /bin/sh - $RUN_AS_USER -c "\"$REALPATH\" $ADDITIONAL_PARA" else - su - $RUN_AS_USER -c "\"$REALPATH\" $ADDITIONAL_PARA" + su - $RUN_AS_USER -s /bin/sh -c "\"$REALPATH\" $ADDITIONAL_PARA" fi RUN_AS_USER_EXITCODE=$? # Now that we are the original user again, we may need to clean up the lock file. @@ -1777,7 +1777,7 @@ showUsage() { } showsetusermesg() { - echo "`gettext 'Please edit $0 and set the variable RUN_AS_USER'`." + echo "`gettext 'Please edit i2prouter and set the variable RUN_AS_USER'`." } checkifstartingasroot() { @@ -1785,7 +1785,7 @@ checkifstartingasroot() { echo "`gettext 'Running I2P as the root user is *not* recommended.'`" showsetusermesg echo - echo "`gettext 'To run as root anyway, edit $0 and set ALLOW_ROOT=true.'`" + echo "`gettext 'To run as root anyway, edit i2prouter and set ALLOW_ROOT=true.'`" exit 1 fi } @@ -1853,11 +1853,16 @@ docommand() { 'install') installdaemon if [ ! `grep ^RUN_AS_USER $0` ]; then + echo showsetusermesg fi echo echo "You may want to disable the browser from launching at startup at" echo "http://127.0.0.1:7657/configclients" + echo + echo "I2P_CONFIG_DIR is currently set to $I2P_CONFIG_DIR." + echo "Change the value in $0 if this is not" + echo "appropriate for your configuration." ;; 'remove' | 'uninstall') diff --git a/installer/resources/locale/po/messages_de.po b/installer/resources/locale/po/messages_de.po index f64b343b05..18354a1ee1 100644 --- a/installer/resources/locale/po/messages_de.po +++ b/installer/resources/locale/po/messages_de.po @@ -189,14 +189,14 @@ msgid "Request a Java thread dump if running." msgstr "Falls gestartet, fordere einen Java Thread dump an" #: ../i2prouter:1780 -msgid "Please edit $0 and set the variable RUN_AS_USER" -msgstr "Bitte bearbeite $0 und setze die Variable RUN_AS_USER" +msgid "Please edit i2prouter and set the variable RUN_AS_USER" +msgstr "Bitte bearbeite i2prouter und setze die Variable RUN_AS_USER" #: ../i2prouter:1785 msgid "Running I2P as the root user is *not* recommended." msgstr "I2P als root Benutzer auszuführen ist *nicht* empfehlenswert." #: ../i2prouter:1788 -msgid "To run as root anyway, edit $0 and set ALLOW_ROOT=true." +msgid "To run as root anyway, edit i2prouter and set ALLOW_ROOT=true." msgstr "" -"Um I2P trotzdem als root auszuführen bearbeite $0 und setze ALLOW_ROOT=true." +"Um I2P trotzdem als root auszuführen bearbeite i2prouter und setze ALLOW_ROOT=true." diff --git a/installer/resources/locale/po/messages_en.po b/installer/resources/locale/po/messages_en.po index 603695fd7e..4d208e23fa 100644 --- a/installer/resources/locale/po/messages_en.po +++ b/installer/resources/locale/po/messages_en.po @@ -185,7 +185,7 @@ msgid "Request a Java thread dump if running." msgstr "" #: ../i2prouter:1780 -msgid "Please edit $0 and set the variable RUN_AS_USER" +msgid "Please edit i2prouter and set the variable RUN_AS_USER" msgstr "" #: ../i2prouter:1785 @@ -193,5 +193,5 @@ msgid "Running I2P as the root user is *not* recommended." msgstr "" #: ../i2prouter:1788 -msgid "To run as root anyway, edit $0 and set ALLOW_ROOT=true." +msgid "To run as root anyway, edit i2prouter and set ALLOW_ROOT=true." msgstr "" diff --git a/installer/resources/locale/po/messages_fr.po b/installer/resources/locale/po/messages_fr.po index 55a2c057ec..92d70bedeb 100644 --- a/installer/resources/locale/po/messages_fr.po +++ b/installer/resources/locale/po/messages_fr.po @@ -187,7 +187,7 @@ msgid "Request a Java thread dump if running." msgstr "" #: ../i2prouter:1780 -msgid "Please edit $0 and set the variable RUN_AS_USER" +msgid "Please edit i2prouter and set the variable RUN_AS_USER" msgstr "" #: ../i2prouter:1785 @@ -196,5 +196,5 @@ msgstr "" "Faire fonctionner I2P en tant qu'utilisateur root n'est *pas* recommandé." #: ../i2prouter:1788 -msgid "To run as root anyway, edit $0 and set ALLOW_ROOT=true." +msgid "To run as root anyway, edit i2prouter and set ALLOW_ROOT=true." msgstr "" diff --git a/installer/resources/locale/po/messages_it.po b/installer/resources/locale/po/messages_it.po index b3b1eea936..e309b3dca3 100644 --- a/installer/resources/locale/po/messages_it.po +++ b/installer/resources/locale/po/messages_it.po @@ -187,7 +187,7 @@ msgid "Request a Java thread dump if running." msgstr "" #: ../i2prouter:1780 -msgid "Please edit $0 and set the variable RUN_AS_USER" +msgid "Please edit i2prouter and set the variable RUN_AS_USER" msgstr "" #: ../i2prouter:1785 @@ -195,5 +195,5 @@ msgid "Running I2P as the root user is *not* recommended." msgstr "" #: ../i2prouter:1788 -msgid "To run as root anyway, edit $0 and set ALLOW_ROOT=true." +msgid "To run as root anyway, edit i2prouter and set ALLOW_ROOT=true." msgstr "" diff --git a/installer/resources/locale/po/messages_ru.po b/installer/resources/locale/po/messages_ru.po index 1fe035426b..b0f43136f5 100644 --- a/installer/resources/locale/po/messages_ru.po +++ b/installer/resources/locale/po/messages_ru.po @@ -188,7 +188,7 @@ msgid "Request a Java thread dump if running." msgstr "" #: ../i2prouter:1780 -msgid "Please edit $0 and set the variable RUN_AS_USER" +msgid "Please edit i2prouter and set the variable RUN_AS_USER" msgstr "" #: ../i2prouter:1785 @@ -196,5 +196,5 @@ msgid "Running I2P as the root user is *not* recommended." msgstr "" #: ../i2prouter:1788 -msgid "To run as root anyway, edit $0 and set ALLOW_ROOT=true." +msgid "To run as root anyway, edit i2prouter and set ALLOW_ROOT=true." msgstr "" diff --git a/installer/resources/locale/po/messages_sv.po b/installer/resources/locale/po/messages_sv.po index 8c89bb310f..11d7a311f2 100644 --- a/installer/resources/locale/po/messages_sv.po +++ b/installer/resources/locale/po/messages_sv.po @@ -187,13 +187,13 @@ msgid "Request a Java thread dump if running." msgstr "Fråga efter en Java thread dump vid drift." #: ../i2prouter:1780 -msgid "Please edit $0 and set the variable RUN_AS_USER" -msgstr "Var god ändra $0 och sätt variabeln RUN_AS_USER" +msgid "Please edit i2prouter and set the variable RUN_AS_USER" +msgstr "Var god ändra i2prouter och sätt variabeln RUN_AS_USER" #: ../i2prouter:1785 msgid "Running I2P as the root user is *not* recommended." msgstr "Att köra I2P som användare root är *inte* rekommenderat." #: ../i2prouter:1788 -msgid "To run as root anyway, edit $0 and set ALLOW_ROOT=true." -msgstr "För att köra som root iallafall, ändra $0 och sätt ALLOW_ROOT=true" +msgid "To run as root anyway, edit i2prouter and set ALLOW_ROOT=true." +msgstr "För att köra som root iallafall, ändra i2prouter och sätt ALLOW_ROOT=true"