View | Details | Raw Unified | Return to bug 216593 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-6 / +15 lines)
Lines 2-11 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	graylog
4
PORTNAME=	graylog
5
PORTVERSION=	1.3.3
5
PORTVERSION=	2.2.0
6
CATEGORIES=	sysutils java
6
CATEGORIES=	sysutils java
7
MASTER_SITES=	https://packages.graylog2.org/releases/graylog2-server/ \
7
MASTER_SITES=	https://packages.graylog2.org/releases/graylog/ \
8
		http://packages.graylog2.org/releases/graylog2-server/
8
		http://packages.graylog2.org/releases/graylog/
9
9
10
MAINTAINER=	thomas@bartelmess.io
10
MAINTAINER=	thomas@bartelmess.io
11
COMMENT=	Tool for centralized log collection
11
COMMENT=	Tool for centralized log collection
Lines 22-44 Link Here
22
GRAYLOG_DIR=	${PREFIX}/${PORTNAME}
22
GRAYLOG_DIR=	${PREFIX}/${PORTNAME}
23
23
24
USE_RC_SUBR=	graylog
24
USE_RC_SUBR=	graylog
25
SUB_FILES=	server.conf.sample pkg-message
25
26
26
GRAYLOGUSER?=	graylog
27
GRAYLOGUSER?=	graylog
27
GRAYLOGGROUP?=	${GRAYLOGUSER}
28
GRAYLOGGROUP?=	${GRAYLOGUSER}
28
USERS=		${GRAYLOGUSER}
29
USERS=		${GRAYLOGUSER}
29
GROUPS=		${GRAYLOGGROUP}
30
GROUPS=		${GRAYLOGGROUP}
31
GRAYLOG_DATA_DIR=	/var/db/graylog
30
32
31
SUB_LIST=	GRAYLOGUSER=${GRAYLOGUSER} \
33
SUB_LIST=	GRAYLOGUSER=${GRAYLOGUSER} \
32
		GRAYLOGGROUP=${GRAYLOGGROUP} \
34
		GRAYLOGGROUP=${GRAYLOGGROUP} \
33
		JAVA_HOME=${JAVA_HOME} \
35
		JAVA_HOME=${JAVA_HOME} \
34
		GRAYLOG_DIR=${GRAYLOG_DIR} \
36
		GRAYLOG_DIR=${GRAYLOG_DIR} \
37
		ETCDIR=${ETCDIR} \
38
		GRAYLOG_DATA_DIR=${GRAYLOG_DATA_DIR}
39
40
PLIST_SUB=	GRAYLOG_DATA_DIR=${GRAYLOG_DATA_DIR} \
41
		GRAYLOGUSER=${GRAYLOGUSER} \
42
		GRAYLOGGROUP=${GRAYLOGGROUP} \
35
		ETCDIR=${ETCDIR}
43
		ETCDIR=${ETCDIR}
36
44
37
do-install:
45
do-install:
38
	${MKDIR} ${STAGEDIR}${GRAYLOG_DIR}
46
	${MKDIR} ${STAGEDIR}${GRAYLOG_DIR}
39
	${MKDIR} ${STAGEDIR}${ETCDIR}
47
	${MKDIR} ${STAGEDIR}${ETCDIR}/server
48
	${MKDIR} ${GRAYLOG_DATA_DIR}
40
	${INSTALL_DATA} ${WRKSRC}/graylog.jar ${STAGEDIR}${GRAYLOG_DIR}
49
	${INSTALL_DATA} ${WRKSRC}/graylog.jar ${STAGEDIR}${GRAYLOG_DIR}
41
	${INSTALL_DATA} ${WRKSRC}/graylog.conf.example ${STAGEDIR}${ETCDIR}
50
	(cd ${WRKSRC}/plugin && ${COPYTREE_SHARE} . ${STAGEDIR}${GRAYLOG_DIR}/plugin)
42
	${INSTALL_DATA} ${FILESDIR}/graylog_logging.xml ${STAGEDIR}${ETCDIR}
51
	${INSTALL_DATA} ${WRKDIR}/server.conf.sample ${STAGEDIR}${ETCDIR}/server/server.conf.sample
43
52
44
.include <bsd.port.mk>
53
.include <bsd.port.mk>
(-)distinfo (-2 / +3 lines)
Lines 1-2 Link Here
1
SHA256 (graylog-1.3.3.tgz) = 1e98509376dc22ff1602838cebb49b4732618296acc58063ba34f4a97f667ba0
1
TIMESTAMP = 1485737319
2
SIZE (graylog-1.3.3.tgz) = 70204863
2
SHA256 (graylog-2.2.0.tgz) = 1e3b77a1706245515581fb2db278fcf9ee0e7d1837af3f15e657878ca17e6b61
3
SIZE (graylog-2.2.0.tgz) = 99202010
(-)files/graylog.in (-24 / +32 lines)
Lines 34-50 Link Here
34
#   Default value: %%GRAYLOG_DIR%%
34
#   Default value: %%GRAYLOG_DIR%%
35
#   Path the the graylog installation.
35
#   Path the the graylog installation.
36
#
36
#
37
# graylog_data_dir (string):
38
#   Default vaule: %%GRAYLOG_DATA_DIR%%
39
#   Storage location for the graylog journal
40
#
37
# graylog_run_dir (string):
41
# graylog_run_dir (string):
38
#   Default value: /var/graylog
42
#   Default value: /var/graylog
39
#   Path the the graylog run folder.
43
#   Path the the graylog run folder.
40
#
44
#
41
# graylog_java_home (string):
45
# graylog_log_file (string):
42
#   Default value: %%JAVA_HOME%%
46
#   Default value: /var/log/graylog-server.conf
43
#   Root directory of the desired Java SDK.
47
#   Path for the Graylog Server logfile
44
#
45
# graylog_log4j_config (string):
46
#   Default value: file://%%ETCDIR%%/graylog_logging.xml
47
#   Path to the log4j configuration file for graylog
48
48
49
. /etc/rc.subr
49
. /etc/rc.subr
50
50
Lines 55-67 Link Here
55
: ${graylog_enable:="NO"}
55
: ${graylog_enable:="NO"}
56
: ${graylog_user:="%%GRAYLOGUSER%%"}
56
: ${graylog_user:="%%GRAYLOGUSER%%"}
57
: ${graylog_group:="%%GRAYLOGGROUP%%"}
57
: ${graylog_group:="%%GRAYLOGGROUP%%"}
58
: ${graylog_config:="%%ETCDIR%%/${name}.conf"}
58
: ${graylog_config:="%%ETCDIR%%/server/server.conf"}
59
: ${graylog_min_mem:="256m"}
59
: ${graylog_min_mem:="256m"}
60
: ${graylog_max_mem:="1g"}
60
: ${graylog_max_mem:="1g"}
61
: ${graylog_dir:="%%GRAYLOG_DIR%%"}
61
: ${graylog_dir:="%%GRAYLOG_DIR%%"}
62
: ${graylog_run_dir:="/var/graylog"}
62
: ${graylog_data_dir:="%%GRAYLOG_DATA_DIR%%"}
63
: ${graylog_java_home:="%%JAVA_HOME%%"}
63
: ${graylog_run_dir:="/var/run/graylog"}
64
: ${graylog_log4j_config="file://%%ETCDIR%%/graylog_logging.xml"}
64
: ${graylog_log_file:="/var/log/graylog-server.log"}
65
65
66
66
67
java_options=" -Xms${graylog_min_mem} \
67
java_options=" -Xms${graylog_min_mem} \
Lines 72-96 Link Here
72
               -XX:+CMSConcurrentMTEnabled \
72
               -XX:+CMSConcurrentMTEnabled \
73
               -XX:+CMSClassUnloadingEnabled \
73
               -XX:+CMSClassUnloadingEnabled \
74
               -XX:+UseParNewGC \
74
               -XX:+UseParNewGC \
75
               -XX:-OmitStackTraceInFastThrow\
75
               -XX:-OmitStackTraceInFastThrow"
76
               -Djava.library.path=${graylog_dir}/lib/sigar \
77
               -Dlog4j.configuration=${graylog_log4j_config}"
78
76
79
start_precmd="graylog_precmd"
77
start_precmd="graylog_precmd"
80
78
81
pidfile=/var/run/${name}.pid
79
pidfile="${graylog_run_dir}/${name}.pid"
82
command=/usr/sbin/daemon
80
command=/usr/bin/nohup
83
procname=`env JAVAVM_DRYRUN=true JAVA_VERSION=1.7+ %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -f 2 -d =`
84
81
85
command_args="-p $pidfile -f /usr/local/bin/java ${java_options} -jar ${graylog_dir}/graylog.jar server --configfile ${graylog_config} --no-pid-file"
82
command_args="java -jar /usr/local/graylog/graylog.jar server \
83
              --configfile \"${graylog_config}\" \
84
              --pidfile \"${pidfile}\" \
85
              >> \"${graylog_log_file}\" \
86
              2>> \"${graylog_log_file}\" &"
86
87
87
graylog_precmd() {
88
graylog_precmd() {
88
    /usr/bin/install -d -o ${graylog_group} -g ${graylog_group} -m 755 /var/log/graylog
89
    if [ ! -f "${graylog_config}" ]; then
89
    /usr/bin/install -d -o ${graylog_group} -g ${graylog_group} -m 755 /var/log/graylog/server
90
        echo "Configuration file ${graylog_config} not found"
90
    /usr/bin/install -d -o ${graylog_group} -g ${graylog_group} -m 755 ${graylog_run_dir}
91
        exit 1
91
    touch $pidfile
92
    fi
92
    chown ${graylog_user}:${graylog_group} ${pidfile}
93
93
    cd ${graylog_run_dir}
94
    if [ ! -f "${graylog_log_file}" ]; then
95
        touch "${graylog_log_file}"
96
        chown "${graylog_user}:${graylog_group}" "${graylog_log_file}"
97
        chmod 640 "${graylog_log_file}"
98
    fi
99
100
    install -d -o ${graylog_user} -g ${graylog_group} -m 750 "${graylog_data_dir}"
101
    install -d -o ${graylog_user} -g ${graylog_group} -m 750 "${graylog_run_dir}"
94
}
102
}
95
103
96
run_rc_command "$1"
104
run_rc_command "$1"
(-)pkg-plist (-2 / +9 lines)
Lines 1-3 Link Here
1
%%ETCDIR%%/graylog.conf.example
1
@sample(%%GRAYLOGUSER%%,%%GRAYLOGGROUP%%,440) %%ETCDIR%%/server/server.conf.sample
2
%%ETCDIR%%/graylog_logging.xml
2
@unexec if [ -d %%GRAYLOG_DATADIR%% ]; then echo "You should remove %%GRAYLOG_DATADIR%% if you don't need it any more."; fi
3
graylog/graylog.jar
3
graylog/graylog.jar
4
graylog/plugin/graylog-plugin-anonymous-usage-statistics-2.2.0.jar
5
graylog/plugin/graylog-plugin-beats-2.2.0.jar
6
graylog/plugin/graylog-plugin-collector-2.2.0.jar
7
graylog/plugin/graylog-plugin-enterprise-integration-2.2.0.jar
8
graylog/plugin/graylog-plugin-map-widget-2.2.0.jar
9
graylog/plugin/graylog-plugin-pipeline-processor-2.2.0.jar
10

Return to bug 216593