Skip to content
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

加到systemd ExecStartPre 后无法运行 #18

Open
outsinre opened this issue Nov 14, 2017 · 1 comment
Open

加到systemd ExecStartPre 后无法运行 #18

outsinre opened this issue Nov 14, 2017 · 1 comment

Comments

@outsinre
Copy link

[Unit]
Description=Shadowsocks-libev Default Server Service
Documentation=man:shadowsocks-libev(8)
After=network.target

[Service]
Type=simple
EnvironmentFile=/etc/sysconfig/shadowsocks-libev
User=nobody
Group=nobody
LimitNOFILE=32768
ExecStart=/usr/bin/ss-server -c $CONFFILE $DAEMON_ARGS

[Install]
WantedBy=multi-user.target


# /etc/systemd/system/shadowsocks-libev.service.d/override.conf
[Service]
ExecStartPre=/usr/bin/python3.4 /opt/ptproxy/ptproxy.py -s /opt/ptproxy/server.json >/dev/null &

这里我吧ptproxy加到ss-libev的unit file ExecStartPre处,可是运行不了,journalctl 里面全是:

Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 PT died.
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 Starting PT...
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 PT died.
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 Starting PT...
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 PT died.
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 Starting PT...
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 PT died.
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 Starting PT...
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 PT died.
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 Starting PT...
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 PT died.
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 Starting PT...
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 PT died.
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 Starting PT...
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 PT died.
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 Starting PT...
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 PT died.
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 Starting PT...
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 PT died.
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 Starting PT...
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 PT died.
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 Starting PT...
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 PT died.
Nov 14 04:57:32 localhost python3.4[15994]: 2017-11-14 04:57:32 Starting PT...

同样的命令在terminal直接运行没有问题:

~ # /usr/bin/python3.4 /opt/ptproxy/ptproxy.py -s /opt/ptproxy/server.json >/dev/null &
~ # su nobody -s /bin/bash -c "/usr/bin/python3.4 /opt/ptproxy/ptproxy.py -s /opt/ptproxy/server.json >/dev/null &"

pt_state 所有者 nobody:nobody

@gumblex
Copy link
Owner

gumblex commented Nov 16, 2017

怀疑是权限问题。去掉 >/dev/null 看日志?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants