Skip to main content
Topic: i2pd and i2pd-s6 fixes (Read 514 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

i2pd and i2pd-s6 fixes

I've been using i2pd with i2pd-s6 recently and am posting my fixes to some issues I've encountered.

The first is about logging. i2pd ships a tmpfiles config indicating /var/log/i2pd should be owned by user i2pd and with perm 700, which is incompatible with the logging provided by i2pd-s6, who s6-logs to the same directory with uid/gid set to s6log.

The second is that in the service script of i2pd-s6, the daemon is executed with uid/gid set to i2pd instead of root user, so a --service parameter should be added so that i2pd saves profiles to /var/lib/i2pd.

Diffs:

For s6-services
Code: [Select]
diff --git a/i2pd/i2pd-srv/run b/i2pd/i2pd-srv/run
index cd60d76..03c2ecc 100644
--- a/i2pd/i2pd-srv/run
+++ b/i2pd/i2pd-srv/run
@@ -1,3 +1,3 @@
 #!/bin/execlineb -P
 fdmove -c 2 1
-s6-setuidgid i2pd exec i2pd --log=stdout
+s6-setuidgid i2pd exec i2pd --log=stdout --service

For i2pd
Code: [Select]
diff --git a/trunk/i2pd.tmpfiles b/trunk/i2pd.tmpfiles
index f5b9818..221b001 100644
--- a/trunk/i2pd.tmpfiles
+++ b/trunk/i2pd.tmpfiles
@@ -1,5 +1,4 @@
 d /var/lib/i2pd 0700 i2pd i2pd - -
-d /var/log/i2pd 0700 i2pd i2pd - -
 L /var/lib/i2pd/i2pd.conf - - - - /etc/i2pd/i2pd.conf
 L /var/lib/i2pd/tunnels.d - - - - /etc/i2pd/tunnels.d
 L /var/lib/i2pd/tunnels.conf - - - - /etc/i2pd/tunnels.conf

Alternatively, the tmpfiles can be overriden by user config in /etc/tmpfiles.d for those reluctant to modify distro-shipped configs.

P.S. other packages indicating tmpfiles in /var/log are also potentially affected by this logging incompatibility (privoxy for example, although I've not really been using it). Moreover some packages provide files in /etc/logrotate.d, and this is also possibly in conflict with in-house logging mechanisms used in most s6 setups.

Re: i2pd and i2pd-s6 fixes

Reply #1
The other problem here is probably that /var/log/i2pd is owned by i2pd in the tmpfiles but the log service makes it owned by s6log. I hate it in when this happens.

Re: i2pd and i2pd-s6 fixes

Reply #2
I only use s6, but I guess it's impossible to get rid of tmpfiles in /var/log completely? Like OpenRC setups may need this for logging to work.

Re: i2pd and i2pd-s6 fixes

Reply #3
very offtopic but have you considered running java i2p/+ or is it too resource hungry for your use case?
i was originally on i2pd too but it was extremely complicated to both set up and change configs and clients as per needs

 

Re: i2pd and i2pd-s6 fixes

Reply #4
I've run the Java i2p a few years ago, and indeed it was too resource hungry to run on a laptop.
Configuration is okay for me, maybe because my use case is not too complicated: floodfill for servers and non-floodfill for other devices. I only host one eepsite (so only over HTTP).
The only problem I have with i2pd is that it keeps spamming logs with useless messages, even when the log level is set to error. On Artix it's mitigated by s6 logging, which ensures an upper bound on the log file size. I've had worse experience with syslog. I once ran i2pd on an OpenBSD box and the /var partition was filled up a few hours later, breaking a lot of stuff, because logrotate runs only everyday.