Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ian Eiloart
Sympl
Commits
d8b6ba8e
Commit
d8b6ba8e
authored
May 12, 2017
by
telyn
Browse files
Drop privileges when writing to symbiosis-monit.cursor
parent
225ad6be
Changes
3
Hide whitespace changes
Inline
Side-by-side
monit/sbin/symbiosis-monit-failure-email
100644 → 100755
View file @
d8b6ba8e
...
...
@@ -3,6 +3,6 @@
set
-e
args
=
"--since=today"
[
-e
"/run/symbiosis-monit.cursor"
]
&&
args
=
"--after-cursor=
$(
</
run
/symbiosis-monit.cursor
)
"
[
-e
"/run/symbiosis-monit.cursor"
]
&&
args
=
"--after-cursor=
$(
</
var/tmp
/symbiosis-monit.cursor
)
"
journalctl
-b0
$args
-u
"symbiosis-monit.service"
| mail
-s
"Symbiosis monitor detected service failure"
root
monit/system/symbiosis-monit-failure-email.service
View file @
d8b6ba8e
...
...
@@ -3,4 +3,4 @@ Description=Notify by email about symbiosis-monit failure
[Service]
Type
=
simple
ExecStart
=
/usr/bin/symbiosis-monit-failure-email
ExecStart
=
/usr/
s
bin/symbiosis-monit-failure-email
monit/system/symbiosis-monit.service
View file @
d8b6ba8e
...
...
@@ -4,5 +4,7 @@ OnFailure=symbiosis-monit-failure-email.service
[Service]
Type
=
simple
ExecStartPre
=
/bin/sh -c 'journalctl -o cat -n 0 -u %n --show-cursor | cut -f3 -d" " > /run/symbiosis-monit.cursor'
ExecStart
=
/usr/sbin/symbiosis-monit -t email /etc/symbiosis/monit.d
ExecStartPre
=
/bin/sh -c 'journalctl -o cat -n 0 -u %n --show-cursor | cut -f3 -d" " > /var/tmp/symbiosis-monit.cursor'
ExecStart
=
+/usr/sbin/symbiosis-monit -t email /etc/symbiosis/monit.d
User
=
nobody
Group
=
nobody
Write
Preview
Supports
Markdown
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