python - Why can't record log with option --log-file in ssserver? -


pip install  shadowsocks 

and set configuration in /etc/shadowsocks.json .

sudo ssserver -h |grep log   --log-file log_file    log file daemon mode 

i want record log shadowsocks server in /home/user/ss.log.
let's create ssserver daemon.

format1:

sudo vim   /etc/systemd/system/ss.service [unit] description=shadowsocks after=network.target  [service] user=root execstart=/usr/bin/python   /usr/local/bin/ssserver  -c /etc/shadowsocks.json --log-file  /home/user/ss.log  [install] wantedby=multi-user.target  sudo  systemctl daemon-reload sudo systemctl restart  ss  

no record in /home/user/ss.log after many web page opened via shadowsocks.
bug argument --log-file in ssserver or not?
no use write :

execstart=/usr/bin/python   /usr/local/bin/ssserver --log-file  /home/user/ss.log  -c /etc/shadowsocks.json   

format2:

sudo vim   /etc/systemd/system/ss.service [unit] description=shadowsocks after=network.target  [service] user=root standardoutput=journal standarderror=journal execstart=/usr/bin/python /usr/local/bin/ssserver -c /etc/shadowsocks.json    [install] wantedby=multi-user.target 

to check log command sudo journalctl -u ss.

format3:

sudo vim   /etc/systemd/system/ss.service [unit] description=shadowsocks after=network.target  [service] user=root execstart=/bin/bash -c "/usr/bin/python /usr/local/bin/ssserver -c /etc/shadowsocks.json >/home/user/ss.log  2>&1"   [install] wantedby=multi-user.target 

it verified format2 , format3 can work properly,my puzzles is:
why format1 can't work?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -