Skip to content

Commit

Permalink
Chown log/pid on startup.
Browse files Browse the repository at this point in the history
Refs #5787
  • Loading branch information
Michael Friedrich committed Mar 17, 2014
1 parent a066cbf commit cf3f0ea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions etc/init.d/icinga2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ICINGA2_CONFIG_FILE=@CMAKE_INSTALL_FULL_SYSCONFDIR@/icinga2/icinga2.conf
ICINGA2_STATE_DIR=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@
ICINGA2_PID_FILE=$ICINGA2_STATE_DIR/run/icinga2/icinga2.pid
ICINGA2_ERROR_LOG=$ICINGA2_STATE_DIR/log/icinga2/error.log
ICINGA2_LOG=$ICINGA2_STATE_DIR/log/icinga2/icinga2.log
ICINGA2_USER=@ICINGA2_USER@
ICINGA2_GROUP=@ICINGA2_GROUP@
ICINGA2_COMMAND_USER=@ICINGA2_COMMAND_USER@
Expand Down Expand Up @@ -49,10 +50,12 @@ fi
start() {
mkdir -p $(dirname -- $ICINGA2_PID_FILE)
chown $ICINGA2_USER:$ICINGA2_GROUP $(dirname -- $ICINGA2_PID_FILE)
chown $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_PID_FILE

mkdir -p $(dirname -- $ICINGA2_ERROR_LOG)
chown $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $(dirname -- $ICINGA2_ERROR_LOG)
chmod 750 $(dirname -- $ICINGA2_ERROR_LOG)
chown $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $ICINGA2_ERROR_LOG $ICINGA2_LOG

mkdir -p $ICINGA2_STATE_DIR/run/icinga2/cmd
chown $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $ICINGA2_STATE_DIR/run/icinga2/cmd
Expand Down

0 comments on commit cf3f0ea

Please sign in to comment.