<commit_before>#! /bin/sh
### BEGIN INIT INFO
# Provides:          @oasis.service@
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: @oasis.desc@ initscript
# Description:       This file should be used to construct scripts to be
#                    placed in /etc/init.d.
### END INIT INFO

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="@oasis.desc@"
NAME="@oasis.service@"
DAEMON="@oasis.home@/@oasis.service@"
PIDFILE=/var/run/@oasis.service@.pid
SCRIPTNAME=/etc/init.d/@oasis.service@

SERVICE_USER="@oasis.user@"
SERVICE_GROUP="@oasis.group@"
CONF_DIR="/etc/@oasis.service@"
LOG_DIR="/var/log/@oasis.service@"
EXTRA_ARGS=""
JAVA_OPTS=""

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

DAEMON_ARGS="-l $CONF_DIR/log4j2.xml -c $CONF_DIR/oasis.conf $EXTRA_ARGS"

export LOG_DIR

TIMESTAMP=`date +%Y%m%d-%H%M%S`
export JAVA_OPTS="-Xloggc:$LOG_DIR/gc-$TIMESTAMP.log -XX:+PrintGCDetails -XX:+PrintTenuringDistribution $JAVA_OPTS"

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

. /lib/lsb/init-functions

VERBOSE="yes"

#
# Function that starts the daemon/service
#
do_start()
{
	# Return
	#   0 if daemon has been started
	#   1 if daemon was already running
	#   2 if daemon could not be started
	start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON \
	  -c $SERVICE_USER -g $SERVICE_GROUP --background --make-pidfile --test > /dev/null \
		|| return 1
	start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON \
		-c $SERVICE_USER -g $SERVICE_GROUP --background --make-pidfile -- $DAEMON_ARGS \
		|| return 2
}

#
# Function that stops the daemon/service
#
do_stop()
{
	# Return
	#   0 if daemon has been stopped
	#   1 if daemon was already stopped
	#   2 if daemon could not be stopped
	#   other if a failure occurred
	start-stop-daemon --stop --quiet --retry=INT/10/KILL/5 --pidfile $PIDFILE --oknodo \
		-c $SERVICE_USER -g $SERVICE_GROUP<commit_msg>Redirect stdout and stderr to files when starting daemon<commit_after>#! /bin/sh
### BEGIN INIT INFO
# Provides:          @oasis.service@
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: @oasis.desc@ initscript
# Description:       This file should be used to construct scripts to be
#                    placed in /etc/init.d.
### END INIT INFO

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="@oasis.desc@"
NAME="@oasis.service@"
DAEMON="@oasis.home@/@oasis.service@"
PIDFILE=/var/run/@oasis.service@.pid
SCRIPTNAME=/etc/init.d/@oasis.service@

SERVICE_USER="@oasis.user@"
SERVICE_GROUP="@oasis.group@"
CONF_DIR="/etc/@oasis.service@"
LOG_DIR="/var/log/@oasis.service@"
EXTRA_ARGS=""
JAVA_OPTS=""

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

DAEMON_ARGS="-l $CONF_DIR/log4j2.xml -c $CONF_DIR/oasis.conf $EXTRA_ARGS"

export LOG_DIR

TIMESTAMP=`date +%Y%m%d-%H%M%S`
export JAVA_OPTS="-Xloggc:$LOG_DIR/gc-$TIMESTAMP.log -XX:+PrintGCDetails -XX:+PrintTenuringDistribution $JAVA_OPTS"

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

. /lib/lsb/init-functions

VERBOSE="yes"

#
# Function that starts the daemon/service
#
do_start()
{
	# Return
	#   0 if daemon has been started
	#   1 if daemon was already running
	#   2 if daemon could not be started
	start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON \
	  -c $SERVICE_USER -g $SERVICE_GROUP --background --make-pidfile --test > /dev/null \
		|| return 1
	start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON \
		-c $SERVICE_USER -g $SERVICE_GROUP --background --make-pidfile --no-close \
		-- $DAEMON_ARGS >"$LOG_DIR/$NAME.stdout" 2>"$LOG_DIR/$NAME.stderr" \
		|| return 2
}

#
# Function that stops the daemon/service
#
do_stop()
{
	# Return
	#   0 if daemon has been stopped
	#   1 if daemon was already stopped
	#   2 if daemon could not be stopped
	#   other if a failure occurred
	start-stop-daemon --stop --quiet --retry=INT/10/KILL/5 --pidfile $PIDFILE --oknodo \
		-c $SERVICE_USER -g $SERVICE_GROUP
{'fraction_non_alphanumeric': 0.14426229508196722, 'fraction_numerical': 0.009398907103825137, 'mean_word_length': 3.3789473684210525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7137077', 'n_tokens_mistral': 1763, 'n_tokens_neox': 1672, 'n_words': 446}