mirror of
https://github.com/darold/sendmailanalyzer.git
synced 2026-05-15 22:02:32 -06:00
[GH-ISSUE #18] Wrong script for systemd startup #10
Labels
No labels
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/sendmailanalyzer#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fmalfatto on GitHub (Apr 16, 2014).
Original GitHub issue: https://github.com/darold/sendmailanalyzer/issues/18
I'm not able to stop sendmailanalyzer via
"systemctl stop sendmailanalyzer.service"
under opensuse 12.3.
The service definition has the following line:
ExecStop=/bin/kill -TERM sendmailanalyzer
But kill needs the process id, not the process name.
I tried to change that line to
ExecStop=/bin/kill -TERM $MAINPID
as from systemd docs, but it does not work.
That bug make me unable to have senmailanalyze restarted after syslog rotation, and it fails every night.
@darold commented on GitHub (Apr 16, 2014):
You can use pkill instead of kill like follow if you have such utility installed:
or use the pid file instead:
or something like that. The path of the pid file is defined into sendmailanalyzer.conf with directive PID_DIR.
Or better is to restart sendmailanalyzer directly from syslog rotation. In my /etc/logrotate.d/rsyslog I have the following in the postrotate part:
Let me know what's solves your issue.
@fmalfatto commented on GitHub (Apr 16, 2014):
Having pkill installed, in sendmailanalyzer.service I changed to
ExecStop=/usr/bin/pkill -TERM sendmailanalyzer
and in /etc/logrotate.d/syslog I added in postrotate:
/usr/bin/systemctl restart sendmailanalyzer.service > /dev/null 2>&1 || true
All is working perfectly now! Ty very much for fast and clean help!
@darold commented on GitHub (Apr 16, 2014):
Ok, I will drop a line about that in documentation
@fmalfatto commented on GitHub (Jan 6, 2016):
Small correction:
the reported line in sendmailanalyzer.service
ExecStop=/bin/kill -TERM
cat /var/run/sendmailanalyzer.piddoes not work in OpenSuse 13.1, reporting "No such process" .
The correct line would be:
ExecStop=/bin/bash -c "/bin/kill -TERM
/usr/bin/cat /var/run/sendmailanalyzer.pid"@darold commented on GitHub (Jan 6, 2016):
Thanks for the report, latest commit
be3083fadds your patch.Best regards,