Skip to content
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
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
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 May 3, 2016
56d40d3
Adjust the service files for the server install to preserve desired
ddpbsd May 3, 2016
42a7434
Stop the processes too, I guess.
ddpbsd May 3, 2016
58bafaa
Add enable files for dbd, agentlessd, and csyslogd. This should help
ddpbsd May 3, 2016
b425d0a
Require the dot files created when enabling via ossec-control to
ddpbsd May 3, 2016
358811a
Enable disable in systemd setups.
ddpbsd May 3, 2016
da1cfee
Merge branch 'master' of github.com:ddpbsd/ossec-hids into systemd_se…
ddpbsd Jul 12, 2016
c243cd9
Merge branch 'master' of github.com:ddpbsd/ossec-hids into systemd_co…
ddpbsd Jul 12, 2016
5900c89
Merge branch 'master' of github.com:ddpbsd/ossec-hids into systemd_co…
ddpbsd Aug 24, 2016
fccfb6b
ssytemctl -> systemctl
ddpbsd Aug 24, 2016
23662c5
Merge branch 'systemd_control' of https://github.com/ddpbsd/ossec-hid…
Sep 15, 2016
249ac8d
Merge branch 'master' of https://github.com/ddpbsd/ossec-hids into sy…
Sep 15, 2016
07e0c4f
Merge branch 'master' of https://github.com/ossec/ossec-hids into sys…
ddpbsd Sep 15, 2016
314ed7f
Merge branch 'systemd_services' of github.com:ddpbsd/ossec-hids into …
ddpbsd Sep 15, 2016
2e2dccf
I think ossec-server.service should be ossec-server.target.
Sep 15, 2016
3da96bf
UNTESTED: Try to install the systemd files
Sep 15, 2016
ea84264
Silly typo.
Sep 15, 2016
0c1817f
ENEEDCOFFEE: Fix the paths.
Sep 15, 2016
79fd4e1
I forgot /bin/sh is neutered on Ubuntu.
Sep 15, 2016
3f2e6dd
Merge branch 'systemd_combined' of ssh://buzzell/home/ddp/src/project…
ddpbsd Sep 15, 2016
2f4d859
Try to appease systems without /etc/systemd/system
ddpbsd Sep 15, 2016
e387076
X -> x
ddpbsd Nov 1, 2016
0a09265
I'm not sure why I thought systemctl was installed in /sbin, it's
ddpbsd Nov 1, 2016
309d5e2
Merge branch 'master' of https://github.com/ossec/ossec-hids into sys…
ddpbsd Apr 26, 2017
df44614
Merge branch 'master' of github.com:ddpbsd/ossec-hids into systemd_co…
ddpbsd Aug 22, 2018
0bc9ad2
2 silly mistakes spotted by phamvuong
ddpbsd Aug 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Stop the processes too, I guess.
I have no doubts the logic can improve, but I want to get a PoC in
place.
ddpbsd committed May 3, 2016
commit 42a7434e520f3335317d39cdcf332afe984f57d1
19 changes: 19 additions & 0 deletions src/init/ossec-server.sh
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ssytemctl
Think this might need to be systemctl

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fi


checkpid;
for i in ${DAEMONS}; do
pstatus ${i};