Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion install-iccr.bash
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ if [ "${hasJava}" = "0" -o "${hasRightJava}" = "0" ]; then
echo
if [ "${doesApt}" = "1" ]; then
if [ "${doWhat}" = "install" ]; then
echo Setting cronjobs
sudo systemctl enable cron
sudo service cron start
crontab -r
echo "sudo apt-get -y update"
sudo apt-get -y update
echo
Expand Down Expand Up @@ -296,7 +300,6 @@ if [ "${mac}" = "1" ]; then
else
sed -i "s/^${iccrApiKeyProp}=.*$/${iccrApiKeyProp}=${pwd}/g" $iccrPropFile
fi

echo
echo Done
echo
Expand Down
24 changes: 23 additions & 1 deletion installer/iccr-scripts/src/main/scripts/iccr-ctl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ cd $ICCR_DIR
loglevel=
nossl=
preferIPv4Flag=
cronICCR="@reboot $ICCR_BIN_DIR/iccr-ctl $@ 2>&1"
cronIOTA="@reboot $ICCR_BIN_DIR/startiota.bash"
for arg in "$@"; do
if [ "${arg}" = "debug" ]; then
loglevel=debug
Expand All @@ -39,7 +41,6 @@ for arg in "$@"; do
if [ "${arg}" = "ipv4" ]; then
preferIPv4Flag="-Djava.net.preferIPv4Stack=true"
fi

done

stop() {
Expand Down Expand Up @@ -70,6 +71,27 @@ stop() {
}

start() {
iccrOnBoot=`grep startICCROnBoot ${ICCR_DIR}/conf/iccr.properties | sed -e 's/startICCROnBoot=//g'`
iotaOnBoot=`grep startIotaOnBoot ${ICCR_DIR}/conf/iccr.properties | sed -e 's/startIotaOnBoot=//g'`

if [ "$iotaOnBoot" = true ] ; then
echo "Creating cron job for start iota"
if crontab -l | grep -q "$cronIOTA"; then
echo "crontab already exists... Ignoring"
else
crontab -l | { cat; echo "$cronIOTA"; } | crontab -
fi
fi

if [ "$iccrOnBoot" = true ] ; then
echo "Creating cron job iccr"
if crontab -l | grep -q "$cronICCR"; then
echo "crontab already exists... Ignoring"
else
crontab -l | { cat; echo "$cronICCR"; } | crontab -
fi
fi

echo Starting $WHAT_APP
# Are we already running?
if [ -f $ICCR_PID_FILE ]; then
Expand Down
2 changes: 0 additions & 2 deletions installer/iccr-scripts/src/main/scripts/startiota.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ iotaPidFile=$iotaDir/iota.pid

cd $iotaDir

startCmd="nohup ${iotaStartCmd} ${iotaPortNumber} > console.log 2>&1 &"
echo "${startCmd}"
nohup ${iotaStartCmd} ${iotaPortNumber} > console.log 2>&1 &

statusCode=$?
Expand Down
6 changes: 6 additions & 0 deletions installer/property-files/src/main/resources/iccr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ iotaDir=/opt/iota
iotaStartCmd=java -jar IRI.jar --dns-resolution-false -p
iotaPortNumber=14265

#onboot

startICCROnBoot=true

startIotaOnBoot=true

# Time in minutes:
iotaNeighborRefreshTime=10
iotaActivityGranularity=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ public Response getIotaNbrsConfig(HttpServletRequest request) {

@Override
public Response getIotaNeighbors(HttpServletRequest request, IccrPropertyListDto actionProps) {
delegate.startNeighborRefresh();
delegate.startActivityRefresh();
return doIotaAction(request, ActionFactory.NEIGHBORS, actionProps);
}

Expand Down