Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
9fe4591d
Commit
9fe4591d
authored
Oct 07, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(configd) send (part of) stderr to syslog for script_output tasks
parent
6eb68e2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
processhandler.py
src/opnsense/service/modules/processhandler.py
+13
-7
No files found.
src/opnsense/service/modules/processhandler.py
View file @
9fe4591d
...
...
@@ -24,7 +24,6 @@
POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------------
package : configd
function: unix domain socket process worker process
"""
...
...
@@ -457,12 +456,19 @@ class Action(object):
return
'Execute error'
elif
self
.
type
.
lower
()
==
'script_output'
:
try
:
with
tempfile
.
NamedTemporaryFile
()
as
output_stream
:
subprocess
.
check_call
(
script_command
,
env
=
self
.
config_environment
,
shell
=
True
,
stdout
=
output_stream
,
stderr
=
subprocess
.
STDOUT
)
output_stream
.
seek
(
0
)
script_output
=
output_stream
.
read
()
return
script_output
with
tempfile
.
NamedTemporaryFile
()
as
error_stream
:
with
tempfile
.
NamedTemporaryFile
()
as
output_stream
:
subprocess
.
check_call
(
script_command
,
env
=
self
.
config_environment
,
shell
=
True
,
stdout
=
output_stream
,
stderr
=
error_stream
)
output_stream
.
seek
(
0
)
error_stream
.
seek
(
0
)
script_output
=
output_stream
.
read
()
script_error_output
=
error_stream
.
read
()
if
len
(
script_error_output
)
>
0
:
syslog
.
syslog
(
syslog
.
LOG_ERR
,
'[
%
s] Script action stderr returned "
%
s"'
%
(
message_uuid
,
script_error_output
.
strip
()[:
255
])
)
return
script_output
except
:
syslog
.
syslog
(
syslog
.
LOG_ERR
,
'[
%
s] Script action failed at
%
s'
%
(
message_uuid
,
traceback
.
format_exc
()))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment