Install4j installer package does not work on Odroid mini computer - install4j

The error message is the following:
Syntax error: "elif" unexpected (expecting "then")
We changed the "elif" to "else if", to check if it is working this way, but at next try we got another error message:
Syntax error: word unexpected (expecting "do")
The installer works well on a Linux based PC.
It does not work only on Odroid mini pc.
The Odroid linux features are the following:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
NAME="Ubuntu"
VERSION="16.04.2 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.2 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
Linux odroid 3.10.104-184 #1 SMP PREEMPT Mon Feb 20 06:38:17 UTC 2017 armv7l armv7l armv7l GNU/Linux
The installer package (it is only one .sh file) starts with the folliwing lines:
#!/bin/sh
# Uncomment the following line to override the JVM search sequence
# INSTALL4J_JAVA_HOME_OVERRIDE=
# Uncomment the following line to add additional VM parameters
# INSTALL4J_ADD_VM_PARAMS=
INSTALL4J_JAVA_PREFIX=""
GREP_OPTIONS=""
read_db_entry() {
if [ -n "$INSTALL4J_NO_DB" ]; then
return 1
fi
if [ ! -f "$db_file" ]; then
return 1
fi
if [ ! -x "$java_exc" ]; then
return 1
fi
found=1
exec 7< $db_file
while read r_type r_dir r_ver_major r_ver_minor r_ver_micro r_ver_patch r_ver_vendor<&7; do
if [ "$r_type" = "JRE_VERSION" ]; then
if [ "$r_dir" = "$test_dir" ]; then
ver_major=$r_ver_major
ver_minor=$r_ver_minor
ver_micro=$r_ver_micro
ver_patch=$r_ver_patch
fi
elif [ "$r_type" = "JRE_INFO" ]; then
if [ "$r_dir" = "$test_dir" ]; then
is_openjdk=$r_ver_major
if [ "W$r_ver_minor" = "W$modification_date" ]; then
found=0
break
fi
fi
fi
done
exec 7<&-
return $found
}
create_db_entry() {
tested_jvm=true
version_output=`"$bin_dir/java" $1 -version 2>&1`
is_gcj=`expr "$version_output" : '.*gcj'`
is_openjdk=`expr "$version_output" : '.*OpenJDK'`
if [ "$is_gcj" = "0" ]; then
java_version=`expr "$version_output" : '.*"\(.*\)".*'`
ver_major=`expr "$java_version" : '\([0-9][0-9]*\).*'`
ver_minor=`expr "$java_version" : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`
ver_micro=`expr "$java_version" : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`
ver_patch=`expr "$java_version" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[\._]\([0-9][0-9]*\).*'`
fi
if [ "$ver_patch" = "" ]; then
ver_patch=0
fi
if [ -n "$INSTALL4J_NO_DB" ]; then
return
...

Related

use a `task` to export a workspace-specific environment variable: $PATH?

I have several workspaces that have unique environments.
When I load a workspace, I would like to update the linux $PATH accordingly, however, I tried the following:
### workspace.code-workspace
{
"folders": [
{
"path": "."
}
],
"settings": {},
"tasks": [
{
"command": "export $PATH=${workspaceFolder}/bin:$PATH"
}
]
}
Which fails according to:
me#pc:~/Containers/cuda_devcon/project$ ls -alvh ./bin/julia
lrwxrwxrwx 1 me me 21 Jan 29 17:38 ./bin/julia -> julia-1.6.7/bin/julia
me#pc:~/Containers/cuda_devcon/project$ which julia
me#pc:~/Containers/cuda_devcon/project$ julia
Command 'julia' not found, but can be installed with:
sudo snap install julia # version 1.8.5, or
sudo apt install julia # version 1.4.1+dfsg-1
See 'snap info julia' for additional versions.

How to customize system calls in gVisor?

I am a student and try to customize the system calls in gVisor. I have successfully compiled the gVisor on go-branch. And I have got the right message when I change the pkg/sentry/kernel/syslog.go file. Here is the result that can show I have successfully compiled the runsc (the runtime of gVisor).
sudo docker run --runtime=runsc -it ubuntu dmesg
[ 0.000000] asdf Starting gVisor...
[ 0.360765] 6666...
[ 0.529799] 5555...
[ 0.959593] iiiiii...
[ 1.343602] 7777...
[ 1.347068] 4444...
[ 1.424063] 00000...
[ 1.470641] 22222...
[ 1.858755] 99999...
[ 2.213219] 8888...
[ 2.679995] cccccc ..
[ 2.943468] asdf asdf Setting up VFS2...
[ 3.429006] Ready!
And I have noticed the package gvisor/pkg/sentry/syscalls/linux which contains all the syscalls and they are registered in file gvisor/pkg/sentry/syscalls/linux/linux64.go. However, I failed to customize the syscalls in gVisor.
Thanks very much.

CircleCI run failed on delete k8s resource

I have CircleCI setup and running fine normally, it will helps with creating deployment for me. Today I have suddenly had an issue with the step in creating the deployment due to an error related to kubernetes.
I have the config.yml followed the doc from https://circleci.com/developer/orbs/orb/circleci/kubernetes
Here is my version of setup in the config file:
version: 2.1
orbs:
kube-orb: circleci/kubernetes#1.3.0
commands:
docker-check:
steps:
- docker/check:
docker-username: MY_USERNAME
docker-password: MY_PASS
registry: $DOCKER_REGISTRY
jobs:
create-deployment:
executor: aws-eks/python3
parameters:
cluster-name:
description: Name of the EKS cluster
type: string
steps:
- checkout
# It failed on this step
- kube-orb/delete-resource:
now: true
resource-names: my-frontend-deployment
resource-types: deployments
wait: true
Below is a copy of the error log
#!/bin/bash -eo pipefail
#!/bin/bash
RESOURCE_FILE_PATH=$(eval echo "$PARAM_RESOURCE_FILE_PATH")
RESOURCE_TYPES=$(eval echo "$PARAM_RESOURCE_TYPES")
RESOURCE_NAMES=$(eval echo "$PARAM_RESOURCE_NAMES")
LABEL_SELECTOR=$(eval echo "$PARAM_LABEL_SELECTOR")
ALL=$(eval echo "$PARAM_ALL")
CASCADE=$(eval echo "$PARAM_CASCADE")
FORCE=$(eval echo "$PARAM_FORCE")
GRACE_PERIOD=$(eval echo "$PARAM_GRACE_PERIOD")
IGNORE_NOT_FOUND=$(eval echo "$PARAM_IGNORE_NOT_FOUND")
NOW=$(eval echo "$PARAM_NOW")
WAIT=$(eval echo "$PARAM_WAIT")
NAMESPACE=$(eval echo "$PARAM_NAMESPACE")
DRY_RUN=$(eval echo "$PARAM_DRY_RUN")
KUSTOMIZE=$(eval echo "$PARAM_KUSTOMIZE")
if [ -n "${RESOURCE_FILE_PATH}" ]; then
if [ "${KUSTOMIZE}" == "1" ]; then
set -- "$#" -k
else
set -- "$#" -f
fi
set -- "$#" "${RESOURCE_FILE_PATH}"
elif [ -n "${RESOURCE_TYPES}" ]; then
set -- "$#" "${RESOURCE_TYPES}"
if [ -n "${RESOURCE_NAMES}" ]; then
set -- "$#" "${RESOURCE_NAMES}"
elif [ -n "${LABEL_SELECTOR}" ]; then
set -- "$#" -l
set -- "$#" "${LABEL_SELECTOR}"
fi
fi
if [ "${ALL}" == "true" ]; then
set -- "$#" --all=true
fi
if [ "${FORCE}" == "true" ]; then
set -- "$#" --force=true
fi
if [ "${GRACE_PERIOD}" != "-1" ]; then
set -- "$#" --grace-period="${GRACE_PERIOD}"
fi
if [ "${IGNORE_NOT_FOUND}" == "true" ]; then
set -- "$#" --ignore-not-found=true
fi
if [ "${NOW}" == "true" ]; then
set -- "$#" --now=true
fi
if [ -n "${NAMESPACE}" ]; then
set -- "$#" --namespace="${NAMESPACE}"
fi
if [ -n "${DRY_RUN}" ]; then
set -- "$#" --dry-run="${DRY_RUN}"
fi
set -- "$#" --wait="${WAIT}"
set -- "$#" --cascade="${CASCADE}"
if [ "$SHOW_EKSCTL_COMMAND" == "1" ]; then
set -x
fi
kubectl delete "$#"
if [ "$SHOW_EKSCTL_COMMAND" == "1" ]; then
set +x
fi
error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
Exited with code exit status 1
CircleCI received exit code 1
Does anyone have idea what is wrong with it? Im not sure whether the issue is happening on Circle CI side or Kubernetes side.
I was facing the exact issue since yesterday morning (16 hours ago). Then taking #Gavy's advice, I simply added this in my config.yml:
steps:
- checkout
# !!! HERE !!!
- kubernetes/install-kubectl:
kubectl-version: v1.23.5
- run:
And now it works. Hope it helps.

How to setup powerline-go in vscode running in WSL2 (Ubuntu)

These are the contents of my ~/.vscode-server/server-env-setup
function _update_ps1() {
PS1="$($GOPATH/bin/powerline-go -error $?)"
}
if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi
... gives this error
[2019-12-10 13:49:39.763] /mnt/c/Users/cber/.vscode/extensions/ms-vscode-remote.remote-wsl-0.40.3/scripts/wslServer.sh: 1: /home/cber/.vscode-server/server-env-setup: Syntax error: "(" unexpected
[2019-12-10 13:49:39.805] VS Code Server for WSL closed unexpectedly.
UPDATE
This version (stripped of windows line endings) does not produce any errors, but unfortunately also does not display anything in the prompt in a git repo:
GOPATH=$HOME/go
_update_ps1() {
PS1="$($GOPATH/bin/powerline-go -error $?)"
}
if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi

chef service start_command not working

I'm trying to launch a node process as a service using forever, but the configuration is not working correctly. What's wrong with it?
execute "npm install -g forever"
restart_command_string = "forever restart /#{studio_server_folder}/#{studio_server_script}"
reload_command_string = "forever restart /#{studio_server_folder}/#{studio_server_script}"
start_command_string = "forever start /#{studio_server_folder}/#{studio_server_script}"
stop_command_string = "forever stop /#{studio_server_folder}/#{studio_server_script}"
status_command_string = "if [ $(forever list | grep -c \"studio-server\") -gt 0 ]; then echo 1; else echo 0; fi"
# execute "if [ $(forever list | grep -c \"studio-server\") -gt 0 ]; then #{restart_command_string}; else #{start_command}; fi"
service 'studio-server' do
supports :status => true, :restart => true, :reload => true
start_command start_command_string
reload_command reload_command_string
stop_command stop_command_string
status_command status_command_string
restart_command restart_command_string
action [:start]
end
execute 'service --status-all >> /servicestatus'
That status command isn't a command, it is a fragment of bash script and thus is unlikely to be working. In general I would highly recommend using a real service manager like supervisord or systemd.