mirror of
https://github.com/haiwen/seafile.git
synced 2025-01-08 11:57:44 +08:00
check daemon is running (#2734)
Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
parent
9ec8f933c8
commit
b3c3566b41
10
app/seaf-cli
10
app/seaf-cli
@ -128,6 +128,14 @@ def _check_seafile():
|
||||
print("%s not found in PATH. Have you installed seafile?" % prog)
|
||||
sys.exit(1)
|
||||
|
||||
def _check_daemon_running():
|
||||
try:
|
||||
subprocess.check_output(['ps', '-C', 'seaf-daemon'])
|
||||
print("seaf-daemon is already running")
|
||||
sys.exit(1)
|
||||
except subprocess.CalledProcessError:
|
||||
return
|
||||
|
||||
def get_rpc_client(confdir):
|
||||
return seafile.RpcClient(join(seafile_datadir, 'seafile.sock'))
|
||||
|
||||
@ -351,6 +359,8 @@ def seaf_start_seafile(args):
|
||||
|
||||
conf_dir = _conf_dir(args)
|
||||
|
||||
_check_daemon_running()
|
||||
|
||||
print("Starting seafile daemon ...")
|
||||
|
||||
cmd = [ "seaf-daemon", "--daemon", "-c", conf_dir, "-d", seafile_datadir,
|
||||
|
Loading…
Reference in New Issue
Block a user