aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorglarkin <glarkin@FreeBSD.org>2011-11-24 06:26:41 +0800
committerglarkin <glarkin@FreeBSD.org>2011-11-24 06:26:41 +0800
commit6017690e2bdda12654517113daaec0991e741e54 (patch)
treea003b3892ec8361f369f01071790f24357290943 /security
parentf6ee65796739943aa77eaa2531947a8ec33b8f08 (diff)
downloadfreebsd-ports-gnome-6017690e2bdda12654517113daaec0991e741e54.tar.gz
freebsd-ports-gnome-6017690e2bdda12654517113daaec0991e741e54.tar.zst
freebsd-ports-gnome-6017690e2bdda12654517113daaec0991e741e54.zip
- Applied the startup script patch from PR ports/161524 to the local
installation type [1] - Streamlined the rc.d file to use fewer functions - Added a precmd to the rc.d file to ensure the proper ownership on some queue files. OSSEC daemons don't properly chown them upon creation. - Bumped PORTREVISION Reported by: Albert Gabas <agabas@astabis.com> (via email) [1] Feature safe: yes
Diffstat (limited to 'security')
-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