source: build-files/ports-overlay/security/ossec-hids-server/files/ossec-hids.in @ 1e102bd

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since 1e102bd was 1e102bd, checked in by Kris Moore <kris@…>, 11 months ago

Add a bunch of modified ports for 10.0, so we can fix the building

  • Property mode set to 100644
File size: 1.3 KB
Line 
1#!/bin/sh
2#
3# PROVIDE: ossechids
4# REQUIRE: DAEMON
5# BEFORE:  LOGIN
6# KEYWORD: shutdown
7
8. /etc/rc.subr
9
10name="ossechids"
11rcvar=ossechids_enable
12
13load_rc_config $name
14
15: ${ossechids_enable="NO"}
16: ${ossechids_user="ossec"}
17: ${ossechids_group="ossec"}
18
19start_precmd=%%PRECMD%%
20start_cmd="ossechids_command start"
21stop_cmd="ossechids_command stop"
22restart_cmd="ossechids_command restart"
23status_cmd="ossechids_command status"
24
25command="%%PREFIX%%/%%PORTNAME%%/bin/ossec-control"
26required_files="%%PREFIX%%/%%PORTNAME%%/etc/ossec.conf"
27
28fts_queue=%%PREFIX%%/%%PORTNAME%%/queue/fts/fts-queue
29ig_queue=%%PREFIX%%/%%PORTNAME%%/queue/fts/ig-queue
30
31ossechids_start_precmd() {
32    # These files are not created by the daemons with the correct
33    # ownership, so create them here before starting up the system,
34    # if they don't already exist. This is only done for the "local" and
35    # "server" installation types.
36    if [ ! -e ${fts_queue} ]; then
37        touch ${fts_queue}
38        chown ${ossechids_user}:${ossechids_group} ${fts_queue}
39        chmod 640 ${fts_queue}
40    fi
41    if [ ! -e ${ig_queue} ]; then
42        touch ${ig_queue}
43        chown ${ossechids_user}:${ossechids_group} ${ig_queue}
44        chmod 640 ${ig_queue}
45    fi
46}
47
48ossechids_command() {
49        ${command} ${rc_arg}
50}
51
52run_rc_command "$1"
Note: See TracBrowser for help on using the repository browser.