summarylogtreecommitdiffstats
path: root/wrapper.config
blob: fe1889c4fc42c0f5f1ac780e7f767f7047c38a25 (plain)
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
#encoding=UTF-8
#********************************************************************
# Wrapper Properties
#********************************************************************
# Java Application
wrapper.working.dir=/opt/freenet
wrapper.java.command=/usr/lib/jvm/default/bin/java

# Java Main class.  This class must implement the WrapperListener interface
#  or guarantee that the WrapperManager class is initialized.
wrapper.java.mainclass=freenet.node.NodeStarter

# Java Classpath (include wrapper.jar)  Add class path elements as
#  needed starting from 1
# Be sure there are no other duplicate classes.
wrapper.java.classpath.1=/opt/freenet/lib/*.jar
wrapper.java.classpath.2=/usr/share/java/wrapper.jar

# Java Library Path (location of libwrapper.so)
wrapper.java.library.path.1=/usr/lib/java-service-wrapper

# Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit mode.
wrapper.java.additional.auto_bits=TRUE

wrapper.java.additional.1=-Dnetworkaddress.cache.ttl=360
wrapper.java.additional.2=-Dnetworkaddress.cache.negative.ttl=10

# Required for JNA 5
wrapper.java.additional.3=-Djna.nosys=false

# Use nss for crypto operations
wrapper.java.additional.4=-Dfreenet.jce.use.NSS=true

# Location used to hold temporary files.
wrapper.java.additional.5=-Djava.io.tmpdir=/opt/freenet/tmp

# Open internal modules (required for Java 17)
wrapper.java.additional.6=--add-opens=java.base/java.io=ALL-UNNAMED
wrapper.java.additional.7=--add-opens=java.base/java.lang=ALL-UNNAMED
wrapper.java.additional.9=--add-opens=java.base/java.util=ALL-UNNAMED

# Maximum Thread Stack Size
wrapper.java.additional.10=-Xss256k

# Maximum Heap Size (in MB)
wrapper.java.maxmemory=768
#wrapper.java.maxmemory.percent=50

# Application parameters. Add parameters as needed starting from 1
wrapper.app.parameter.1=/opt/freenet/conf/freenet.ini

#********************************************************************
# Wrapper Logging Properties
#********************************************************************
# Enables Debug output from the Wrapper.
#wrapper.debug=TRUE

# Format of output for the console.  (See docs for formats)
wrapper.console.format=PM

# Log Level for console output.  (See docs for log levels)
# https://wrapper.tanukisoftware.com/doc/english/prop-console-loglevel.html
wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.
# You may wish to change this or set to empty to disable
wrapper.logfile=/opt/freenet/wrapper.log

# Format of output for the log file.
# The format consists of the tokens 'L' for log level, 'P' for prefix, 'D' for thread,
# 'T' for time, 'Z' for millisecond time, and 'M' for message
# Unfortunately the log timezone cannot be changed, see
# http://www.nabble.com/Log-message-timezone-td23651317.html
wrapper.logfile.format=LPTM

# Log Level for log file output.  (See docs for log levels)
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
#  the log is rolled. Size is specified in bytes.  The default value
#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=2m

# Maximum number of rolled log files which will be allowed before old
#  files are deleted.  The default value of 0 implies no limit.
wrapper.logfile.maxfiles=3

# Log Level for sys/event log output.  (See docs for log levels)
wrapper.syslog.loglevel=NONE

# these will shut down or crash the JVM
wrapper.signal.mode.usr1=RESTART
wrapper.signal.mode.usr2=IGNORE

# choose what to do if the JVM kills itself based on the exit code
wrapper.on_exit.default=SHUTDOWN
wrapper.on_exit.0=SHUTDOWN
wrapper.on_exit.1=SHUTDOWN
# OOM
wrapper.on_exit.10=RESTART
# graceful shutdown
wrapper.on_exit.2=SHUTDOWN
# hard shutdown
wrapper.on_exit.3=SHUTDOWN
# hard restart
wrapper.on_exit.4=RESTART
# hard restart
wrapper.on_exit.5=RESTART

# the router may take a few minutes to save state, etc
wrapper.jvm_exit.timeout=120

# give the OS 60s to clear all the old sockets / etc before restarting
# Let's change the default from 60 to 10 seconds and see if anyone moans..
wrapper.restart.delay=5
wrapper.restart.reload_configuration=TRUE

# The ping timeout must be at least 5 seconds longer than the value of wrapper.ping.interval.
# Extend this if you are getting 'JVM appears hung' shutdowns.
wrapper.ping.timeout=320
wrapper.ping.interval=300

# pid file for the JVM
# Directory must exist or the wrapper will fail to start.
wrapper.java.pidfile=/run/freenet/freenet.pid

#********************************************************************
# Wrapper General Properties
#********************************************************************
# Allow for the use of non-contiguous numbered properties
wrapper.ignore_sequence_gaps=TRUE

# Title to use when running as a console
wrapper.console.title=Freenet Router Service

# Set permissions used when creating files
# See http://wrapper.tanukisoftware.com/doc/english/prop-umask.html
# for a detailed explanation of these settings.
wrapper.umask=0027
wrapper.java.umask=0027
wrapper.logfile.umask=077
wrapper.max_failed_invocations=1

#********************************************************************
# Wrapper JVM Checks
#********************************************************************
# Out Of Memory detection.
wrapper.filter.trigger.1=java.lang.OutOfMemoryError
wrapper.filter.action.1=RESTART
wrapper.filter.message.1=The JVM has run out of memory.

# Request a Thread Dump in the event that the JVM does not exit when requested.
#wrapper.request_thread_dump_on_failed_jvm_exit=TRUE

#********************************************************************
# Advanced Options - https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html
#********************************************************************
# Enable the Shenandoah Garbage Collector
wrapper.java.additional.101=-XX:+UseShenandoahGC
wrapper.java.additional.102=-XX:+DisableExplicitGC

# Committing heap pages into memory helps to reduce latency hiccups
wrapper.java.additional.103=-XX:+AlwaysPreTouch

# Using large pages greatly improves performance on large heaps
# Recommended to set /sys/kernel/mm/transparent_hugepage/enabled and /sys/kernel/mm/transparent_hugepage/defrag to "madvise"
#wrapper.java.additional.104=XX:+UseTransparentHugePages