diff --git a/shadowsocks-libev-client@.service b/shadowsocks-libev-client@.service new file mode 100644 index 0000000..b16e82a --- /dev/null +++ b/shadowsocks-libev-client@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Daemon to start Shadowsocks-libev-client +Wants=network-online.target +After=network.target + +[Service] +Type=forking +PIDFile=/var/run/shadowsocks-libev-client@%i.pid +ExecStart=/usr/bin/ss-local -c /etc/shadowsocks/%i.json -f /var/run/shadowsocks-libev-client@%i.pid -u --fast-open +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/shadowsocks-libev-nat@.service b/shadowsocks-libev-nat@.service new file mode 100644 index 0000000..5019cf9 --- /dev/null +++ b/shadowsocks-libev-nat@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Daemon to start Shadowsocks-libev-nat +Wants=network-online.target +After=network.target + +[Service] +Type=forking +PIDFile=/var/run/shadowsocks-libev-nat@%i.pid +ExecStart=/usr/bin/ss-nat -c /etc/shadowsocks/%i.json -f /var/run/shadowsocks-libev-nat@%i.pid -u --fast-open +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/shadowsocks-libev-redir@.service b/shadowsocks-libev-redir@.service new file mode 100644 index 0000000..9e4c027 --- /dev/null +++ b/shadowsocks-libev-redir@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Daemon to start Shadowsocks-libev-redir +Wants=network-online.target +After=network.target + +[Service] +Type=forking +PIDFile=/var/run/shadowsocks-libev-redir@%i.pid +ExecStart=/usr/bin/ss-redir -c /etc/shadowsocks/%i.json -f /var/run/shadowsocks-libev-redir@%i.pid -u --fast-open +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/shadowsocks-libev-server@.service b/shadowsocks-libev-server@.service new file mode 100644 index 0000000..348a527 --- /dev/null +++ b/shadowsocks-libev-server@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Daemon to start Shadowsocks-libev-server +Wants=network-online.target +After=network.target + +[Service] +Type=forking +PIDFile=/var/run/shadowsocks-libev-server@%i.pid +ExecStart=/usr/bin/ss-server -c /etc/shadowsocks/%i.json -f /var/run/shadowsocks-libev-server@%i.pid -u --fast-open +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/shadowsocks-libev-tunnel.service b/shadowsocks-libev-tunnel.service index 8ad44c6..976db53 100644 --- a/shadowsocks-libev-tunnel.service +++ b/shadowsocks-libev-tunnel.service @@ -5,7 +5,7 @@ After=network.target [Service] Type=forking -PIDFile=/var/run/shadowsocks-libev.pid +PIDFile=/var/run/shadowsocks-libev-tunnel.pid ExecStart=/usr/bin/ss-tunnel -c /etc/shadowsocks/shadowsocks-libev-config.json -f /var/run/shadowsocks-libev-tunnel.pid -u --fast-open Restart=on-failure diff --git a/shadowsocks-libev-tunnel@.service b/shadowsocks-libev-tunnel@.service new file mode 100644 index 0000000..8b09578 --- /dev/null +++ b/shadowsocks-libev-tunnel@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Daemon to start Shadowsocks-libev-tunnel +Wants=network-online.target +After=network.target + +[Service] +Type=forking +PIDFile=/var/run/shadowsocks-libev-tunnel@%i.pid +ExecStart=/usr/bin/ss-tunnel -c /etc/shadowsocks/%i.json -f /var/run/shadowsocks-libev-tunnel@%i.pid -u --fast-open +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/shadowsocks-libev.changes b/shadowsocks-libev.changes index 2fbce46..950d378 100644 --- a/shadowsocks-libev.changes +++ b/shadowsocks-libev.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Sep 6 11:35:49 UTC 2020 - Hillwood Yang + +- Fix shadowsocks-libev-tunnel.service +- Add some systemd profiles + ------------------------------------------------------------------- Tue Jun 9 16:03:02 UTC 2020 - Dominique Leuenberger diff --git a/shadowsocks-libev.spec b/shadowsocks-libev.spec index 95974b1..0642737 100644 --- a/shadowsocks-libev.spec +++ b/shadowsocks-libev.spec @@ -33,6 +33,11 @@ Source4: %{name}-tunnel.service Source5: %{name}-nat.service Source6: %{name}-manager.service Source7: %{name}-redir.service +Source8: %{name}-client@.service +Source9: %{name}-server@.service +Source10: %{name}-tunnel@.service +Source11: %{name}-nat@.service +Source12: %{name}-redir@.service BuildRequires: libtool BuildRequires: mbedtls-devel BuildRequires: pkgconfig(libcares) @@ -118,6 +123,11 @@ install -m 644 %{SOURCE4} %{buildroot}%{_unitdir} install -m 644 %{SOURCE5} %{buildroot}%{_unitdir} install -m 644 %{SOURCE6} %{buildroot}%{_unitdir} install -m 644 %{SOURCE7} %{buildroot}%{_unitdir} +install -m 644 %{SOURCE8} %{buildroot}%{_unitdir} +install -m 644 %{SOURCE9} %{buildroot}%{_unitdir} +install -m 644 %{SOURCE10} %{buildroot}%{_unitdir} +install -m 644 %{SOURCE11} %{buildroot}%{_unitdir} +install -m 644 %{SOURCE12} %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_sbindir} ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-client ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-server @@ -125,6 +135,11 @@ ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-manager ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-nat ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-redir ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-tunnel +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-client@ +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-server@ +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-nat@ +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-redir@ +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-tunnel@ %pre %service_add_pre %{name}-server.service @@ -133,6 +148,11 @@ ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-tunnel %service_add_pre %{name}-nat.service %service_add_pre %{name}-redir.service %service_add_pre %{name}-tunnel.service +%service_add_pre %{name}-server@.service +%service_add_pre %{name}-client@.service +%service_add_pre %{name}-nat@.service +%service_add_pre %{name}-redir@.service +%service_add_pre %{name}-tunnel@.service %post %service_add_post %{name}-server.service @@ -141,6 +161,11 @@ ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-tunnel %service_add_post %{name}-nat.service %service_add_post %{name}-redir.service %service_add_post %{name}-tunnel.service +%service_add_post %{name}-server@.service +%service_add_post %{name}-client@.service +%service_add_post %{name}-nat@.service +%service_add_post %{name}-redir@.service +%service_add_post %{name}-tunnel@.service %preun %service_del_preun %{name}-server.service @@ -149,6 +174,11 @@ ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-tunnel %service_del_preun %{name}-nat.service %service_del_preun %{name}-redir.service %service_del_preun %{name}-tunnel.service +%service_del_preun %{name}-server@.service +%service_del_preun %{name}-client@.service +%service_del_preun %{name}-nat@.service +%service_del_preun %{name}-redir@.service +%service_del_preun %{name}-tunnel@.service %postun %service_del_postun %{name}-server.service @@ -157,6 +187,11 @@ ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-tunnel %service_del_postun %{name}-nat.service %service_del_postun %{name}-redir.service %service_del_postun %{name}-tunnel.service +%service_del_postun %{name}-server@.service +%service_del_postun %{name}-client@.service +%service_del_postun %{name}-nat@.service +%service_del_postun %{name}-redir@.service +%service_del_postun %{name}-tunnel@.service %post -n lib%{name}2 -p /sbin/ldconfig