display version

This commit is contained in:
破娃酱 2016-10-11 15:41:02 +08:00
parent c48190fe7a
commit 45e27f9142
5 changed files with 30 additions and 4 deletions

View file

@ -1,3 +1,6 @@
2.9.4 2016-10-11
- sync client version
2.6.13 2015-11-02
- add protocol setting

View file

@ -197,6 +197,7 @@ class TransferBase(object):
last_rows = []
db_instance = obj()
ServerPool.get_instance()
shell.log_shadowsocks_version()
import resource
logging.info('current process RLIMIT_NOFILE resource: soft %d hard %d' % resource.getrlimit(resource.RLIMIT_NOFILE))
try:

View file

@ -37,6 +37,8 @@ def main():
config = shell.get_config(False)
shell.log_shadowsocks_version()
daemon.daemon_exec(config)
if config['port_password']:

View file

@ -54,13 +54,30 @@ def print_exception(e):
def print_shadowsocks():
version = ''
version_str = ''
try:
import pkg_resources
version = pkg_resources.get_distribution('shadowsocks').version
version_str = pkg_resources.get_distribution('shadowsocks').version
except Exception:
pass
print('Shadowsocks %s' % version)
try:
from shadowsocks import version
version_str = version.version()
except Exception:
pass
print('ShadowsocksR %s' % version_str)
def log_shadowsocks_version():
version_str = ''
try:
import pkg_resources
version_str = pkg_resources.get_distribution('shadowsocks').version
except Exception:
try:
from shadowsocks import version
version_str = version.version()
except Exception:
pass
logging.info('ShadowsocksR %s' % version_str)
def find_config():
config_path = 'user-config.json'

3
version.py Normal file
View file

@ -0,0 +1,3 @@
def version()
return '2.9.4 update 2016-10-11'