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.

104 lines
3.9 KiB

seafile-server: Update to 7.1.2, revamp package * Package scripts that are shipped by upstream in their binary download * Includes setup scripts (setup-seafile.sh to use SQLite, setup-seafile-mysql.{sh,py} to use MySQL) and control scripts (seafile.sh, seahub.sh) * Does not include seafile-admin, which is not shipped in upstream's binary download. Combined with the fact that it hasn't been updated to Python 3 suggests the script has been abandoned. * Replace previous init scripts with a simplified script * Previous init scripts (seafile.init, seahub.init) were modified from older versions of seafile.sh and seahub.sh, but they haven't kept up with changes to upstream's scripts * New init script (seafile-server.init) start/stops both Seafile and Seahub (there is no need to control them separately) by calling upstream's control scripts * Replace previous package config file with new config file * Options in previous config file (seafile.conf) were mainly for using Seahub in FastCGI mode. FastCGI was deprecated in Django 1.7 and removed in 1.9; upstream's control script will only start Seahub using Gunicorn. (Options for Gunicorn including port number can be changed by editing /etc/seafile/conf/gunicorn.conf.py.) * New config file (seafile-server.config) has one option that controls where the Seafile/Seahub data directories are stored * Patch scripts/binaries to use standard, system-wide directory locations * Script files (wrappers for binaries) in /usr/bin * Binaries (not meant to be run directly by the user) in /usr/libexec * Config files in /etc/seafile * Pid/socket files in /var/run/seafile * Logs in /var/log/seafile * Include a new script to create the first admin account * With upstream's original scripts, the user is required to interactively create the first admin account when Seahub is started for the first time * The user will now use the new script (create-seafile-admin.sh) to create the first admin account after setup (using setup-seafile.sh or setup-seafile-mysql.sh) and before starting Seafile/Seahub * seahub.sh is patched to only check if there is at least one admin account and exit with an error if there is no admin account * Remove build config options and add seafile-server-fuse package * The console option controls whether the console window is shown when Seafile server is run on Windows. It has no use on Linux. * The fuse option controls whether seaf-fuse is built. (seaf-fuse is a FUSE implementation that allows the Seafile database/file system to be mounted to a local directory.) seaf-fuse is now always built and is available in a separate package (seafile-server-fuse). * Add myself as a maintainer Signed-off-by: Jeffery To <jeffery.to@gmail.com>
4 years ago
  1. --- a/scripts/seaf-fsck.sh
  2. +++ b/scripts/seaf-fsck.sh
  3. @@ -8,9 +8,9 @@ TOPDIR=$(dirname "${INSTALLPATH}")
  4. default_ccnet_conf_dir=${TOPDIR}/ccnet
  5. default_seafile_data_dir=${TOPDIR}/seafile-data
  6. default_conf_dir=${TOPDIR}/conf
  7. -seaf_fsck=${INSTALLPATH}/seafile/bin/seaf-fsck
  8. +seaf_fsck=/usr/libexec/seaf-fsck
  9. -export PATH=${INSTALLPATH}/seafile/bin:$PATH
  10. +export PATH=/usr/libexec:$PATH
  11. export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
  12. script_name=$0
  13. --- a/scripts/seaf-fuse.sh
  14. +++ b/scripts/seaf-fuse.sh
  15. @@ -8,9 +8,9 @@ TOPDIR=$(dirname "${INSTALLPATH}")
  16. default_ccnet_conf_dir=${TOPDIR}/ccnet
  17. default_seafile_data_dir=${TOPDIR}/seafile-data
  18. default_conf_dir=${TOPDIR}/conf
  19. -seaf_fuse=${INSTALLPATH}/seafile/bin/seaf-fuse
  20. +seaf_fuse=/usr/libexec/seaf-fuse
  21. -export PATH=${INSTALLPATH}/seafile/bin:$PATH
  22. +export PATH=/usr/libexec:$PATH
  23. export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
  24. script_name=$0
  25. --- a/scripts/seaf-gc.sh
  26. +++ b/scripts/seaf-gc.sh
  27. @@ -8,10 +8,10 @@ TOPDIR=$(dirname "${INSTALLPATH}")
  28. default_ccnet_conf_dir=${TOPDIR}/ccnet
  29. default_seafile_data_dir=${TOPDIR}/seafile-data
  30. default_conf_dir=${TOPDIR}/conf
  31. -seaf_gc=${INSTALLPATH}/seafile/bin/seafserv-gc
  32. +seaf_gc=/usr/libexec/seafserv-gc
  33. seaf_gc_opts=""
  34. -export PATH=${INSTALLPATH}/seafile/bin:$PATH
  35. +export PATH=/usr/libexec:$PATH
  36. export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
  37. script_name=$0
  38. --- a/scripts/seafile.sh
  39. +++ b/scripts/seafile.sh
  40. @@ -18,9 +18,9 @@ TOPDIR=$(dirname "${INSTALLPATH}")
  41. default_ccnet_conf_dir=${TOPDIR}/ccnet
  42. default_seafile_data_dir=${TOPDIR}/seafile-data
  43. central_config_dir=${TOPDIR}/conf
  44. -seaf_controller="${INSTALLPATH}/seafile/bin/seafile-controller"
  45. +seaf_controller="/usr/libexec/seafile-controller"
  46. -export PATH=${INSTALLPATH}/seafile/bin:$PATH
  47. +export PATH=/usr/libexec:$PATH
  48. export ORIG_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
  49. export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
  50. --- a/scripts/seahub.sh
  51. +++ b/scripts/seahub.sh
  52. @@ -25,7 +25,7 @@ gunicorn_conf=${TOPDIR}/conf/gunicorn.co
  53. pidfile=${TOPDIR}/pids/seahub.pid
  54. errorlog=${TOPDIR}/logs/gunicorn_error.log
  55. accesslog=${TOPDIR}/logs/gunicorn_access.log
  56. -gunicorn_exe=${INSTALLPATH}/seahub/thirdpart/bin/gunicorn
  57. +gunicorn_exe=/usr/bin/gunicorn3
  58. script_name=$0
  59. function usage () {
  60. @@ -233,9 +233,9 @@ function clear_sessions () {
  61. function stop_seahub () {
  62. if [[ -f ${pidfile} ]]; then
  63. echo "Stopping seahub ..."
  64. - pkill -9 -f "thirdpart/bin/gunicorn"
  65. + pkill -9 -f "/usr/bin/gunicorn3"
  66. sleep 1
  67. - if pgrep -f "thirdpart/bin/gunicorn" 2>/dev/null 1>&2 ; then
  68. + if pgrep -f "/usr/bin/gunicorn3" 2>/dev/null 1>&2 ; then
  69. echo 'Failed to stop seahub.'
  70. exit 1
  71. fi
  72. --- a/scripts/setup-seafile-mysql.py
  73. +++ b/scripts/setup-seafile-mysql.py
  74. @@ -299,7 +299,7 @@ class EnvManager(object):
  75. def __init__(self):
  76. self.install_path = os.path.dirname(os.path.abspath(__file__))
  77. self.top_dir = os.path.dirname(self.install_path)
  78. - self.bin_dir = os.path.join(self.install_path, 'seafile', 'bin')
  79. + self.bin_dir = '/usr/libexec'
  80. self.central_config_dir = os.path.join(self.top_dir, 'conf')
  81. self.central_pids_dir = os.path.join(self.top_dir, 'pids')
  82. self.central_logs_dir = os.path.join(self.top_dir, 'logs')
  83. --- a/scripts/setup-seafile.sh
  84. +++ b/scripts/setup-seafile.sh
  85. @@ -455,8 +455,8 @@ if [[ "${need_pause}" == "1" ]]; then
  86. read dummy
  87. fi
  88. -ccnet_init=${INSTALLPATH}/seafile/bin/ccnet-init
  89. -seaf_server_init=${INSTALLPATH}/seafile/bin/seaf-server-init
  90. +ccnet_init=/usr/libexec/ccnet-init
  91. +seaf_server_init=/usr/libexec/seaf-server-init
  92. # -------------------------------------------
  93. # Create ccnet conf