Opened 6 months ago

Last modified 5 weeks ago

#2324 assigned defect

i2prouter doesnt recognize I2P running within Systemctl

Reported by: anonymous maybe Owned by: mhatta
Priority: minor Milestone: 0.9.39
Component: package/debian Version: 0.9.36
Keywords: systemd Cc:
Parent Tickets:


i2prouter status doesnt recognize i2p status if its run through systemctl:

user@host:~$ sudo systemctl status i2p
● i2p.service - load-balanced unspoofable packet switching network
   Loaded: loaded (/lib/systemd/system/i2p.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-10-03 13:53:55 UTC; 1min 15s ago
  Process: 868 ExecStart=/usr/sbin/wrapper $I2P_ARGS (code=exited, status=0/SUCCESS)
  Process: 863 ExecStartPre=/bin/chmod 750 /var/log/i2p (code=exited, status=0/SUCCESS)
  Process: 857 ExecStartPre=/bin/chown -R ${I2PUSER}:${I2PUSER} /var/log/i2p /run/i2p /tmp/i2p-daemon (code=exited, status=0/SUCCESS)
  Process: 833 ExecStartPre=/bin/mkdir -p /tmp/i2p-daemon (code=exited, status=0/SUCCESS)
 Main PID: 870 (wrapper)
    Tasks: 62 (limit: 4915)
   CGroup: /system.slice/i2p.service
           ├─870 /usr/sbin/wrapper /etc/i2p/wrapper.config
           └─950 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -DloggerFilenameOverride=/var/log/i2p/log-router-@.txt -Di2p.dir.base=/usr/share/i2p -Dwrapper.logfile

Oct 03 13:53:55 host systemd[1]: Starting load-balanced unspoofable packet switching network...
Oct 03 13:53:55 host systemd[1]: Started load-balanced unspoofable packet switching network.
user@host:~$ i2prouter status 
I2P Service is not running.

Expected Behavior:

to recognize I2P status

Actual Behavior:

it doesnt recognize I2P status

Subtickets (add)

Change History (3)

comment:1 Changed 6 months ago by zzz

  • Component changed from other to package/debian
  • Owner set to mhatta
  • Status changed from new to assigned

comment:2 Changed 2 months ago by backup

  • Keywords systemd added

Installing fresh 0.9.37 shows similar problems on a Arch Linux:

# ~/i2p/i2prouter

And running

sudo i2prouter install

to install the systemd unit results in following error in the journalctl when doing

sudo systemctl start i2p

i2prouter[1807]: Starting I2P Service...
i2prouter[1807]: Waiting for I2P Service...
i2prouter[1807]: ....
i2prouter[1807]: running: PID:1983
systemd[1]: i2p.service: New main PID 1983 does not belong to service, and PID file is not owned by root. Refusing.
systemd[1]: i2p.service: New main PID 1983 does not belong to service, and PID file is not owned by root. Refusing.
systemd[1]: i2p.service: Failed with result 'protocol'.
systemd[1]: Failed to start I2P Service.

# probably root-cause:
I found this:

systemd: be stricter when handling PID files and MAINPID sd_notify() messages

and systemd (?) deletes the invalid, although i2p is running, resulting in status errors on further calls on the status of the i2p process.

# Proposed solution:
Add this to the systemd unit i2p.service:


where i2puser has to be replaced by the provided RUN_AS_USER from i2p/i2prouter.
In these case runuser/su should not be called inside i2p/i2prouter script of course.

Thanks very much,

comment:3 Changed 5 weeks ago by zzz

  • Milestone changed from undecided to 0.9.39

Milestone set to .39 as requested by mhatta

Note: See TracTickets for help on using tickets.