Quellcode durchsuchen

seafile-server: fix fastcgi mode settings in seafile-admin script

* Use the correct path for the pidfile
* Start a multithreaded daemon instead of pre-forking worker processes.
  This avoids consuming too much memory and makes context switches faster

Signed-off-by: Gergely Kiss <mail.gery@gmail.com>
Gergely Kiss vor 10 Jahren
Ursprung
Commit
e06d1cae3b
1 geänderte Dateien mit 22 neuen und 7 gelöschten Zeilen
  1. 22
    7
      net/seafile-server/patches/040-seafile-admin.patch

+ 22
- 7
net/seafile-server/patches/040-seafile-admin.patch Datei anzeigen

@@ -1,7 +1,7 @@
1 1
 diff -rupN seafile-3.1.7-server.orig/tools/seafile-admin seafile-3.1.7-server/tools/seafile-admin
2 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-12 12:09:00.703175935 +0100
4
-@@ -416,13 +416,15 @@ def create_gunicorn_conf():
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 5
      content = '''\
6 6
  import os
7 7
  daemon = True
@@ -15,12 +15,10 @@ diff -rupN seafile-3.1.7-server.orig/tools/seafile-admin seafile-3.1.7-server/to
15 15
 +pidfile = '/var/run/seafile/seahub.pid'
16 16
  errorlog = os.path.join(runtime_dir, 'error.log')
17 17
 -accesslog = os.path.join(runtime_dir, 'access.log')
18
-+# uncomment if you need access logging (works only in fastcgi mode)
19
-+#accesslog = os.path.join(runtime_dir, 'access.log')
20 18
  '''
21 19
      try:
22 20
          with open(confpath, 'w') as fp:
23
-@@ -607,6 +609,7 @@ def start_seahub_gunicorn():
21
+@@ -607,6 +607,7 @@ def start_seahub_gunicorn():
24 22
          'gunicorn_django',
25 23
          '-c', conf[CONF_SEAHUB_CONF],
26 24
          '-b', '0.0.0.0:%s' % conf[CONF_SEAHUB_PORT],
@@ -28,7 +26,24 @@ diff -rupN seafile-3.1.7-server.orig/tools/seafile-admin seafile-3.1.7-server/to
28 26
      ]
29 27
  
30 28
      info('Starting seahub...')
31
-@@ -738,10 +741,9 @@ def setup_seafile(args):
29
+@@ -625,6 +626,7 @@ def start_seahub_fastcgi():
30
+         'pidfile=%(pidfile)s',
31
+         'outlog=%(outlog)s',
32
+         'errlog=%(errlog)s',
33
++        'method=threaded',
34
+     ]
35
+ 
36
+     cmdline = ' '.join(argv) % \
37
+@@ -693,7 +695,7 @@ def check_layout(args):
38
+     conf[CONF_SEAFILE_DIR]      = seafile_data_dir
39
+     conf[CONF_SEAHUB_DIR]       = seahub_dir
40
+     conf[CONF_SEAHUB_CONF]      = seahub_conf
41
+-    conf[CONF_SEAHUB_PIDFILE]   = os.path.join(runtime_dir, 'seahub.pid')
42
++    conf[CONF_SEAHUB_PIDFILE]   = '/var/run/seafile/seahub.pid'
43
+     conf[CONF_SEAHUB_OUTLOG]    = os.path.join(runtime_dir, 'access.log')
44
+     conf[CONF_SEAHUB_ERRLOG]    = os.path.join(runtime_dir, 'error.log')
45
+ 
46
+@@ -738,10 +740,9 @@ def setup_seafile(args):
32 47
      print '-----------------------------------------------------------------'
33 48
      print '-----------------------------------------------------------------'
34 49
      print
@@ -41,7 +56,7 @@ diff -rupN seafile-3.1.7-server.orig/tools/seafile-admin seafile-3.1.7-server/to
41 56
      print
42 57
      print 'If you have any problem, refer to\n'
43 58
      print
44
-@@ -802,8 +804,7 @@ def start_seafile(args):
59
+@@ -802,8 +803,7 @@ def start_seafile(args):
45 60
  def stop_seafile(dummy):
46 61
      info('Stopping seafile server')
47 62
      pkill('seafile-controller')