From 319d748639e870d34700ebcdc9c44a9c7d65a932 Mon Sep 17 00:00:00 2001 From: yangfl Date: Sat, 3 Feb 2018 02:29:28 +0800 Subject: [PATCH] i2pd.service: do not block system shutdown for 10 min --- contrib/debian/i2pd.service | 28 +--------------------------- contrib/i2pd.service | 29 +++++++++++++++++++++++++++++ contrib/rpm/i2pd.service | 29 +---------------------------- 3 files changed, 31 insertions(+), 55 deletions(-) mode change 100644 => 120000 contrib/debian/i2pd.service create mode 100644 contrib/i2pd.service mode change 100644 => 120000 contrib/rpm/i2pd.service diff --git a/contrib/debian/i2pd.service b/contrib/debian/i2pd.service deleted file mode 100644 index 37f26f14..00000000 --- a/contrib/debian/i2pd.service +++ /dev/null @@ -1,27 +0,0 @@ -[Unit] -Description=I2P Router written in C++ -After=network.target - -[Service] -User=i2pd -Group=i2pd -RuntimeDirectory=i2pd -RuntimeDirectoryMode=0700 -Type=simple -ExecStart=/usr/sbin/i2pd --conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf --pidfile=/var/run/i2pd/i2pd.pid --logfile=/var/log/i2pd/i2pd.log --daemon --service -ExecReload=/bin/kill -HUP $MAINPID -PIDFile=/var/run/i2pd/i2pd.pid -### Uncomment, if auto restart needed -#Restart=on-failure - -### Use SIGINT for graceful stop daemon. -# i2pd stops accepting new tunnels and waits ~10 min while old ones do not die. -KillSignal=SIGINT -TimeoutStopSec=10m - -# If you have problems with hanging i2pd, you can try enable this -#LimitNOFILE=4096 -PrivateDevices=yes - -[Install] -WantedBy=multi-user.target diff --git a/contrib/debian/i2pd.service b/contrib/debian/i2pd.service new file mode 120000 index 00000000..ca477e3b --- /dev/null +++ b/contrib/debian/i2pd.service @@ -0,0 +1 @@ +../i2pd.service \ No newline at end of file diff --git a/contrib/i2pd.service b/contrib/i2pd.service new file mode 100644 index 00000000..5ed31d41 --- /dev/null +++ b/contrib/i2pd.service @@ -0,0 +1,29 @@ +[Unit] +Description=I2P Router written in C++ +Documentation=man:i2pd(1) https://i2pd.readthedocs.io/en/latest/ +After=network.target + +[Service] +User=i2pd +Group=i2pd +RuntimeDirectory=i2pd +RuntimeDirectoryMode=0700 +Type=simple +ExecStart=/usr/sbin/i2pd --conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf --pidfile=/var/run/i2pd/i2pd.pid --logfile=/var/log/i2pd/i2pd.log --daemon --service +ExecReload=/bin/kill -HUP $MAINPID +PIDFile=/var/run/i2pd/i2pd.pid +### Uncomment, if auto restart needed +#Restart=on-failure + +KillSignal=SIGQUIT +# If you have the patience waiting 10 min on restarting/stopping it, uncomment this. +# i2pd stops accepting new tunnels and waits ~10 min while old ones do not die. +#KillSignal=SIGINT +#TimeoutStopSec=10m + +# If you have problems with hanging i2pd, you can try enable this +#LimitNOFILE=4096 +PrivateDevices=yes + +[Install] +WantedBy=multi-user.target diff --git a/contrib/rpm/i2pd.service b/contrib/rpm/i2pd.service deleted file mode 100644 index 8a9c9584..00000000 --- a/contrib/rpm/i2pd.service +++ /dev/null @@ -1,28 +0,0 @@ -[Unit] -Description=I2P Router written in C++ -After=network.target - -[Service] -User=i2pd -Group=i2pd -PermissionsStartOnly=True -RuntimeDirectory=i2pd -RuntimeDirectoryMode=0700 -Type=simple -ExecStart=/usr/sbin/i2pd --conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf --pidfile=/var/run/i2pd/i2pd.pid --logfile=/var/log/i2pd/i2pd.log --daemon --service -ExecReload=/bin/kill -HUP $MAINPID -PIDFile=/var/run/i2pd/i2pd.pid -### Uncomment, if auto restart needed -#Restart=on-failure - -### Use SIGINT for graceful stop daemon. -# i2pd stops accepting new tunnels and waits ~10 min while old ones do not die. -KillSignal=SIGINT -TimeoutStopSec=10m - -# If you have problems with hunging i2pd, you can try enable this -#LimitNOFILE=4096 -PrivateDevices=yes - -[Install] -WantedBy=multi-user.target diff --git a/contrib/rpm/i2pd.service b/contrib/rpm/i2pd.service new file mode 120000 index 00000000..ca477e3b --- /dev/null +++ b/contrib/rpm/i2pd.service @@ -0,0 +1 @@ +../i2pd.service \ No newline at end of file