darold / sendmailanalyzer

Sendmail log Analyzer is a tool to monitor sendmail usage and generate HTML and graph reports. It reports all you ever wanted to know about email trafic on your network. You can also use it in ISP environment with per domain and per mailbox report.
http://sendmailanalyzer.darold.net/
GNU General Public License v3.0
76 stars 13 forks source link

Start script #49

Closed lloydsystems closed 7 years ago

lloydsystems commented 7 years ago

I have a suggestion for a simple improvement. I have been testing this software on a CentOS system. I built the source into RPM with the spec file provided.

The SendmailAnalyzer service must be restarted after a mail log rotation. A conditional restart would be best in this case to avoid reactivating the service if it has been manually stopped. However, the init script provided does not support this feature. I modified the init script to add a 'condrestart' function thus:

`case "$1" in

'start') sa_start ;; 'stop') sa_stop ;; 'restart') sa_restart ;; 'condrestart') [ -e $LOCKFILE ] && $0 restart || : ;; 'status') status sendmailanalyzer ;; *) echo "usage $0 start|stop|restart|condrestart|status" esac

` This is fairly typical code for the conditional restart function. Perhaps this could be added in future updates.

Thanks, Steve Jones

darold commented 7 years ago

Applied in commit 3b7d8c6, thanks.