-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Systemd control #895
Open
ddpbsd
wants to merge
26
commits into
ossec:master
Choose a base branch
from
ddpbsd:systemd_control
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Systemd control #895
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
63fb433
use Before and After to determine the order these should start in.
ddpbsd 56d40d3
Adjust the service files for the server install to preserve desired
ddpbsd 42a7434
Stop the processes too, I guess.
ddpbsd 58bafaa
Add enable files for dbd, agentlessd, and csyslogd. This should help
ddpbsd b425d0a
Require the dot files created when enabling via ossec-control to
ddpbsd 358811a
Enable disable in systemd setups.
ddpbsd da1cfee
Merge branch 'master' of github.com:ddpbsd/ossec-hids into systemd_se…
ddpbsd c243cd9
Merge branch 'master' of github.com:ddpbsd/ossec-hids into systemd_co…
ddpbsd 5900c89
Merge branch 'master' of github.com:ddpbsd/ossec-hids into systemd_co…
ddpbsd fccfb6b
ssytemctl -> systemctl
ddpbsd 23662c5
Merge branch 'systemd_control' of https://github.com/ddpbsd/ossec-hid…
249ac8d
Merge branch 'master' of https://github.com/ddpbsd/ossec-hids into sy…
07e0c4f
Merge branch 'master' of https://github.com/ossec/ossec-hids into sys…
ddpbsd 314ed7f
Merge branch 'systemd_services' of github.com:ddpbsd/ossec-hids into …
ddpbsd 2e2dccf
I think ossec-server.service should be ossec-server.target.
3da96bf
UNTESTED: Try to install the systemd files
ea84264
Silly typo.
0c1817f
ENEEDCOFFEE: Fix the paths.
79fd4e1
I forgot /bin/sh is neutered on Ubuntu.
3f2e6dd
Merge branch 'systemd_combined' of ssh://buzzell/home/ddp/src/project…
ddpbsd 2f4d859
Try to appease systems without /etc/systemd/system
ddpbsd e387076
X -> x
ddpbsd 0a09265
I'm not sure why I thought systemctl was installed in /sbin, it's
ddpbsd 309d5e2
Merge branch 'master' of https://github.com/ossec/ossec-hids into sys…
ddpbsd df44614
Merge branch 'master' of github.com:ddpbsd/ossec-hids into systemd_co…
ddpbsd 0bc9ad2
2 silly mistakes spotted by phamvuong
ddpbsd 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
Stop the processes too, I guess.
I have no doubts the logic can improve, but I want to get a PoC in place.
commit 42a7434e520f3335317d39cdcf332afe984f57d1
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -184,6 +184,7 @@ testconfig() | |
# Start function | ||
start() | ||
{ | ||
|
||
SDAEMONS="${DB_DAEMON} ${CSYSLOG_DAEMON} ${AGENTLESS_DAEMON} ossec-maild ossec-execd ossec-analysisd ossec-logcollector ossec-remoted ossec-syscheckd ossec-monitord" | ||
|
||
echo "Starting $NAME $VERSION (by $AUTHOR)..." | ||
|
@@ -192,6 +193,16 @@ start() | |
echo "OSSEC analysisd: Testing rules failed. Configuration error. Exiting." | ||
exit 1; | ||
fi | ||
|
||
## If the system is Linux, look for systemctl. If that file exists, use it. | ||
## XXX - system paths and exact execution are probably wrong. | ||
if [ X`uname` == "XLinux" ]; then | ||
if [ -x /sbin/systemctl ]; then | ||
/sbin/ssytemctl start ossec-server.service | ||
fi | ||
exit 0 | ||
fi | ||
|
||
lock; | ||
checkpid; | ||
|
||
|
@@ -251,6 +262,14 @@ pstatus() | |
stopa() | ||
{ | ||
lock; | ||
|
||
if [ X`uname` == "XLinux" ]; then | ||
if [ -x /sbin/systemctl ]; then | ||
/sbin/systemctl stop ossec-server.service | ||
fi | ||
exit 0 | ||
if | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fi |
||
|
||
checkpid; | ||
for i in ${DAEMONS}; do | ||
pstatus ${i}; | ||
|
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.