Skip to content

Commit

Permalink
remove unused daemon pid
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Oct 10, 2024
1 parent ccdc45f commit e3dea59
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 35 deletions.
1 change: 0 additions & 1 deletion mycodo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
# Run files
RUN_PATH = '/var/run'
FRONTEND_PID_FILE = os.path.join(RUN_PATH, 'mycodoflask.pid')
DAEMON_PID_FILE = os.path.join(RUN_PATH, 'mycodo.pid')

# Remote admin
STORED_SSL_CERTIFICATE_PATH = os.path.join(
Expand Down
12 changes: 1 addition & 11 deletions mycodo/mycodo_flask/routes_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from sqlalchemy import and_

from mycodo.config import (ALEMBIC_VERSION, BACKUP_LOG_FILE, CAMERA_INFO,
DAEMON_LOG_FILE, DAEMON_PID_FILE,
DAEMON_LOG_FILE,
DEPENDENCY_LOG_FILE, DOCKER_CONTAINER,
FRONTEND_PID_FILE, HTTP_ACCESS_LOG_FILE,
HTTP_ERROR_LOG_FILE, IMPORT_LOG_FILE,
Expand Down Expand Up @@ -606,8 +606,6 @@ def page_info():

virtualenv_flask = False
virtualenv_daemon = False
daemon_pid = None
pstree_daemon_output = None
top_daemon_output = None
frontend_pid = None
pstree_frontend_output = None
Expand Down Expand Up @@ -695,10 +693,6 @@ def page_info():
if hasattr(sys, 'real_prefix') or sys.base_prefix != sys.prefix:
virtualenv_flask = True

if os.path.exists(DAEMON_PID_FILE):
with open(DAEMON_PID_FILE, 'r') as pid_file:
daemon_pid = int(pid_file.read())

if not current_app.config['TESTING']:
daemon_up = daemon_active()
else:
Expand All @@ -708,8 +702,6 @@ def page_info():
control = DaemonControl()
ram_use_daemon = control.ram_use()
virtualenv_daemon = control.is_in_virtualenv()

pstree_daemon_output, top_daemon_output = output_pstree_top(daemon_pid)
else:
ram_use_daemon = 0

Expand All @@ -726,7 +718,6 @@ def page_info():
python_version = sys.version

return render_template('pages/info.html',
daemon_pid=daemon_pid,
daemon_up=daemon_up,
gpio_readall=gpio_output,
database_version=database_version,
Expand All @@ -738,7 +729,6 @@ def page_info():
frontend_pid=frontend_pid,
i2c_devices_sorted=i2c_devices_sorted,
ifconfig=ifconfig_output,
pstree_daemon=pstree_daemon_output,
pstree_frontend=pstree_frontend_output,
python_version=python_version,
ram_use_daemon=ram_use_daemon,
Expand Down
23 changes: 0 additions & 23 deletions mycodo/mycodo_flask/templates/pages/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
{%- else %}<span style="color: #F70D1A; font-weight: bold;">{{_('Not Running')}}</span> <a href="https://kizniche.github.io/Mycodo/Troubleshooting/#daemon-not-running"><span style="font-size: 16px" class="fas fa-question-circle"></span></a>
{% endif %}
{% if daemon_up %}
<br>{{_('Daemon Process ID')}}: <span style="color: #4E9258; font-weight: bold;">{{daemon_pid}}</span>
<br>{{_('Daemon RAM Usage')}}: <span style="color: #4E9258; font-weight: bold;">{{ram_use_daemon}} MB</span>
<br>{{_('Daemon Virtualenv')}}:&nbsp
{%- if virtualenv_daemon -%}<span style="color: #4E9258; font-weight: bold;">{{_('Yes')}}</span>
Expand Down Expand Up @@ -129,28 +128,6 @@
</div>
</div>

{% if daemon_up %}

<div style="padding-bottom: 1.5em">
<div style="padding-bottom: 0.5em">
Processes (daemon and threads): pstree -p {{daemon_pid}}
</div>
<div>
<pre style="padding: 0.5em; border: 1px solid Black;">{{pstree_daemon}}</pre>
</div>
</div>

<div style="padding-bottom: 1.5em">
<div style="padding-bottom: 0.5em">
Processes (daemon and threads): top -b -H -n 1 -p {{daemon_pid}}
</div>
<div>
<pre style="padding: 0.5em; border: 1px solid Black;">{{top_daemon}}</pre>
</div>
</div>

{% endif %}

<div style="padding-bottom: 1.5em">
<div style="padding-bottom: 0.5em">
Processes (frontend and threads): pstree -p {{frontend_pid}}
Expand Down

0 comments on commit e3dea59

Please sign in to comment.