[Pkg-ossec-devel] [pkg-ossec] 01/01: Adjust permission after creating /var/run/ossec-hids.
Jose Antonio Quevedo Muñoz
jaqm-guest at moszumanska.debian.org
Wed Mar 12 18:37:03 UTC 2014
This is an automated email from the git hooks/post-receive script.
jaqm-guest pushed a commit to branch master
in repository pkg-ossec.
commit 5d2ed443b37afedcb9a8dad90ab5fd3036290545
Author: Jose Antonio Quevedo <joseantonio.quevedo at gmail.com>
Date: Wed Mar 12 18:36:32 2014 +0100
Adjust permission after creating /var/run/ossec-hids.
Thanks to Weiqiang Yang.
---
debian/ossec-hids-agent.init | 10 +++++++++-
debian/ossec-hids-local.init | 9 ++++++++-
debian/ossec-hids-server.init | 9 ++++++++-
3 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/debian/ossec-hids-agent.init b/debian/ossec-hids-agent.init
index f28b907..42e3bb5 100755
--- a/debian/ossec-hids-agent.init
+++ b/debian/ossec-hids-agent.init
@@ -28,6 +28,9 @@ NAME=ossec-hids-agent
DAEMON=/usr/lib/ossec/ossec-agentd
DAEMON_ARGS=""
SCRIPTNAME=/etc/init.d/$NAME
+USER=ossec
+GROUP=ossec
+PIDFILE=/var/run/ossec-hids
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
@@ -55,7 +58,12 @@ test $DEBIAN_SCRIPT_DEBUG && set -v -x
[ ! -e "${DIRECTORY}" ] && exit 0
# Create the directory for the pidfiles
-[ ! -e /var/run/ossec-hids ] && mkdir -p /var/run/ossec-hids
+[ ! -e ${PIDFILE} ] && {
+ mkdir -p ${PIDFILE}
+ chown ${USER}:${GROUP} ${PIDFILE}
+ chmod 755 ${PIDFILE}
+}
+
# Log file for the ossec-control file
LOGDIR=${DIRECTORY}/logs
diff --git a/debian/ossec-hids-local.init b/debian/ossec-hids-local.init
index b7aed02..3159a11 100755
--- a/debian/ossec-hids-local.init
+++ b/debian/ossec-hids-local.init
@@ -28,6 +28,9 @@ NAME=ossec-hids-local
DAEMON=/usr/lib/ossec/ossec-agentd
DAEMON_ARGS=""
SCRIPTNAME=/etc/init.d/$NAME
+USER=ossec
+GROUP=ossec
+PIDFILE=/var/run/ossec-hids
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
@@ -55,7 +58,11 @@ test $DEBIAN_SCRIPT_DEBUG && set -v -x
[ ! -e "${DIRECTORY}" ] && exit 0
# Create the directory for the pidfiles
-[ ! -e /var/run/ossec-hids ] && mkdir -p /var/run/ossec-hids
+[ ! -e ${PIDFILE} ] && {
+ mkdir -p ${PIDFILE}
+ chown ${USER}:${GROUP} ${PIDFILE}
+ chmod 755 ${PIDFILE}
+}
# Log file for the ossec-control file
LOGDIR=${DIRECTORY}/logs
diff --git a/debian/ossec-hids-server.init b/debian/ossec-hids-server.init
index 3db624a..c1831b4 100755
--- a/debian/ossec-hids-server.init
+++ b/debian/ossec-hids-server.init
@@ -28,6 +28,9 @@ NAME=ossec-hids-server
DAEMON=/usr/lib/ossec/ossec-agentd
DAEMON_ARGS=""
SCRIPTNAME=/etc/init.d/$NAME
+USER=ossec
+GROUP=ossec
+PIDFILE=/var/run/ossec-hids
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
@@ -55,7 +58,11 @@ test $DEBIAN_SCRIPT_DEBUG && set -v -x
[ ! -e "${DIRECTORY}" ] && exit 0
# Create the directory for the pidfiles
-[ ! -e /var/run/ossec-hids ] && mkdir -p /var/run/ossec-hids
+[ ! -e ${PIDFILE} ] && {
+ mkdir -p ${PIDFILE}
+ chown ${USER}:${GROUP} ${PIDFILE}
+ chmod 755 ${PIDFILE}
+}
# Log file for the ossec-control file
LOGDIR=${DIRECTORY}/logs
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ossec/pkg-ossec.git
More information about the Pkg-ossec-devel
mailing list