aboutsummaryrefslogtreecommitdiff
path: root/security/ossec-hids-server
diff options
context:
space:
mode:
authorGreg Larkin <glarkin@FreeBSD.org>2011-11-23 22:26:41 +0000
committerGreg Larkin <glarkin@FreeBSD.org>2011-11-23 22:26:41 +0000
commit8f7496f7d814fc26af241b3164512bebdeba1696 (patch)
tree933fd401f8bab7556838ab3345f8fb1576a540c0 /security/ossec-hids-server
parenteec7165c700d6e7074561090e653876f55b9b468 (diff)
downloadports-8f7496f7d814fc26af241b3164512bebdeba1696.tar.gz
ports-8f7496f7d814fc26af241b3164512bebdeba1696.zip
Notes
Diffstat (limited to 'security/ossec-hids-server')
-rw-r--r--security/ossec-hids-server/Makefile5
-rw-r--r--security/ossec-hids-server/files/ossec-hids.in42
-rw-r--r--security/ossec-hids-server/files/patch-src__init__ossec-local.sh11
3 files changed, 41 insertions, 17 deletions
diff --git a/security/ossec-hids-server/Makefile b/security/ossec-hids-server/Makefile
index 962963d4aa37..b1f80c751b5a 100644
--- a/security/ossec-hids-server/Makefile
+++ b/security/ossec-hids-server/Makefile
@@ -7,7 +7,7 @@
PORTNAME= ossec-hids
PORTVERSION= 2.6
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= http://www.ossec.net/files/ \
http://www.ossec.net/files/old/
@@ -43,12 +43,15 @@ USE_PGSQL= yes
.endif
.if defined(CLIENT_ONLY)
+SUB_LIST+= PRECMD=:
PKGNAMESUFFIX= -client
CONFLICTS= ossec-hids-server-[0-9]* ossec-hids-local-[0-9]*
.elif defined(LOCAL_ONLY)
+SUB_LIST+= PRECMD=ossechids_start_precmd
PKGNAMESUFFIX= -local
CONFLICTS= ossec-hids-client-[0-9]* ossec-hids-server-[0-9]*
.else
+SUB_LIST+= PRECMD=ossechids_start_precmd
CONFLICTS= ossec-hids-client-[0-9]* ossec-hids-local-[0-9]*
.endif
diff --git a/security/ossec-hids-server/files/ossec-hids.in b/security/ossec-hids-server/files/ossec-hids.in
index 7c6c1c37e14a..4f464fb6e9ff 100644
--- a/security/ossec-hids-server/files/ossec-hids.in
+++ b/security/ossec-hids-server/files/ossec-hids.in
@@ -3,6 +3,7 @@
# PROVIDE: ossechids
# REQUIRE: DAEMON
# BEFORE: LOGIN
+# KEYWORD: shutdown
. /etc/rc.subr
@@ -15,28 +16,37 @@ load_rc_config $name
: ${ossechids_user="ossec"}
: ${ossechids_group="ossec"}
-start_cmd=${name}_start
-stop_cmd=${name}_stop
-restart_cmd=${name}_restart
-status_cmd=${name}_status
+start_precmd=%%PRECMD%%
+start_cmd="ossechids_command start"
+stop_cmd="ossechids_command stop"
+restart_cmd="ossechids_command restart"
+status_cmd="ossechids_command status"
command="%%PREFIX%%/%%PORTNAME%%/bin/ossec-control"
required_files="%%PREFIX%%/%%PORTNAME%%/etc/ossec.conf"
-ossechids_start() {
- $command start
+fts_queue=%%PREFIX%%/%%PORTNAME%%/queue/fts/fts-queue
+ig_queue=%%PREFIX%%/%%PORTNAME%%/queue/fts/ig-queue
+
+ossechids_start_precmd() {
+ # These files are not created by the daemons with the correct
+ # ownership, so create them here before starting up the system,
+ # if they don't already exist. This is only done for the "local" and
+ # "server" installation types.
+ if [ ! -e ${fts_queue} ]; then
+ touch ${fts_queue}
+ chown ${ossechids_user}:${ossechids_group} ${fts_queue}
+ chmod 640 ${fts_queue}
+ fi
+ if [ ! -e ${ig_queue} ]; then
+ touch ${ig_queue}
+ chown ${ossechids_user}:${ossechids_group} ${ig_queue}
+ chmod 640 ${ig_queue}
+ fi
}
-ossechids_stop() {
- $command stop
-}
-
-ossechids_restart() {
- $command restart
-}
-
-ossechids_status() {
- $command status
+ossechids_command() {
+ ${command} ${rc_arg}
}
run_rc_command "$1"
diff --git a/security/ossec-hids-server/files/patch-src__init__ossec-local.sh b/security/ossec-hids-server/files/patch-src__init__ossec-local.sh
new file mode 100644
index 000000000000..5de45c61560e
--- /dev/null
+++ b/security/ossec-hids-server/files/patch-src__init__ossec-local.sh
@@ -0,0 +1,11 @@
+--- ./src/init/ossec-local.sh.orig 2011-11-23 15:37:30.000000000 -0500
++++ ./src/init/ossec-local.sh 2011-11-23 15:37:39.000000000 -0500
+@@ -207,7 +207,7 @@
+ SDAEMONS="${DB_DAEMON} ${CSYSLOG_DAEMON} ${AGENTLESS_DAEMON} ossec-maild ossec-execd ossec-analysisd ossec-logcollector ossec-syscheckd ossec-monitord"
+
+ echo "Starting $NAME $VERSION (by $AUTHOR)..."
+- echo | ${DIR}/ossec-logtest > /dev/null 2>&1;
++ echo | ${DIR}/bin/ossec-logtest > /dev/null 2>&1;
+ if [ ! $? = 0 ]; then
+ echo "ossec-analysisd: Configuration error. Exiting."
+ fi