<commit_before>#!/bin/sh

# /root/init.sh - Start container services
# "<NAME>" <<EMAIL>>

# Let user CTRL-C container boot.
trap "exit 2" 2

# Services to start on boot
services="sshd
pe-activemq
mcollective
pe-postgresql
pe-puppetdb
pe-console-services
pe-nginx
pe-puppetserver"

# Path to production modules
prodmod="/etc/puppetlabs/code/environments/production/modules"


# Bark function
yo() { echo "`date` $@"; }

Services() {
    for this in $services; do
        yo "${1} ${this}"
        /sbin/service $this $1 >> /tmp/init.log
    done
}

#
yo "Booting PupEnt container, this will take a few minutes"

Services start
#for this in $services; do
#    yo "Starting ${this}"
#    /sbin/service $this restart >> /tmp/init.log
#done

# If this is a brand new container don't daemonize,
#   run the puppet agent to apply systemic changes
#   then exit cleanly.
test -f /root/.new && {
    puppet agent -t
    rm -vf /root/.new
    Services stop
#    for this in $services; do
#        /sbin/service $this stop >> /tmp/init.log
#    done
    yo "Container creation complete!"
    yo "Use 'docker start pupedock' to launch, then ./Login.sh to log in."
    exit 0
}
yo "All Puppet services are up, container ready."

# Wait forever for the shutdown trigger file.
#   If found, exit cleanly.
while [ 1 ]; do
    sleep 1
    chown -R pe-puppet:pe-puppet $prodmod
    test -f /root/.shutdown && {
        yo "Shutdown trigger file found, stopping."
        Services stop
        exit 0
    }
done
<commit_msg>Tue Nov 10 06:46:07 MST 2015<commit_after>#!/bin/sh

# /root/init.sh - Start container services
# "<NAME>" <<EMAIL>>

# Let user CTRL-C container boot.
trap "exit 2" 2

# Services to start on boot
services="sshd
pe-activemq
mcollective
pe-postgresql
pe-puppetdb
pe-console-services
pe-nginx
pe-puppetserver"

# Path to production modules
prodmod="/etc/puppetlabs/code/environments/production/modules"


# Bark function
yo() { echo "`date` $@"; }

Services() {
    for this in $services; do
        yo "${1} ${this}"
        /sbin/service $this $1 >> /tmp/init.log
    done
}

#
yo "Booting PupEnt container, this will take a few minutes"

Services start
#for this in $services; do
#    yo "Starting ${this}"
#    /sbin/service $this restart >> /tmp/init.log
#done

# If this is a brand new container don't daemonize,
#   run the puppet agent to apply systemic changes
#   then exit cleanly.
test -f /root/.new && {
    puppet agent -t >> /tmp/init.log
    rm -vf /root/.new
    Services stop
#    for this in $services; do
#        /sbin/service $this stop >> /tmp/init.log
#    done
    yo "Container creation complete!"
    yo "Use 'docker start pupedock' to launch, then ./Login.sh to log in."
    exit 0
}
yo "All Puppet services are up, container ready."

# Wait forever for the shutdown trigger file.
#   If found, exit cleanly.
while [ 1 ]; do
    sleep 1
    chown -R pe-puppet:pe-puppet $prodmod
    test -f /root/.shutdown && {
        yo "Shutdown trigger file found, stopping."
        rm -fv /root/.shutdown
        Services stop
        exit 0
    }
done

{'fraction_non_alphanumeric': 0.11934959349593496, 'fraction_numerical': 0.009105691056910569, 'mean_word_length': 2.7420924574209247, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7077881', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1029, 'n_words': 367}