Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/upgrade/scripts check if server is running #1731

Closed
ftribrunn opened this issue Aug 3, 2016 · 1 comment
Closed

/upgrade/scripts check if server is running #1731

ftribrunn opened this issue Aug 3, 2016 · 1 comment

Comments

@ftribrunn
Copy link

ftribrunn commented Aug 3, 2016

I am running 4 seafile server on 1 physical maschine (3 CE + 1 PRO)
every seafileserver has its own user and folder

  • /srv/seafile-1/ running with user seafile-1
  • /srv/seafile-2/ running with user seafile-2
  • /srv/seafile-3/ running with user seafile-3
  • /srv/seafile-4/ running with user seafile-4

while upgrading all my seafile instances to 5.1.8 I had the problem, that the upgrade script told me, the server is still running. but it wasnt.

function ensure_server_not_running() {
# test whether seafile server has been stopped.
if pgrep seaf-server 2>/dev/null 1>&2 ; then
echo
echo "seafile server is still running !"
echo "stop it using scripts before upgrade."
echo
exit 1
elif pgrep -f "${manage_py} run_gunicorn" 2>/dev/null 1>&2
|| pgrep -f "seahub.wsgi:application" 2>/dev/null 1>&2; then
echo
echo "seahub server is still running !"
echo "stop it before upgrade."
echo
exit 1
elif pgrep -f "${manage_py} runfcgi" 2>/dev/null 1>&2 ; then
echo
echo "seahub server is still running !"
echo "stop it before upgrade."
echo
exit 1
fi
}

so I had to stop all seafile instances at once.

the script checks if seaf-server is running. there would might be a way to check it with "path-to-seafile-server"

maybe there is an easier way...

thx for ideas / fixing.
greetz
fabian

@moetiker
Copy link

moetiker commented Sep 9, 2016

"pgrep -u $USER seaf-server"

would do the trick.

@killing killing closed this as completed Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants