- Notifications
You must be signed in to change notification settings - Fork 7
Added rsyslog service management without the need for systemd #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits Select commit Hold shift + click to select a range
819bfaa Added rsyslog serivce management without the need for systemd
Martin-Rehr 4b2dd25 Adjusted 'processname' as suggested by @jonasbardino
Martin-Rehr a240d99 Changed double hyphen to single in 'status' message as suggested by @…
Martin-Rehr 97f539c That is: Changed double hyphen to single in 'usage' message as sugges…
Martin-Rehr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| #!/bin/bash | ||
| # | ||
| # /etc/rc.d/init.d/rsyslog-minimal | ||
| # | ||
| # A simple rsyslog wrapper for docker-migrid container use | ||
| # | ||
| # Recognized arguments: | ||
| # start - start rsyslog | ||
| # stop - terminate rsyslog | ||
| # restart - terminate and start rsyslog | ||
| # reload - reload rsyslog | ||
| # status - report rsyslog status | ||
| # | ||
| # Customization of the rsyslog installation should be specified by | ||
| # variables in /etc/sysconfig/rsyslog-minimal | ||
| # | ||
| # Made from the template /usr/share/doc/initscripts-X/sysinitvfiles | ||
| # from our CentOS installation | ||
| # | ||
| # <tags ...> | ||
| # | ||
| # chkconfig: - 90 10 | ||
| # description: rsyslogd - reliable and extended syslogd | ||
| # processname: rsyslog | ||
| # config: /etc/sysconfig/rsyslog-minimal | ||
| # | ||
| | ||
| # Source function library. | ||
| . /etc/init.d/functions | ||
| | ||
| # <define any local shell functions used by the code that follows> | ||
| | ||
| # first, pull in custom configuration (if it exists): | ||
| if [ -f /etc/sysconfig/rsyslog-minimal ]; then | ||
| . /etc/sysconfig/rsyslog-minimal | ||
| fi | ||
| # you probably do not want to modify these... | ||
| PID_DIR="${PID_DIR:-/var/run}" | ||
| DAEMON_PATH="/usr/sbin/rsyslogd" | ||
| PID_FILE="$PID_DIR/rsyslogd.pid" | ||
| | ||
| show_usage() { | ||
| echo "Usage: rsyslog--minimal {start|stop|status|restart|reload}" | ||
| ||
| } | ||
| | ||
| start_rsyslog() { | ||
| echo -n "Starting rsyslog daemon" | ||
| ${DAEMON_PATH} | ||
| RET2=$? | ||
| [ $RET2 ] && success | ||
| echo | ||
| [ $RET2 ] || echo "Warning: rsyslog daemon not started." | ||
| echo | ||
| } | ||
| | ||
| stop_rsyslog() { | ||
| echo -n "Shutting down rsyslog daemon" | ||
| killproc ${DAEMON_PATH} | ||
| echo | ||
| } | ||
| | ||
| reload_rsyslog() { | ||
| echo -n "Reloading rsyslog daemon" | ||
| killproc ${DAEMON_PATH} -HUP | ||
| echo | ||
| } | ||
| | ||
| status_rsyslog() { | ||
| status ${DAEMON_PATH} | ||
| } | ||
| | ||
| | ||
| ### Main ### | ||
| | ||
| # Exit cleanly if main daemon is missing | ||
| test -f ${DAEMON_PATH} || exit 0 | ||
| | ||
| case "$1" in | ||
| start) | ||
| start_rsyslog | ||
| ;; | ||
| stop) | ||
| stop_rsyslog | ||
| ;; | ||
| status) | ||
| status_rsyslog | ||
| ;; | ||
| restart) | ||
| stop_rsyslog | ||
| start_rsyslog | ||
| ;; | ||
| reload) | ||
| reload_rsyslog | ||
| ;; | ||
| *) | ||
| show_usage | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| exit $? | ||
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to my tests I think this
processnameshould bersyslogd. I considered if the service / init script name should match but can see that it's called justrsyslogin systemd and in/etc/sysconfig//, so I guess that's fine.