<commit_before>#! /bin/sh
### BEGIN INIT INFO
# Provides:             barteby
# Required-Start:       $syslog $remote_fs
# Required-Stop:        $syslog $remote_fs
# Should-Start:         $local_fs
# Should-Stop:          $local_fs
# Default-Start:        2 3 4 5
# Default-Stop:         0 1 6
# Short-Description:    barteby web site
# Description:          barteby web site
### END INIT INFO


# Adapted redis init file
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/srv/barteby/barteby/cluster.js
DAEMON_ARGS=
NAME=barteby
DESC=barteby
USER=www-data
GROUP=www-data

RUNDIR=/var/run/strekmann
PIDFILE=$RUNDIR/barteby.pid
LOGFILE=/srv/barteby/server.log

test -x $DAEMON || exit 0

set -e

export NODE_ENV=production
export PORT=13443
export DB_NAME=test

case "$1" in
start)
    echo -n "Starting $DESC: "
    touch $PIDFILE
    chown $USER:$GROUP $PIDFILE
    chmod 755 $RUNDIR

    if start-stop-daemon --start --quiet --umask 007 -m --pidfile $PIDFILE --chuid $USER:$GROUP --background --exec $DAEMON >> $LOGFILE
    then
            echo "$NAME."
    else
            echo "failed"
    fi
    ;;
stop)
    echo -n "Stopping $DESC: "
    if start-stop-daemon --stop --retry forever/TERM/1 --quiet --oknodo --pidfile $PIDFILE
    then
        echo "$NAME."
    else
        echo "failed"
    fi
    rm -f $PIDFILE
    sleep 1
    ;;
restart|force-reload)
    $0 stop
    $0 start
    ;;
status)
    echo -n "$DESC is "
    if start-stop-daemon --stop --quiet --signal 0 --pidfile ${PIDFILE}
    then
            echo "running"
    else
            echo "not running"
            exit 1
    fi
    ;;

*)
    echo "Usage: $0 {start|stop|restart|force-reload|status}"
    exit 1
    ;;
esac

exit 0
<commit_msg>Create rundir if it does not exist<commit_after>#! /bin/sh
### BEGIN INIT INFO
# Provides:             barteby
# Required-Start:       $syslog $remote_fs
# Required-Stop:        $syslog $remote_fs
# Should-Start:         $local_fs
# Should-Stop:          $local_fs
# Default-Start:        2 3 4 5
# Default-Stop:         0 1 6
# Short-Description:    barteby web site
# Description:          barteby web site
### END INIT INFO


# Adapted redis init file
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/srv/barteby/barteby/cluster.js
DAEMON_ARGS=
NAME=barteby
DESC=barteby
USER=www-data
GROUP=www-data

RUNDIR=/var/run/strekmann
PIDFILE=$RUNDIR/barteby.pid
LOGFILE=/srv/barteby/server.log

test -x $DAEMON || exit 0

set -e

export NODE_ENV=production
export PORT=13443
export DB_NAME=test

case "$1" in
start)
    echo -n "Starting $DESC: "
    mkdir -p $RUNDIR
    touch $PIDFILE
    chown $USER:$GROUP $RUNDIR $PIDFILE
    chmod 755 $RUNDIR

    if start-stop-daemon --start --quiet --umask 007 -m --pidfile $PIDFILE --chuid $USER:$GROUP --background --exec $DAEMON >> $LOGFILE
    then
            echo "$NAME."
    else
            echo "failed"
    fi
    ;;
stop)
    echo -n "Stopping $DESC: "
    if start-stop-daemon --stop --retry forever/TERM/1 --quiet --oknodo --pidfile $PIDFILE
    then
        echo "$NAME."
    else
        echo "failed"
    fi
    rm -f $PIDFILE
    sleep 1
    ;;
restart|force-reload)
    $0 stop
    $0 start
    ;;
status)
    echo -n "$DESC is "
    if start-stop-daemon --stop --quiet --signal 0 --pidfile ${PIDFILE}
    then
            echo "running"
    else
            echo "not running"
            exit 1
    fi
    ;;

*)
    echo "Usage: $0 {start|stop|restart|force-reload|status}"
    exit 1
    ;;
esac

exit 0

{'fraction_non_alphanumeric': 0.12662889518413598, 'fraction_numerical': 0.01643059490084986, 'mean_word_length': 2.1810810810810812, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, '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': '5130282', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1258, 'n_words': 340}