summaryrefslogtreecommitdiffstats
path: root/meta-agl-ic-container/recipes-container/lxc/files/lxc.service
blob: acf8da39a451b2956d230269540519a76176b028 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[Unit]
Description=LXC Container Initialization and Autoboot Code
After=network.target lxc-net.service remote-fs.target drm-lease-manager.service
Wants=lxc-net.service
Documentation=man:lxc-autostart man:lxc

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=@LIBEXECDIR@/lxc/lxc-apparmor-load
ExecStart=@LIBEXECDIR@/lxc/lxc-containers start
ExecStop=@LIBEXECDIR@/lxc/lxc-containers stop
ExecReload=@LIBEXECDIR@/lxc/lxc-apparmor-load
# Environment=BOOTUP=serial
# Environment=CONSOLETYPE=serial
Delegate=yes

[Install]
WantedBy=multi-user.target
language governing permissions and # limitations under the License. ########################################################################### PORT=$1 TOKEN=$2 # Research the Api name used CFGFILE=$(find ${AFM_APP_INSTALL_DIR} -name "*json" -print | head -n1) API=$(grep '\"api\"' ${CFGFILE} | cut -d'"' -f4) AFBCLIENTIN=$(mktemp -u) AFBCLIENTOUT=$(mktemp -u) mkfifo $AFBCLIENTIN mkfifo $AFBCLIENTOUT declare -a testVerb if [[ $(jq '.testVerb|type' $CFGFILE) == "array" ]] then testVerbLength=$(jq '.testVerb | length') for (( idx=0; idx<testVerbLength; idx++ )) do testVerb[$idx]=$(jq -r ".testVerb[$idx].uid" ${CFGFILE}) done else testVerb[0]=$(jq -r ".testVerb.uid" ${CFGFILE}) fi tail -f $AFBCLIENTIN | afb-client-demo ws://localhost:${PORT}/api?token=${TOKEN} > $AFBCLIENTOUT 2>&1 & CLIENTPID=$! testVerbLength=${#testVerb[@]} for (( idx=0; idx<testVerbLength; idx++ )) do echo "$API ${testVerb[$idx]}" > $AFBCLIENTIN done while read -r line do [ "$(echo "${line}" | grep -E 'Ran [[:digit]]+ tests in')" ] && break done < $AFBCLIENTOUT rm -f $AFBCLIENTIN rm -f $AFBCLIENTOUT kill $CLIENTPID