Open leandrosardi opened 2 years ago
I have some servers running Ubuntu Desktop 18.04.
I need to automated this process:
Using the GUI is mandatory, because such processes are RPAs running some desktop APPs.
Instead of accessing servers via RDP one by one, and running the processes manually, I want to code some script to do it.
My script is a Ruby script and it looks like this:
display = host.ssh.exec!("ps -ef |grep Xauthor | grep -v grep | nawk '{print $9}'").strip s = "DISPLAY=#{display};export DISPLAY;/bin/bash --login -c \"xterm -e bash -c 'cd /home/bots/code/tempora;./shm.rb;bash'\" >/dev/null 2>&1 &"
The script above works fine if I previously accessed the server via RDP.
But If I run the script just after rebooted the server, it doesn't work.
I researched a bit, and I noticed that I can't get the display value if I didn't accessed the server via RDP previously. Here is the proof:
display
I tried to run the command xhost +, but I am getting this error message: xhost: unable to open display ""
xhost +
xhost: unable to open display ""
This issue is related with #295.
I posted a question in StackOverflow: https://stackoverflow.com/questions/72265226/cant-run-xterm-terminals-on-ubuntu-desktop-via-ssh-just-after-reboot-server
I have some servers running Ubuntu Desktop 18.04.
I need to automated this process:
Using the GUI is mandatory, because such processes are RPAs running some desktop APPs.
Instead of accessing servers via RDP one by one, and running the processes manually, I want to code some script to do it.
My Script
My script is a Ruby script and it looks like this:
The Problem
The script above works fine if I previously accessed the server via RDP.
But If I run the script just after rebooted the server, it doesn't work.
I researched a bit, and I noticed that I can't get the![image](https://user-images.githubusercontent.com/55877846/168675688-e4d4bac5-5360-4cbd-8a10-42157f5d693c.png)
display
value if I didn't accessed the server via RDP previously. Here is the proof:I tried to run the command![image](https://user-images.githubusercontent.com/55877846/168675811-b9d8ae82-5fc8-4a0c-9442-12ec863492c9.png)
xhost +
, but I am getting this error message:xhost: unable to open display ""
Additional Notes
This issue is related with #295.