diff --git a/aiida/cmdline/commands/cmd_daemon.py b/aiida/cmdline/commands/cmd_daemon.py index 72cec1fe0f..9f1c0723b0 100644 --- a/aiida/cmdline/commands/cmd_daemon.py +++ b/aiida/cmdline/commands/cmd_daemon.py @@ -91,6 +91,7 @@ def status(all_profiles): for profile in profiles: client = get_daemon_client(profile.name) + delete_stale_pid_file(client) click.secho('Profile: ', fg='red', bold=True, nl=False) click.secho('{}'.format(profile.name), bold=True) result = get_daemon_status(client) diff --git a/aiida/cmdline/commands/cmd_status.py b/aiida/cmdline/commands/cmd_status.py index 2137e425de..bd9c6f53f6 100644 --- a/aiida/cmdline/commands/cmd_status.py +++ b/aiida/cmdline/commands/cmd_status.py @@ -48,7 +48,7 @@ class ServiceStatus(IntEnum): def verdi_status(): """Print status of AiiDA services.""" # pylint: disable=broad-except,too-many-statements - from aiida.cmdline.utils.daemon import get_daemon_status + from aiida.cmdline.utils.daemon import get_daemon_status, delete_stale_pid_file from aiida.common.utils import Capturing, get_repository_folder from aiida.manage.external.rmq import get_rmq_url from aiida.manage.manager import get_manager @@ -101,6 +101,7 @@ def verdi_status(): # getting the daemon status try: client = manager.get_daemon_client() + delete_stale_pid_file(client) daemon_status = get_daemon_status(client) daemon_status = daemon_status.split('\n')[0] # take only the first line