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.

73 lines
3.4 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>
5 years ago
  1. --- a/scripts/seaf-gc.sh
  2. +++ b/scripts/seaf-gc.sh
  3. @@ -63,8 +63,8 @@ function validate_already_running () {
  4. exit 1;
  5. fi
  6. - check_component_running "ccnet-server" "ccnet-server -c ${default_ccnet_conf_dir}"
  7. - check_component_running "seaf-server" "seaf-server -c ${default_ccnet_conf_dir}"
  8. + check_component_running "ccnet-server" "ccnet-server -F ${default_conf_dir} -c ${default_ccnet_conf_dir}"
  9. + check_component_running "seaf-server" "seaf-server -F ${default_conf_dir} -c ${default_ccnet_conf_dir}"
  10. check_component_running "fileserver" "fileserver -c ${default_ccnet_conf_dir}"
  11. check_component_running "seafdav" "wsgidav.server.server_cli"
  12. }
  13. --- a/scripts/seafile.sh
  14. +++ b/scripts/seafile.sh
  15. @@ -107,8 +107,8 @@ function validate_already_running () {
  16. exit 1;
  17. fi
  18. - check_component_running "ccnet-server" "ccnet-server -c ${default_ccnet_conf_dir}"
  19. - check_component_running "seaf-server" "seaf-server -c ${default_ccnet_conf_dir}"
  20. + check_component_running "ccnet-server" "ccnet-server -F ${central_config_dir} -c ${default_ccnet_conf_dir}"
  21. + check_component_running "seaf-server" "seaf-server -F ${central_config_dir} -c ${default_ccnet_conf_dir}"
  22. check_component_running "fileserver" "fileserver -c ${default_ccnet_conf_dir}"
  23. check_component_running "seafdav" "wsgidav.server.server_cli"
  24. }
  25. @@ -149,8 +149,8 @@ function stop_seafile_server () {
  26. echo "Stopping seafile server ..."
  27. pkill -SIGTERM -f "seafile-controller -c ${default_ccnet_conf_dir}"
  28. - pkill -f "ccnet-server -c ${default_ccnet_conf_dir}"
  29. - pkill -f "seaf-server -c ${default_ccnet_conf_dir}"
  30. + pkill -f "ccnet-server -F ${central_config_dir} -c ${default_ccnet_conf_dir}"
  31. + pkill -f "seaf-server -F ${central_config_dir} -c ${default_ccnet_conf_dir}"
  32. pkill -f "fileserver -c ${default_ccnet_conf_dir}"
  33. pkill -f "soffice.*--invisible --nocrashreport"
  34. pkill -f "wsgidav.server.server_cli"
  35. --- a/scripts/seahub.sh
  36. +++ b/scripts/seahub.sh
  37. @@ -94,10 +94,10 @@ function validate_seafile_data_dir () {
  38. }
  39. function validate_seahub_running () {
  40. - if pgrep -f "${manage_py}" 2>/dev/null 1>&2; then
  41. + if pgrep -f "${manage_py} runfcgi" 2>/dev/null 1>&2; then
  42. echo "Seahub is already running."
  43. exit 1;
  44. - elif pgrep -f "seahub.wsgi:application" 2>/dev/null 1>&2; then
  45. + elif pgrep -f "$gunicorn_exe seahub.wsgi:application -c ${gunicorn_conf}" 2>/dev/null 1>&2; then
  46. echo "Seahub is already running."
  47. exit 1;
  48. fi
  49. @@ -165,7 +165,7 @@ function start_seahub () {
  50. # Ensure seahub is started successfully
  51. sleep 5
  52. - if ! pgrep -f "seahub.wsgi:application" 2>/dev/null 1>&2; then
  53. + if ! pgrep -f "$gunicorn_exe seahub.wsgi:application -c ${gunicorn_conf}" 2>/dev/null 1>&2; then
  54. printf "\033[33mError:Seahub failed to start.\033[m\n"
  55. echo "Please try to run \"./seahub.sh start\" again"
  56. exit 1;
  57. @@ -235,9 +235,9 @@ function clear_sessions () {
  58. function stop_seahub () {
  59. if [[ -f ${pidfile} ]]; then
  60. echo "Stopping seahub ..."
  61. - pkill -9 -f "/usr/bin/gunicorn3"
  62. + pkill -9 -f "$gunicorn_exe seahub.wsgi:application -c ${gunicorn_conf}"
  63. sleep 1
  64. - if pgrep -f "/usr/bin/gunicorn3" 2>/dev/null 1>&2 ; then
  65. + if pgrep -f "$gunicorn_exe seahub.wsgi:application -c ${gunicorn_conf}" 2>/dev/null 1>&2 ; then
  66. echo 'Failed to stop seahub.'
  67. exit 1
  68. fi