New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置--log-file 报错 #1242

Closed
oushiun opened this Issue May 10, 2018 · 8 comments

Comments

Projects
None yet
3 participants
@oushiun
Copy link

oushiun commented May 10, 2018

# shadowsocks.service

[Unit]
Description=Shadowsocks

[Service]
TimeoutStartSec=0
ExecStart=/usr/bin/ssserver -c /etc/shadowsocks.json --log-file /var/log/shadowsocks.log -d start

[Install]
WantedBy=multi-user.target

错误信息

● shadowsocks.service - Shadowsocks
   Loaded: loaded (/etc/systemd/system/shadowsocks.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since 四 2018-05-10 06:01:48 EDT; 4s ago
  Process: 3594 ExecStart=/usr/bin/ssserver -c /etc/shadowsocks.json --log-file /var/log/shadowsocks.log -d start (code=exited, status=0/SUCCESS)
 Main PID: 3594 (code=exited, status=0/SUCCESS)
@oushiun

This comment has been minimized.

Copy link
Author

oushiun commented May 10, 2018

@Jiang-Xuan

This comment has been minimized.

Copy link

Jiang-Xuan commented May 10, 2018

journalctl -u shadowsocks.service 看一下日志

@oushiun

This comment has been minimized.

Copy link
Author

oushiun commented May 11, 2018

# systemctrl start shadowsocks
-- Logs begin at 日 2018-05-06 15:48:12 EDT, end at 四 2018-05-10 21:41:48 EDT. --
5月 10 21:41:48 soraaoi ssserver[26705]: 2018-05-10 21:41:48 INFO     loading libcrypto from libcrypto.so.10
5月 10 21:41:48 soraaoi ssserver[26705]: INFO: loading config from /etc/shadowsocks.json
5月 10 21:41:48 soraaoi systemd[1]: Starting Shadowsocks...
5月 10 21:41:48 soraaoi systemd[1]: Started Shadowsocks.
@oushiun

This comment has been minimized.

Copy link
Author

oushiun commented May 11, 2018

补充一下
直接执行 /usr/bin/ssserver -c /etc/shadowsocks.json --log-file /var/log/shadowsocks.log -d start 可以正常运行

@Dasherss

This comment has been minimized.

Copy link

Dasherss commented May 11, 2018

看不懂

@Jiang-Xuan

This comment has been minimized.

Copy link

Jiang-Xuan commented May 11, 2018

@oushiun 没看出来错误信息, systemctl start shadowsocks 之后看一下端口是否在监听

@oushiun

This comment has been minimized.

Copy link
Author

oushiun commented May 11, 2018

@Jiang-Xuan 端口没有监听 shadowsocks 本身没有跑起来
我在思考是不是我shadowsocks.service 编写的有问题

@oushiun

This comment has been minimized.

Copy link
Author

oushiun commented May 11, 2018

systemd 换了个写法 ,可以了

[Unit]
Description=Shadowsocks

[Service]
Type=forking
PIDFile=/run/shadowsocks/server.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/shadowsocks
ExecStart=/usr/bin/ssserver --pid-file /var/run/shadowsocks/server.pid --log-file /var/log/shadowsocks.log -c /etc/shadowsocks.json -d start
Restart=on-abort

[Install]
WantedBy=multi-user.target

@oushiun oushiun closed this May 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment