I wrote a script that, after starting the OS, depending on some data, starts or kills a graphics program. The graphic server is also started from this script, but after starting the server, the specified program does not start on the graph, but all inputs and outputs from the / dev / ttyS3 port are performed. Here is the script:
#!/bin/bash startx & sleep 4 stty -F /dev/ttyS3 raw ispeed 9600 ospeed 9600 -ignpar cs8 -cstopb -echo pid=0 control=0 info=0 pid=`ps -e | grep squeakvm | awk '{print $1}'` if (( ${#pid} > 3 )) then kill $pid fi echo "35" > /dev/ttyS3 while true do pid=`ps -e | grep squeakvm | awk '{print $1}'` info=`head -c1 /dev/ttyS3` if [ "$info" == "a" ];then #echo "a" > /dev/ttyS3 if (( ${#pid} > 3 ));then kill $pid echo $pid echo "28" > /dev/ttyS3 sleep 1 echo "35" > /dev/ttyS3 else echo "46" > /dev/ttyS3 sleep 1 echo "17" > /dev/ttyS3 squeakvm /root/squeakvm/default.sb & fi fi if [ "$info" == "b" ];then #echo "b" > /dev/ttyS3 echo "37" > /dev/ttyS3 poweroff exit 0 fi done exit 0 But if you start the Graphic server separately, and then run the script in the terminal there, then everything works, but I need to automatically start everything to start. The script runs from /etc/rc.local
OS - Linux Debian
Kernel Version 3.2
Graphic Environment - X Window System
man startx:startx x-ΠΊΠ»ΠΈΠ΅Π½Ρ ΠΎΠΏΡΠΈΠΈ-Π΄Π»Ρ-x-ΠΊΠ»ΠΈΠ΅Π½ΡΠ°. for example:startx xterm ΠΎΠΏΡΠΈΠΈ-Π΄Π»Ρ-xterm- aleksandr barakin0already taken, so you need to transfer a new number to a new instance, for example,1:startx x-ΠΊΠ»ΠΈΠ΅Π½Ρ ΠΎΠΏΡΠΈΠΈ-Π΄Π»Ρ-x-ΠΊΠ»ΠΈΠ΅Π½ΡΠ° -- :1- aleksandr barakin