File project.diff of Package shadowsocks-rust
--- shadowsocks-rust-client.service.orig
+++ shadowsocks-rust-client.service
@@ -17,12 +17,13 @@ ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
-Type=forking
+Type=simple
PIDFile=/var/run/shadowsocks-rust-client.pid
ExecStart=/usr/bin/sslocal --log-without-time -c /etc/shadowsocks/shadowsocks-rust.json --tcp-fast-open
Restart=on-failure
User=shadowsocks
Group=shadowsocks
+LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
--- shadowsocks-rust-manager.service.orig
+++ shadowsocks-rust-manager.service
@@ -17,12 +17,13 @@ ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
-Type=forking
+Type=simple
PIDFile=/var/run/shadowsocks-rust-manager.pid
ExecStart=/usr/bin/ssmanager --log-without-time -c /etc/shadowsocks/shadowsocks-rust.json --tcp-fast-open
Restart=on-failure
User=shadowsocks
Group=shadowsocks
+LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
--- shadowsocks-rust-server.service.orig
+++ shadowsocks-rust-server.service
@@ -17,12 +17,13 @@ ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
-Type=forking
+Type=simple
PIDFile=/var/run/shadowsocks-rust-server.pid
ExecStart=/usr/bin/ssserver --log-without-time -c /etc/shadowsocks/shadowsocks-rust.json --tcp-fast-open
Restart=on-failure
User=shadowsocks
Group=shadowsocks
+LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
--- shadowsocks-rust.spec.orig
+++ shadowsocks-rust.spec
@@ -29,6 +29,7 @@ Source2: %{name}.json
Source3: %{name}-client.service
Source4: %{name}-server.service
Source5: %{name}-manager.service
+Source6: %{name}-server@.service
BuildRequires: cargo
BuildRequires: cargo-packaging
BuildRequires: systemd-rpm-macros
@@ -67,6 +68,7 @@ install -d %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}
+install -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}
install -d %{buildroot}%{_sbindir}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-client
@@ -88,6 +90,7 @@ getent passwd shadowsocks >/dev/null ||
%service_add_post %{name}-manager.service
chown root:shadowsocks %{_sysconfdir}/shadowsocks -R
chmod 640 %{_sysconfdir}/shadowsocks -R
+chmod 750 %{_sysconfdir}/shadowsocks
%preun
%service_del_preun %{name}-client.service