040-seafile-admin.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. diff -rupN seafile-server-5.1.1.orig/tools/seafile-admin seafile-server-5.1.1/tools/seafile-admin
  2. --- seafile-server-5.1.1.orig/tools/seafile-admin 2016-04-19 15:44:33.000000000 +0200
  3. +++ seafile-server-5.1.1/tools/seafile-admin 2016-04-26 10:55:11.826798430 +0200
  4. @@ -449,9 +449,12 @@ workers = 3
  5. # Logging
  6. runtime_dir = os.path.dirname(__file__)
  7. -pidfile = os.path.join(runtime_dir, 'seahub.pid')
  8. +pidfile = '/var/run/seafile/seahub.pid'
  9. errorlog = os.path.join(runtime_dir, 'error.log')
  10. accesslog = os.path.join(runtime_dir, 'access.log')
  11. +
  12. +# for file upload, we need a longer timeout value (default is only 30s, too short)
  13. +timeout = 1200
  14. '''
  15. try:
  16. @@ -526,6 +529,7 @@ def check_django_version():
  17. def check_python_module(import_name, package_name=None, silent=False):
  18. + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "seahub.settings")
  19. package_name = package_name or import_name
  20. if not silent:
  21. info('checking %s' % package_name)
  22. @@ -785,7 +789,7 @@ def check_layout(args):
  23. conf[CONF_SEAFILE_DIR] = seafile_data_dir
  24. conf[CONF_SEAHUB_DIR] = seahub_dir
  25. conf[CONF_SEAHUB_CONF] = seahub_conf
  26. - conf[CONF_SEAHUB_PIDFILE] = os.path.join(runtime_dir, 'seahub.pid')
  27. + conf[CONF_SEAHUB_PIDFILE] = '/var/run/seafile/seahub.pid'
  28. conf[CONF_SEAHUB_OUTLOG] = os.path.join(runtime_dir, 'access.log')
  29. conf[CONF_SEAHUB_ERRLOG] = os.path.join(runtime_dir, 'error.log')
  30. @@ -836,10 +840,13 @@ def setup_seafile(args):
  31. print '-----------------------------------------------------------------'
  32. print '-----------------------------------------------------------------'
  33. print
  34. - print 'To start/stop seafile server:'
  35. + print 'To start, stop or restart seafile:'
  36. + print
  37. + print highlight(' # /etc/init.d/seafile { start | stop | restart }')
  38. print
  39. - print highlight(' $ cd %s' % cwd)
  40. - print highlight(' $ %s { start | stop }' % SCRIPT_NAME)
  41. + print 'To start, stop or restart seahub:'
  42. + print
  43. + print highlight(' # /etc/init.d/seahub { start | stop | restart }')
  44. print
  45. print 'If you have any problem, refer to\n'
  46. print
  47. @@ -903,8 +910,7 @@ def start_seafile(args):
  48. def stop_seafile(dummy):
  49. info('Stopping seafile server')
  50. pkill('seafile-controller')
  51. - runtime_dir = os.path.join(cwd, 'seafile-server', 'runtime')
  52. - pidfile = os.path.join(runtime_dir, 'seahub.pid')
  53. + pidfile = '/var/run/seafile/seahub.pid'
  54. try:
  55. with open(pidfile, 'r') as fp:
  56. pid = fp.read().strip('\n ')