From cb56b76ef96177e92b741c1c2cc193c701416d83 Mon Sep 17 00:00:00 2001
From: kytv <kytv@mail.i2p>
Date: Sat, 13 Oct 2012 12:45:25 +0000
Subject: [PATCH] i2prouter: check /proc/1/comm for systemd (thanks k0e)

---
 installer/resources/i2prouter | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/installer/resources/i2prouter b/installer/resources/i2prouter
index d498777955..fde3a0d470 100644
--- a/installer/resources/i2prouter
+++ b/installer/resources/i2prouter
@@ -45,7 +45,7 @@ GETTEXT=$(which gettext > /dev/null 2>&1)
 
 # Where to install the systemd service
 SYSTEMD_SERVICE="/etc/systemd/system/${APP_NAME}.service"
-if grep -q systemd /proc/cmdline; then
+if grep -q systemd /proc/1/comm ; then
     USE_SYSTEMD=1
 fi
 
@@ -1321,6 +1321,8 @@ installdaemon() {
                                 echo "esac"  >> /etc/rc.d/${APP_NAME}
                                 chmod 755 /etc/rc.d/${APP_NAME}
                                 chown root:root /etc/rc.d/${APP_NAME}
+                                eval echo `gettext ' The $APP_LONG_NAME daemon has been installed.'`
+                                eval echo `gettext ' Add \"i2p\" to the DAEMONS variable in /etc/rc.conf to enable.'`
                             else
                                 # We'll end up here if systemd is enabled.
                                 # If systemd is enabled we don't need the initscript
@@ -1330,10 +1332,6 @@ installdaemon() {
                         if [ ! -f "${SYSTEMD_SERVICE}" ]; then
                             installsystemd
                         fi
-                    if ! grep -q systemd /proc/cmdline; then
-                        eval echo `gettext ' The $APP_LONG_NAME daemon has been installed.'`
-                        eval echo `gettext ' Add \"i2p\" to the DAEMONS variable in /etc/rc.conf to enable.'`
-                    fi
                 fi
             elif [ -f /etc/SuSE-release ] ; then
                 eval echo `gettext 'Detected SuSE or SLES:'`
-- 
GitLab