I got an similiar problem to yours. I try to call a script from kodi menu, which opens a new virtual terminal and another sh script. Here is the problem. Each time the first script try to open the other script there comes the failure: “Cant open test.sh”
The first sh got the following content: sudo su pi -c “openvt -s -f sh sudo test.sh”; sudo systemctl stop mediacenter;
The second script Test.sh: sudo parsec server_id=XXX; sudo systemctl start mediacenter;
When i try to run both commands manual or together from ssh terminal it works fine! So I guess there is a problems with my rights or maybe i miss something at openvt?