Skip to content

Commit

Permalink
configd_ctl.py: catch broken pipe on event handler (#5235)
Browse files Browse the repository at this point in the history
  • Loading branch information
kulikov-a authored Sep 24, 2021
1 parent eb85fec commit b9de69f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/opnsense/service/configd_ctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ def exec_config_cmd(exec_command):
rlist, _, _ = select([sys.stdin], [], [], args.t)
if rlist:
last_message_stamp = time.time()
stashed_lines.append(sys.stdin.readline())
r_line = sys.stdin.readline()
if len(r_line) == 0:
#EOFError. pipe broken?
sys.exit(-1)
stashed_lines.append(r_line)

if len(stashed_lines) >= 1 and (args.t is None or time.time() - last_message_stamp > args.t):
# emit event trigger(s) to syslog
Expand Down

0 comments on commit b9de69f

Please sign in to comment.