diff --git a/CHANGES b/CHANGES index a58348a..5ead42c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2.9.4 2016-10-11 +- sync client version + 2.6.13 2015-11-02 - add protocol setting diff --git a/db_transfer.py b/db_transfer.py index de0a481..46fbdc6 100644 --- a/db_transfer.py +++ b/db_transfer.py @@ -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: diff --git a/shadowsocks/server.py b/shadowsocks/server.py index f8deeeb..7c60af9 100755 --- a/shadowsocks/server.py +++ b/shadowsocks/server.py @@ -37,6 +37,8 @@ def main(): config = shell.get_config(False) + shell.log_shadowsocks_version() + daemon.daemon_exec(config) if config['port_password']: diff --git a/shadowsocks/shell.py b/shadowsocks/shell.py index 44bdb63..5973513 100644 --- a/shadowsocks/shell.py +++ b/shadowsocks/shell.py @@ -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' diff --git a/version.py b/version.py new file mode 100644 index 0000000..244b712 --- /dev/null +++ b/version.py @@ -0,0 +1,3 @@ +def version() + return '2.9.4 update 2016-10-11' +