You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.6 KiB

  1. diff -rupN seafile-3.1.7-server.orig/tools/seafile-admin seafile-3.1.7-server/tools/seafile-admin
  2. --- seafile-3.1.7-server.orig/tools/seafile-admin 2014-10-16 05:30:04.000000000 +0200
  3. +++ seafile-3.1.7-server/tools/seafile-admin 2014-12-22 21:52:25.929781054 +0100
  4. @@ -416,13 +416,13 @@ def create_gunicorn_conf():
  5. content = '''\
  6. import os
  7. daemon = True
  8. -workers = 3
  9. +workers = 1
  10. +threads = 3
  11. # Logging
  12. runtime_dir = os.path.dirname(__file__)
  13. -pidfile = os.path.join(runtime_dir, 'seahub.pid')
  14. +pidfile = '/var/run/seafile/seahub.pid'
  15. errorlog = os.path.join(runtime_dir, 'error.log')
  16. -accesslog = os.path.join(runtime_dir, 'access.log')
  17. '''
  18. try:
  19. with open(confpath, 'w') as fp:
  20. @@ -607,6 +607,7 @@ def start_seahub_gunicorn():
  21. 'gunicorn_django',
  22. '-c', conf[CONF_SEAHUB_CONF],
  23. '-b', '0.0.0.0:%s' % conf[CONF_SEAHUB_PORT],
  24. + '-t', '120',
  25. ]
  26. info('Starting seahub...')
  27. @@ -625,6 +626,7 @@ def start_seahub_fastcgi():
  28. 'pidfile=%(pidfile)s',
  29. 'outlog=%(outlog)s',
  30. 'errlog=%(errlog)s',
  31. + 'method=threaded',
  32. ]
  33. cmdline = ' '.join(argv) % \
  34. @@ -693,7 +695,7 @@ def check_layout(args):
  35. conf[CONF_SEAFILE_DIR] = seafile_data_dir
  36. conf[CONF_SEAHUB_DIR] = seahub_dir
  37. conf[CONF_SEAHUB_CONF] = seahub_conf
  38. - conf[CONF_SEAHUB_PIDFILE] = os.path.join(runtime_dir, 'seahub.pid')
  39. + conf[CONF_SEAHUB_PIDFILE] = '/var/run/seafile/seahub.pid'
  40. conf[CONF_SEAHUB_OUTLOG] = os.path.join(runtime_dir, 'access.log')
  41. conf[CONF_SEAHUB_ERRLOG] = os.path.join(runtime_dir, 'error.log')
  42. @@ -738,10 +740,9 @@ def setup_seafile(args):
  43. print '-----------------------------------------------------------------'
  44. print '-----------------------------------------------------------------'
  45. print
  46. - print 'To start/stop seafile server:'
  47. + print 'To start, stop or restart seafile server, please run as root:'
  48. print
  49. - print highlight(' $ cd %s' % cwd)
  50. - print highlight(' $ %s { start | stop }' % SCRIPT_NAME)
  51. + print highlight(' # /etc/init.d/seafile { start | stop | restart }')
  52. print
  53. print 'If you have any problem, refer to\n'
  54. print
  55. @@ -802,8 +803,7 @@ def start_seafile(args):
  56. def stop_seafile(dummy):
  57. info('Stopping seafile server')
  58. pkill('seafile-controller')
  59. - runtime_dir = os.path.join(cwd, 'seafile-server', 'runtime')
  60. - pidfile = os.path.join(runtime_dir, 'seahub.pid')
  61. + pidfile = '/var/run/seafile/seahub.pid'
  62. try:
  63. with open(pidfile, 'r') as fp:
  64. pid = fp.read().strip('\n ')