没办法用systemctl启动ss-rust

打算参考ss-rust 的issue#103用systemctl启动ss-rust,但是不成功,出现了下面的错误信息。

如果单独运行ssserver -c sssconfig.json是可以运行的,把ssserver.service里面的参数改成user=root group=root都可以成功运行。

把两个文件ssserver和sssconfig都chow root.root或者nobody.nogroup,但都没用

系统是ubuntu18.04,rust版本是1.11.0

root@localhost:~# systemctl status ssserver.service

  • ssserver.service - ssserver service
    Loaded: loaded (/lib/systemd/system/ssserver.service; enabled; vendor preset: enabled)
    Active: failed (Result: signal) since Thu 2021-07-01 19:18:40 EDT; 14min ago
    Process: 8163 ExecStart=/usr/local/bin/ssserver -c /etc/sssconfig.json (code=killed, signal=ABRT)
    Main PID: 8163 (code=killed, signal=ABRT)

Jul 01 19:18:40 localhost ssserver[8163]: 2021-07-01T19:18:40.887366839-04:00 INFO shadowsocks udp server listening on 123.123.123.123:51094
Jul 01 19:18:40 localhost ssserver[8163]: 2021-07-01T19:18:40.887737219-04:00 INFO shadowsocks tcp server listening on 123.123.123.123:59301, inboundJul 01 19:18:40 localhost ssserver[8163]: 2021-07-01T19:18:40.890776667-04:00 INFO shadowsocks udp server listening on 123.123.123.123:59301
Jul 01 19:18:40 localhost ssserver[8163]: 2021-07-01T19:18:40.891540389-04:00 INFO shadowsocks tcp server listening on 123.123.123.123:39465, inboundJul 01 19:18:40 localhost ssserver[8163]: 2021-07-01T19:18:40.892141443-04:00 INFO shadowsocks udp server listening on 123.123.123.123:39465
Jul 01 19:18:40 localhost ssserver[8163]: 2021-07-01T19:18:40.892717391-04:00 ERROR servers exited with error: Permission denied (os error 13)
Jul 01 19:18:40 localhost ssserver[8163]: thread ‘main’ panicked at ‘aborted with server exited unexpectly’, bin/ssserver.rs:315:45
Jul 01 19:18:40 localhost ssserver[8163]: note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Jul 01 19:18:40 localhost systemd[1]: ssserver.service: Main process exited, code=killed, status=6/ABRT
Jul 01 19:18:40 localhost systemd[1]: ssserver.service: Failed with result ‘signal’.
~