This repository has been archived by the owner on Feb 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmcinit.cfg
221 lines (181 loc) · 5.55 KB
/
mcinit.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#!/bin/bash
###############
# DEPENDENCIES
###############
# The following packages are script dependencies which are often times non-standard
# Java 6
# tmux
# rsync
#############################
# MAIN CONFIGURATION OPTIONS
#############################
# These should always be changed to match your server setup
# SRVDIR
# Path pointing to mincraft server directory
# Path should be absolute, and directory should contain craftbukkit.jar file
SRVDIR=''
# MCJAR
# Name of .jar file which will be used to launch server.
MCJAR='craftbukkit.jar'
# USER
# Name of user to run server as
# User should NOT be root or have root privileges
USER=''
# LOGDIR
# Directory in which to retain old log files
# Can be an absolute path, or can be relative to SRVDIR
LOGDIR='logs'
# RUNDIR
# Directory in which to store session ID files
# Must be readable/writable by USER
# Can be absolute path, or relative to SRVDIR
RUNDIR='run'
# RUNDIR
# Directory in which to store session ID files
# Must be readable/writable by USER
# Can be absolute path, or relative to SRVDIR
RUNDIR='run'
# WLDSTR
# Directory in which all minecraft worlds will be stored.
# Move worlds into this directory after they have been created, before running the server.
# Can be an absolute path, or can be relative to SRVDIR
WLDSTR='worlds'
# WLDBK
# Directory in which to move archives of world storage
# Can be an absolute path, or can be relative to SRVDIR
WLDBK='archive/worlds'
# PLGBK
# Directory in which to store archives of plugins folder
# Can be an absolute path, or can be relative to SRVDIR
PLGBK='archive/plugins'
# SRVBK
# Directory in which to store archives of main server files
# Can be an absolute path, or can be relative to SRVDIR
SRVBK='archive/server'
# CPU_CORES
# How many CPU cores will be utilized for garbage collection (memory cleanup)
CPU_CORES=1
# INITMEM
# How much memory to dedicate full time to Java heap
INITMEM='1024M'
# MAXMEM
# Maximum amount of memory allowed to be used by Java heap
MAXMEM='1024M'
###################################
# EXTRA CONFIGURATION OPTIONS
###################################
# You can change these to your liking. Or not.
# Defaults should be pretty sane
# WARN_ON_RAM_CLEAR
# Shows a warning message and prompt before running 'ram clear' command
WARN_ON_RAM_CLEAR=true
# WARN_ON_CONSOLE_ATTACH
# Shows a warning message and prompt before attaching to tmux session
WARN_ON_CONSOLE_ATTACH=true
# LOGARCMAX
# Maximum amount of log archives to retain in LOGDIR
# Set 0 for no limit
LOGARCMAX=10
# WLDARCMAX
# Maximum amount of world storage archives to retain in WLDBK
# Set 0 for no limit
WLDARCMAX=10
# PLGARCMAX
# Maximum amount of plugin folder archives to retain in PLGBK
# Set 0 for no limit
PLGARCMAX=10
# SRVARCMAX
# Maximum amount of main server file arvhies to retain in SRVBK
# Set 0 for no limit
SRVARCMAX=10
# SESSION
# Name of the tmux session in which the server will be run
SESSION='minecraft'
###################################
# ADVANCED CONFIGURATION OPTIONS
###################################
# These should not be touched unless you know exactly what you're changing, exactly why you're changing it, and exactly what that change will accomplish
# Script is tested only with defaults; changing any of these defaults may render your setup unsupportable
# JAVAEXEC
# Path to java executable
JAVAEXEC='/usr/bin/java'
# TMUXEXEC
# Path to tmux executable
TMUXEXEC='/usr/bin/tmux'
# RSYNCEXEC
# Path to rsync executable
RSYNCEXEC='/usr/bin/rsync'
# RAMDISK
# Path to system ramdisk
RAMDISK='/dev/shm'
###################################
# ADVANCED JVM TUNING
###################################
# Garbage collection and logging optios for the JVM
# aka AdvancedConfiguration++
# If you didn't get that [lame] joke, you shouldn't even be looking at this section.
# DEFPARAMS
# Default parameters. Should not be removed/altered
DEFPARAMS="-XX:+UseCompressedOops \
-Xmx${MAXMEM} \
-Xms${INITMEM}"
# GC
# Garbage Collector. Pick one between serial, parallell, concurrent, or g1. Leave blank for JVM defau;t
GC='concurrent'
# Set Garbage Collection params based on GC choice
#########################################################
# PREPROCESSING SWITCH #
# DO NOT ALTER THESE LINES UNLESS YOU INTEND #
# TO FULLY RE-WRITE THE JVM-CONFIGURATION SECTION #
#########################################################
shopt -s nocasematch
case $GC in
serial)
GCPARAMS="-XX:+UseSerialGC"
;;
parallel)
GCPARAMS="-XX:+UserParallelGC -XX:ParallelGCThreads=${CPU_CORES}"
;;
concurrent)
GCPARAMS="-XX:+UseConcMarkSweepGC -XX:ConcGCThreads=${CPU_CORES}"
;;
g1)
GCPARAMS="-XX:+UseG1GC -XX:ConcGCThreads=${CPU_CORES}"
;;
*)
GCPARAMS=''
;;
esac
shopt -u nocasematch
#########################################################
# #
# END PREPROCESSING SWITCH #
# #
#########################################################
# LOGGC
# Enable or disable logging of garbage collection
LOGGC=false
# Set GC logging parameters
if ${LOGGC}
then
# GCLOGFILE
# Filename of garbage collection log, if enabled
GCLOGFILE=jvm_gc.log
# GCLOGPARAMS
# Command line parameters for logging garbage collection
GCLOGPARAMS="-Xloggc:${GCLOGFILE} \
-verbose:gc \
-XX:+PrintTenuringDistribution \
-XX:+PrintGCDetails \
-XX:+PrintGCDateStamps"
# If GC logging disabled, set null logging params
else
GCLOGPARAMS=''
GCLOGFILE=''
fi
# APPEND
# Any additional JVM parameters tp be used in invocation should go here
APPEND='-XX:InitiatingHeapOccupancyPercent=0'
# INVOCATION
# Java command with which the server is invoked
INVOCATION="${JAVAEXEC} ${DEFPARAMS} ${GCPARAMS} ${GCLOGPARAMS} -jar ${MCJAR} nogui"