[GH-ISSUE #49] Start script #40

Closed
opened 2026-05-05 15:01:28 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @lloydsystems on GitHub (Jun 25, 2017).
Original GitHub issue: https://github.com/darold/sendmailanalyzer/issues/49

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

Originally created by @lloydsystems on GitHub (Jun 25, 2017). Original GitHub issue: https://github.com/darold/sendmailanalyzer/issues/49 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
Author
Owner

@darold commented on GitHub (Jun 25, 2017):

Applied in commit 3b7d8c6, thanks.

<!-- gh-comment-id:310912889 --> @darold commented on GitHub (Jun 25, 2017): Applied in commit 3b7d8c6, thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/sendmailanalyzer#40
No description provided.