33 lines
1.1 KiB
JSON
33 lines
1.1 KiB
JSON
{
|
|
"id": "cc9d4f34-1ca0-4a1b-8ff2-09302696acb9",
|
|
"snapshot": "os",
|
|
"instruction": "Currently, the program my_process.sh is running in the system and I want to end the process. Can you help me?",
|
|
"source": "https://stackoverflow.com/questions/9346211/how-to-kill-a-process-on-a-port-on-ubuntu",
|
|
"config": [
|
|
{
|
|
"type": "execute",
|
|
"parameters": {
|
|
"command": "echo -e '#!/bin/bash\n\nwhile true; do\necho \"Running my_process...\"\nsleep 1\ndone' > my_process.sh && chmod +x my_process.sh && nohup ./my_process.sh > /dev/null 2>&1 &",
|
|
"shell": true
|
|
}
|
|
}
|
|
],
|
|
"trajectory": "trajectories/",
|
|
"related_apps": [
|
|
"os"
|
|
],
|
|
"evaluator": {
|
|
"func": "exact_match",
|
|
"result": {
|
|
"type": "vm_command_line",
|
|
"command": "[[ -z $(ps -ef | grep -v grep | grep my_process) ]] && echo \"Process killed\" || echo \"Process still running\"",
|
|
"shell": true
|
|
},
|
|
"expected": {
|
|
"type": "rule",
|
|
"rules":{
|
|
"expected": "Process killed"
|
|
}
|
|
}
|
|
}
|
|
} |