Project

General

Profile

Actions

Bug #10427

closed

LCDproc: Handle multiple lcdproc clients

Added by Viktor Gurov about 4 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Category:
LCDProc
Target version:
-
Start date:
04/04/2020
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Description

Return only one argument from pgrep to avoid breaking [ ]. Without that the client processes are not killed if there is more than one client resulting in an ever increasing number of clients. This happens all too often.

old PR: https://github.com/pfsense/FreeBSD-ports/pull/568

Actions #2

Updated by Jim Pingle about 4 years ago

  • Status changed from New to Pull Request Review
Actions #3

Updated by Renato Botelho about 4 years ago

  • Status changed from Pull Request Review to Feedback
  • Assignee set to Renato Botelho
  • % Done changed from 0 to 100

PR has been merged. Thanks!

Actions #4

Updated by Steve Wheeler about 4 years ago

  • Status changed from Feedback to Resolved

This works in as far as it avoids blowing up if there is more than one client. It now successfully kills all php clients so you don't end up with more every time the service restarts.

Restart the service and start a bunch of additional clients manually:

Apr 12 23:53:24     LCDd         LCDd version 0.5.9 starting
Apr 12 23:53:24     LCDd         Using Configuration File: /usr/local/etc/LCDd.conf
Apr 12 23:53:24     LCDd         Listening for queries on 127.0.0.1:13666
Apr 12 23:53:28     php         lcdproc: Start client procedure. Error counter: (0)
Apr 12 23:53:29     LCDd         Connect from host 127.0.0.1:27202 on socket 6
Apr 12 23:53:44     php         lcdproc: Start client procedure. Error counter: (0)
Apr 12 23:53:45     LCDd         Connect from host 127.0.0.1:32793 on socket 7
Apr 12 23:53:46     php         lcdproc: Start client procedure. Error counter: (0)
Apr 12 23:53:46     php         lcdproc: Start client procedure. Error counter: (0)
Apr 12 23:53:47     LCDd         Connect from host 127.0.0.1:28011 on socket 8
Apr 12 23:53:47     LCDd         Connect from host 127.0.0.1:44726 on socket 9 

[2.4.5-RELEASE][admin@s4.stevew.lan]/root: ps -auxw | grep lcd
root    85681   0.5  0.4 49928 34404  0  S    23:53      0:00.12 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php
root    86498   0.5  0.4 49928 34404  0  S    23:53      0:00.10 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php
root    88687   0.4  0.4 49928 34404  0  S    23:53      0:00.09 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php
root    76025   0.0  0.4 49928 34416  -  SN   23:53      0:00.15 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php
root    91864   0.0  0.0  6560  2444  0  S+   23:53      0:00.00 grep lcd

Restart the service:

Apr 12 23:55:35     LCDd         Client on socket 6 disconnected
Apr 12 23:55:35     LCDd         Client on socket 7 disconnected
Apr 12 23:55:35     LCDd         Client on socket 8 disconnected
Apr 12 23:55:35     LCDd         Client on socket 9 disconnected
Apr 12 23:55:36     LCDd         Server shutting down on SIGTERM
Apr 12 23:55:37     LCDd         LCDd version 0.5.9 starting
Apr 12 23:55:37     LCDd         Using Configuration File: /usr/local/etc/LCDd.conf
Apr 12 23:55:37     LCDd         Listening for queries on 127.0.0.1:13666
Apr 12 23:55:41     php         lcdproc: Start client procedure. Error counter: (0)
Apr 12 23:55:42     LCDd         Connect from host 127.0.0.1:35445 on socket 6 

Only one client is restarted:

[2.4.5-RELEASE][admin@s4.stevew.lan]/root: ps -auxw | grep lcd
root    45290   0.0  0.4 49928 34416  -  SN   23:55      0:00.09 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php
root    83790   0.0  0.0  6560  2444  0  S+   23:56      0:00.00 grep lcd

Other clients are unaffected. Manually started lcdproc clients will remain.

Actions

Also available in: Atom PDF