Delay in wayland socket access - startup

I am working on a project where I want to use Weston and a wayland client(myapp) trying to connect to it right after Weston is started on startup.
Below are few lines from my startup script.
export XDG_RUNTIME_DIR=/tmp/mydir
/weston &
/myapp &
I have set the env variable "XDG_RUNTIME_DIR=/tmp/mydir" properly. The weston and the wayland client both as access to the path set in 'XDG_RUNTIME_DIR'.
So the weston creates the socket as "PATH/wayland-0". But the client trying to connect to this fails with error "No such file or directory".
Following this https://unix.stackexchange.com/a/539011/514997 I tried to add sleep of 2 between client(myapp) start and weston launch, it works fine.
My question is:
Why is this sleep required at all? I know the socket file is not available by the time the client is trying to connect to it. But is this normal with Weston and wayland client?
How much time does it take to create the socket file?
Is there any better solution than using sleep.
PS: Same issue observed with QT application which uses wayland.

Related

Why it is necessary to restart every service in jitsi if some changes made to prosody?

I'm using docker setup and whenever I made any changes to prosody then I have to remove the previous config of jicofo and jvb and then need to restart both the services. If I don't restart then jicofo started showing error like unable to connect to xmpp.meet.jitsi. Is is possible to fix this? Please help.

kafka connect in distributed mode is not generating logs specified via log4j properties

I have been using Kafka Connect in my work setup for a while now and it works perfectly fine.
Recently I thought of dabbling with few connectors of my own in my docker based kafka cluser with just one broker (ubuntu:18.04 with kafka installed) and a separate node acting as client for deploying connector apps.
Here is the problem:
Once my broker is up and running, I login to the client node (with no broker running,just the vanilla kafka installation), i setup the class path to point to my connector libraries. Also the KAFKA_LOG4J_OPTS environment variable to point to the location of log file to generate with debug mode enabled.
So every time i start the kafka worker using command:
nohup /opt//bin/connect-distributed /opt//config/connect-distributed.properties > /dev/null 2>&1 &
the connector starts running, but I don't see the log file getting generated.
I have tried several changes but nothing works out.
QUESTIONS:
Does this mean that connect-distributed.sh doesn't generate the log file after reading the variable
KAFKA_LOG4J_OPTS? and if it does, could someone explain how?
NOTE:
(I have already debugged the connect-distributed.sh script and tried the options where daemon mode is included and not included, by default if KAFKA_LOG4J_OPTS is not provided, it uses the connect-log4j.properties file in config directory, but even then no log file is getting generated).
OBSERVATION:
Only when I start zookeeper/broker on the client node, then provided KAFKA_LOG4J_OPTS value is picked and logs start getting generated but nothing related to the Kafka connector. I have already verified the connectivity b/w the client and the broker using kafkacat
The interesting part is:
The same process i follow in my workpalce and logs start getting generated every time the worker (connnect-distributed.sh) is started, but I haven't' been to replicate the behaviors in my own setup). And I have no clue what I am missing here.
Could someone provide some reasoning, this is really driving me mad.

Orleans: "Running in a Stand Alone Silo" example does not run

I have just started to get myself familiar with Orleans for a project. I have some questions regarding that. I am currently using the Step by Step Tutorial. Unfortunately when I try to run the example with "Running in a Stand-Alone Silo" in my laptop, the Grains collection fails with lots of exceptions. I am not sure how to troubleshoot that?
The document mentions "OrleansHost.exe is a ready-made host executable intended for running Orleans code on Windows Server (Azure has a different host)". I am not sure what this means? Is this the reason why it does not work on my laptop which has Windows 10 running?
From your logs, it looks like you're still connecting to the gateway by port 4000, the default one. Have you tried specifying your client to use the same port as your server? The example uses port 3000:
var config = Orleans.Runtime.Configuration.ClientConfiguration.LocalhostSilo(30000);

Python Flask server add another port to domain

Initial Condition:
I have a Python Flask server running on a remote machine that I am accessing via Linux(OpenSuse) command line. The server works perfect. It renders the html for xyz.com:5000.
Problem:
I am a new user added. I want the server to read my .py files.
What do I do? Do I need a new port number?
Or will it be xyz.myusername.com:5000?
What configurations do I have to change?
Does the superuser need to intervene?
Thanks!
Flask's built-in server is not intended for production use - or at least, the documentation refers to it as a "local development server".
For production, something like Tornado, gunicorn, or even Apache is what you'll need to be using.
See also: Flask documentation covering the Flask.run() method.
That said - it's just a Python program. There's no reason you couldn't run your own on a different port via app.run(port=5001).
Can you be a bit more specific about your issue? What do you mean by 'you are a new user added' - what user, where added? What do you mean by 'the server to read your .py files' - server as the remote machine you're referring to, or server as Flask http dev server, or something else? Without precise description of your environment (OS type for example), what you want to achieve (instead asking should you do X or Y) and what problem you're ecountering (not knowing how your software, like Flask works is not actual problem) we wont be able to help you.

Unable to run Selenium RC server as windows service

I have followed this link to run Selenium Server as a windows service: http://www.claytonstechnobabble.com/2011/08/run-any-application-as-windows-service.html
The service gets installed successfully but when I try to run it it gives error:
"The SeleniumRC service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs."
can you guys help me on that asap? what am I missing?
This is the selenium server file that I am trying to run: "selenium-server-standalone-2.5.0.jar"
Ali, you might try capturing the output from the service. Since the Java app is designed to be run in console mode, there is likely to be some useful explanation if you can capture std out and std err. Running the service with a wrapper like Java Service Launcher will provide that functionality to log the error information: http://jslwin.sourceforge.net/
Create a bat file containing
//cd Location of file
java -jar selenium-server-standalone-2.5.0.jar
then use this bat file to execute in service.

Resources