Browse Source

Update rpm spec and systemd unit

pull/1067/head
Darknet Villain 7 years ago
parent
commit
4ee364640d
  1. 23
      contrib/rpm/i2pd.service
  2. 18
      contrib/rpm/i2pd.spec

23
contrib/rpm/i2pd.service

@ -1,16 +1,27 @@
[Unit] [Unit]
Description=I2P router Description=I2P Router written in C++
After=network.target After=network.target
[Service] [Service]
User=i2pd User=i2pd
Group=i2pd Group=i2pd
RuntimeDirectory=i2pd
RuntimeDirectoryMode=0700
Type=simple Type=simple
ExecStart=/usr/bin/i2pd --service ExecStart=/usr/sbin/i2pd --conf=/etc/i2pd/i2pd.conf --pidfile=/var/run/i2pd/i2pd.pid --logfile=/var/log/i2pd/i2pd.log --daemon --service
PIDFile=/var/lib/i2pd/i2pd.pid ExecReload=/bin/kill -HUP $MAINPID
Restart=always PIDFile=/var/run/i2pd/i2pd.pid
PrivateTmp=true ### 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] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

18
contrib/rpm/i2pd.spec

@ -68,9 +68,15 @@ make %{?_smp_mflags}
%install %install
cd build cd build
chrpath -d i2pd chrpath -d i2pd
install -D -m 755 i2pd %{buildroot}%{_bindir}/i2pd install -D -m 755 i2pd %{buildroot}%{_sbindir}/i2pd
install -D -m 755 %{_builddir}/%{name}-%{version}/contrib/i2pd.conf %{buildroot}%{_sysconfdir}/i2pd/i2pd.conf
install -D -m 755 %{_builddir}/%{name}-%{version}/contrib/tunnels.conf %{buildroot}%{_sysconfdir}/i2pd/tunnels.conf
install -d -m 755 %{buildroot}/%{_datadir}/i2pd
%{__cp} -r %{_builddir}/%{name}-%{version}/contrib/certificates/ %{buildroot}%{_datadir}/i2pd/certificates
install -D -m 644 %{_builddir}/%{name}-%{version}/contrib/rpm/i2pd.service %{buildroot}/%{_unitdir}/i2pd.service install -D -m 644 %{_builddir}/%{name}-%{version}/contrib/rpm/i2pd.service %{buildroot}/%{_unitdir}/i2pd.service
install -d -m 700 %{buildroot}/%{_sharedstatedir}/i2pd install -d -m 700 %{buildroot}/%{_sharedstatedir}/i2pd
install -d -m 700 %{buildroot}/%{_localstatedir}/log/i2pd
ln -s %{_datadir}/%{name}/certificates %{buildroot}%{_sharedstatedir}/%{name}/certificates
%pre systemd %pre systemd
@ -94,12 +100,16 @@ getent passwd i2pd >/dev/null || \
%files %files
%doc LICENSE README.md %doc LICENSE README.md
%_bindir/i2pd %{_sbindir}/i2pd
%{_datadir}/i2pd/certificates
%config(noreplace) %{_sysconfdir}/i2pd/*
%files systemd %files systemd
/%_unitdir/i2pd.service /%{_unitdir}/i2pd.service
%dir %attr(0700,i2pd,i2pd) %_sharedstatedir/i2pd %dir %attr(0700,i2pd,i2pd) %{_localstatedir}/log/i2pd
%dir %attr(0700,i2pd,i2pd) %{_sharedstatedir}/i2pd
%{_sharedstatedir}/i2pd/certificates
%changelog %changelog

Loading…
Cancel
Save