| 1 |
[Unit] |
| 2 |
Description=C++ daemon for accessing the I2P network |
| 3 |
Documentation=man:i2pd(1) https://i2pd.readthedocs.io/en/latest/ |
| 4 |
Wants=network.target |
| 5 |
After=network.target network-online.target |
| 6 |
ConditionFileIsExecutable=/usr/bin/i2pd |
| 7 |
|
| 8 |
[Service] |
| 9 |
User=i2pd |
| 10 |
Group=i2pd |
| 11 |
RuntimeDirectory=i2pd |
| 12 |
RuntimeDirectoryMode=0700 |
| 13 |
LogsDirectory=i2pd |
| 14 |
LogsDirectoryMode=0700 |
| 15 |
Type=forking |
| 16 |
Environment="DAEMON_OPTS=--conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf --tunnelsdir=/etc/i2pd/tunnels.conf.d --pidfile=/run/i2pd/i2pd.pid --logfile=/var/log/i2pd/i2pd.log --daemon --service" |
| 17 |
EnvironmentFile=-/etc/default/i2pd |
| 18 |
ExecStart=/usr/bin/i2pd $DAEMON_OPTS |
| 19 |
ExecReload=/bin/sh -c "kill -HUP $MAINPID" |
| 20 |
PIDFile=/run/i2pd/i2pd.pid |
| 21 |
### Uncomment, if auto restart needed |
| 22 |
#Restart=on-failure |
| 23 |
|
| 24 |
# Use SIGTERM to stop i2pd immediately. |
| 25 |
# Some cleanup processes can delay stopping, so we set 30 seconds timeout and then SIGKILL i2pd. |
| 26 |
KillSignal=SIGTERM |
| 27 |
TimeoutStopSec=30s |
| 28 |
SendSIGKILL=yes |
| 29 |
|
| 30 |
# If you have the patience waiting 10 min on restarting/stopping it, uncomment this. |
| 31 |
# i2pd stops accepting new tunnels and waits ~10 min while old ones do not die. |
| 32 |
#KillSignal=SIGINT |
| 33 |
#TimeoutStopSec=10m |
| 34 |
|
| 35 |
# If you have problems with hanging i2pd, you can try increase this |
| 36 |
LimitNOFILE=8192 |
| 37 |
# To enable write of coredump uncomment this |
| 38 |
#LimitCORE=infinity |
| 39 |
#hardening |
| 40 |
ProtectControlGroups=true |
| 41 |
ProtectKernelModules=true |
| 42 |
ProtectKernelTunables=true |
| 43 |
NoNewPrivileges=true |
| 44 |
RestrictNamespaces=true |
| 45 |
ProtectSystem=full |
| 46 |
ReadWritePaths=-/var/lib/i2pd |
| 47 |
ReadWritePaths=-/run/i2pd |
| 48 |
ReadWritePaths=-/etc/i2pd |
| 49 |
|
| 50 |
[Install] |
| 51 |
WantedBy=multi-user.target |