Seeing screen Error Messages Which Appear Whilst Not On screen - gnu-screen

I am using the "screen" tool to run a Node.js API on a server.
I can get the API running so it is active for all to see but it crashes occasionally and it always happens when the screen session is no long open and therefore I don't know why the API has crashed.
Is there a way to see the error messages related to why my API crashed when I go back to that screen session later?
I have tried ctrl+a H to get a log but that didn't work.

Did you try to start screen with the -L flag? It will start logging the contents to a log file.
If this does not capture the errors, you can try to use tee for logging them in bash as described in echo to stderr and tee to log file?

Related

Chromium on startup behavior is different that launching it manually

I have a Jetson Nano that runs LXDE. After booting it should automatically start Chromium in kiosk mode and launch a web page. The web page is very simple, just adding and removing some rectangles or images based on web socket messages.
Since sometimes the DOM gets updated, sometimes not, I thought my web page has some bug. But this behavior is only on the Jetson Nano. Furthermore, when I launch the Chromium manually with the exact same parameters, I have no problem at all, everything runs as expected.
I also observed that the Chromium (the autostarted one) instantly updates the DOM correctly when I press Alt+Tab (since it is the only application, no application is really switched). So apparently nothing has happened since the last web socket message, I just press Alt+Tab, and the web page instantly is displaying the correct things. Additionally it is very difficult to bring up the developer console, pressing ctrl+shift+i for several minutes, when you are lucky it fires up the developer console. Once it is there, the web page is again working normally.
I have no idea what I can do about it. I just want to launch the Chrome so it behavior is like when I start it normally.
Currently, the autostart is done inside ~/.config/lxsession/LXDE/autostart with the line #/home/agx/dev/autostart/chromium.sh, this file is:
#!/bin/bash
sleep 60
chromium-browser --new-window --password-store=basic -kiosk --js-flags='--jitless' http://192.168.1.50/index.html
I tried to delay the start hoping it would help but it changed nothing. Same for jitless. I can execute exact this command manually in the console, chromium fires up and behaves normally.
How can I trace this one down?

How to clear logs on WebLogic Server console without turning off server?

I am trying to clear Web logic server console logs, to check latest logs without turning off server.
I have tried to clear logs by pressing "Ctrl+C" on console, but not working and logs was not cleared from console.
In case you are using Mac, use cmd + k to clear the logs and check the latest ones.
I would say you should not run Weblogic using the Command Prompt because if someone closes the console the service is going to crash. With this in mind, you should configure the your servers as service on Windows so please read this document.
https://docs.oracle.com/cd/E23943_01/web.1111/e13708/winservice.htm#START144
The Dude

Reconnect to Google Cloud Platform Terminal

I am running a python machine learning script on google cloud platform. I have connected through SSH in browser. When I run the code it works, but when I close the browser it seems to stop running.
I believe I can make it run in the background with nohup, but I want to be able to check back in on it as it prints outputs on its progress.
Basically I want to be able to start the script, close the terminal and then reconnect from any machine to check on its progress. Any help would be really appreciated.
I am new to google cloud platform if any of this was unclear please as an ill try providing more detail.
You may use an app called as screen. Just install it using `sudo apt-get install screen`` (if debian, ubuntu).
In some cases it might be already installed in your instance, you may check it.
Once installed enter the following command into the terminal:
screen
and press enter. Now, You may start with your job in terminal.
The moment you need to disconnect you may press Ctrl+A and then d.
The session would be disconnected. You may note the session id that would be displayed (eg. detached from 1498.pts-1.server)
You may now close the terminal.
When you come back, use the following command to get back into the older session.
screen -r *screen_id* (eg. screen -r **1498.pts-1.server**)
This process is checked for google cloud, ssh through browser, it really works.
Check this site for mode details.
It sounds like you're referring to the Google Cloud Shell feature. If so then what you desire is not possible, the cloud shell is not intended for non-interactive operation. From Usage limits:
Cloud Shell is intended for interactive use only. Non-interactive
sessions will be ended automatically after a warning.
The cloud shell operates on a temporary Compute Engine virtual machine, which is running only while the cloud shell session is active in the browser.
Apart from the obvious approach of keeping the browser session active while your application is running, you could also provision yourself a non-temporary Compute Engine instance (a free one is available), to which you can connect and on which you can run non-interactive applications as you desire.

Should I run Jenkins by command line instead of as a service?

I have been running Jenkins as a service on EC2 for a while. The problem is that since it's being run as a service, the chrome browser size is smaller than what we need. We are now running it using command line (not as a service) so it has a bigger browser size now. The only issue that I've observed so far was that the performance decreased. It took 1:30h for a 50mins jobs.
Should I keep running it using command line? Any other concerns that I need to worry about? (except the performance issue) Thank you.
Try below steps, might help you out
Stop the service (Jenkins.exe)
Right Click >> Properties >> Log On TAB >> Local System Account >> Check Allow service to interact with Desktop
then it will take the resolution of the monitor you currently use.
Make sure you put browser.driver.manage().window().maximize(); in your script.
Let me know if this does not works out.

Logging the output of VBoxHeadless

I want to be able to launch a VM in headless mode and log the outputs of its tty to the command line.
Basically I have a situation where the VM will be launched remotely (hence the command line requirement), but every once and a while, the VM's bootup sequence freezes, and right now there's no way for me to debug why the VM is not booting up properly unless I go there manually and view it in a non-headless mode.
The VM itself does not have a GUI, it just boots into TTY mode.
So is there anyway I can get some debugging output from the TTY while it's headless?
One crazy idea would be using non-headless mode and taking screenshots of the window that opens, but there must be a better way!
You can use the following command to output a PNG file of the current screen, even in headless mode:
vboxmanage controlvm [vmname] screenshotpng screen.png
I am trying to get some integration testing for bootstrapped virtualboxes up and running and ran into the exact same problem. After finding out that VRDP is a dead end, because RDP cannot send text but only bitmaps, I remembered that some cloud providers require grub to output to ttyS0.
What is ttyS0 you ask? It's the serial console of course :-)
Here's how to configure Debian to output to serial console
VirtualBox allows you to redirect the serial port into either a file or a pipe, meaning you should be able to get all the information you desire by simply reading the specified filepath.