Error running test command in veins_hetvnet - omnet++

I am using Instant Veins 5.0-alpha2 i1. When executing the test procedure on veins_hetvnet, the following error is shown:
veins:~/src/veins_hetvnet/examples/veins_hetvnet% ./run -d -u Cmdenv | grep "HetVNetDemoApp::handleMessage"
./run: 25: exec: ../../run: not found
zsh: exit 127 ./run -d -u cmdenv |
zsh: exit 1 grep --color=auto "HetVNetDemoApp::handleMessage"
Error figure

Related

Bash, Systemd Service, command substitution - Not playing well together

I have the following in my redis#.service file:
...
ExecStop=/bin/bash -c \"/usr/local/bin/redis-cli -p $(echo %i | awk -F \'.\' \'{ print $2 }\') shutdown\"
...
Then when I run:
sudo systemctl stop redis#redis.6379.test-site.com.service
Followed by:
sudo systemctl status redis#redis.6379.test-site.com.service
I get:
...
Process: 10042 ExecStop=/bin/bash -c "/usr/local/bin/redis-cli -p $(echo redis.6379.test-site.com | awk -F '.' '{ print $2 }') shutdown" (code=exited, status=1/FAILURE)
...
Sep 10 17:36:53 hostname bash[10042]: -p: -c: line 0: unexpected EOF while looking for matching `"'
Sep 10 17:36:53 hostname bash[10042]: -p: -c: line 1: syntax error: unexpected end of file
Then if I run:
sudo systemctl start redis#redis.6379.test-site.com.service
Followed by (taken from the systemctl status output):
/bin/bash -c "/usr/local/bin/redis-cli -p $(echo redis.6379.test-site.com | awk -F '.' '{ print $2 }') shutdown"
Then the command works as expected...
Can anyone shed some light as to what's happening here?
If Systemd is just running the command shown for ExecStop, and that command works just fine when run manually, shouldn't it also work when systemd runs it?
I have a feeling it's something to do with the quoting, but I'm too much of a newb at bash to wrap my head around it.

Bracket issue in snakemake cluster command

I am using snakemake 4.0.0 on aws cfncluster with the following commands.
rule fastq_to_counts:
input: fastql="/shared/dbGAP/sras2/fastq.gz/{sample}_1.fastq.gz", fastqr="/shared/dbGAP/sras2/fastq.gz/{sample}_2.fastq.gz"
output: "/shared/counts/{sample}"
shell: '/shared/packages/sailfish-master/bin/sailfish quant -i /shared/packages/gencode26/gencode26 -l IU -p 1 -1 <(zcat {input.fastql}) -2 <(zcat {input.fastqr}) --output {output}'
It runs fine on the head node but when I submit to head node i get the following error.
/shared/packages/sailfish-master/bin/sailfish quant -i /shared/packages/gencode26/gencode26 -l IU -p 1 -1 <(zcat /shared/dbGAP/sras2/fastq.gz/xxx.fastq.gz) -2 <(zcat /shared/dbGAP/sras2/fastq.gz/xxx.fastq.gz) --output /shared/counts/SRR1075530
/bin/sh: 1: Syntax error: "(" unexpected
Error in job fastq_to_counts while creating output file /shared/counts/xxx.
RuleException:
The issue is that the "sh" command does not support "bashism" of the "("
is there any way to force snakemake to use /bin/bash ?
Thanks
found that the solution is adding the following to snakefile
shell.executable('bash')

Unable to run shell command with docker?

I have installed docker on Ubuntu 14.04. Now when i am trying to create one test job in docker, i am getting the below error:
$ sample_job=$(docker run -d busybox /bin/sh -c “while true; do echo
Docker; sleep 1; done”)
-bash: command substitution: line 228: syntax error near unexpected token `do'
-bash: command substitution: line 228: `docker run -d busybox /bin/sh -c “while true; do echo Docker; sleep 1; done”)'
I am following the below blog for starting with docker: http://blog.flux7.com/blogs/docker/docker-tutorial-series-part-2-the-15-commands
Could someone help me in resolving this issue.
Thanks!!
Credit goes to Cyrus:
Replaced “ by "
$ sample_job=$(docker run -d busybox /bin/sh -c "while true; do echo
Docker; sleep 1; done")

Killing Process on Remote Host using Fabric

I am writing a script using Fabric which needs to terminate a process remotely.
(this means that the command ends up getting executed as /bin/bash command)
The current code I have is the following:
in a kill.sh file i have
/bin/kill $(ps -ef | grep multiserver.jar | grep -v bin/sh | grep -v /bin/bash | grep -v sh | grep python | grep -v /usr/bin/java | grep -v /usr/bin/python | grep -v sh | awk '{print $2}')
which I run in Fabric on my remote host using the following commands
local("scp " + "kill.sh " + user +"#" + server_address + ":" + directory)
run ("chmod u+x kill.sh")
run("./kill.sh")
However I get the following error message
out: Usage:
[] out: kill [options] <pid> [...]
Fatal error: run() received nonzero return code 1 while executing!
Requested: ./kill.sh
Executed: /bin/bash -l -c "cd ... && ./kill.sh"
Does anyone know what I am doing wrong?
While solving this issue with reading logs with fabric, I wrote command to kill remote processes:
with settings(warn_only=True):
sudo("kill -9 `ps aux | <pipeline of greps> | awk '{print $2}'`")
Hope this helps.

Bash command substution error

The code:
`cat <(fgrep -i -v "$DAEMON_TEST" <(sudo -u asm crontab -l)) <(echo "$CRON") | sudo -u asm crontab -`
The error:
command substitution: line 46: syntax error near unexpected token `('
/etc/init.d/asm: command substitution: line 46: `cat <(fgrep -i -v "$DAEMON_TEST" <(sudo -u asm crontab -l)) <(echo "$CRON") | sudo -u asm crontab -'
The command runs fine when run directly into the shell by replacing the variables with the relevant strings
Here are the variables:
DAEMON_TEST=asm_test.php
CRON="*/15 * * * * /opt/asm/daemons/test.php"
The issue ended up being completely unrelated.
Changed:
#/bin/sh
to:
#/bin/bash
I never realized there would be a differnce
https://superuser.com/questions/125728/what-is-the-difference-between-bash-and-sh

Resources