OSGi headless deployment on Linux - eclipse

I've developed a OSGi application on my windows machine that is just lovely. How ever I need it to run on my Linux server and this is where I run into problems.
My application has no GUI. It simple works with a console and is command line driven.
My first attempt at deployment I built a product based on my existing run target. It exported fine to a Windows .exe so I added the required delta packs for Linux. The problem with this is it has only two options Linux (GTK) and Linux (MOTIF). My linux server runs on CentOS with no GUI as it is a hosted machine so when I try and deploy it I get a segmentation fault.
I have been searching around as to what to do but I'm not coming up with any answers.
Any help would be much appreciated. I have been banging my head on this one for over a week
Cheers

The google keyword you need is 'xvfb' - it acts like an X server, but ignores everything sent to it, so you don't need any graphics hardware. Try firing that up (make sure you set DISPLAY appropriately).
A cleaner solution would be to figure out why the library is demanding an X server if it works without - perhaps you could update the question with more details.

Related

Why cant all applications run on one single OS? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Before tools like docker and VMs, bare metal servers were used to deploy and host applications. but tools like docker and VM allow us to have more than one OS on the same machine, compared to bare metal server which only allows us to have one OS.
Why is this an issue? Why cant all application run on a single server? why do some apps need a separate/different server?
Applications are code, which have been compiled to execute on a certain system.
Different OS's
Some OS's have different way of doing things and when we code we have to take that into consideration.
For instance in windows paths look like this c:\this\is\a\path and in linux they may look like this /this/is/a/path. Now if my application is just working with paths I could make my application work on any platform. But I would need to consider how I compile it and what language I run it in, or if its written in a translated language such as python or node.js then I need to ensure that I have written the code in a OS agnostic way. For instance I could reference paths using an OS agnostic way by joining the folders together and not trying to second guess what OS the machine is running on.
If I compile my code from C# but I want it to run on any machine will it check the OS at run time and then alter the way it checks for Paths etc...?
Also an experience I had, where in my web application I had to check if a file was an image, I was using a library which would apperently only work on windows, so when I deployed my docker container to my ubuntu machine I had a run time exception that I had a library missing. It was System.Draw or something. So even once you have your app containerized that may not neccessarily be problem solved 🀣
This is just an example with Paths, but that's just an example. Some .NET Framework applications require the machine has special run times installed on it, and these (someone correct me if I'm wrong) wouldn't install on linux, so then the code wouldn't run.
.NET CORE and Docker
With the advent of .NET Core this is the direction we are trying to move in. For instance .NET Core is supposed to be runable on any platform.
Also with Docker, docker containers wrap everything that is required to run an application into one package, so it doesn't care what your registry settings look like, it doesn't care if your missing the library or that library everything the app needs to run is bundled in with the container. This means if it runs a certain way on system A, then you can expect it will run the same way on system B.
Architecture
Also we have the issue of 32 and 64 bit architecture. This is basically the rawest level of how information gets processed on the machine. When the code is compiled it is compiled into assembly which your CPU then processes. Depending on whether you have a 32/64 bit machine or OS, this will affect whether the OS and CPU will be able to run the instructions. Yes I believe that 32 bit code can run on a 64 bit machine, but not vice versa. Also if you have an old windows game which uses a 16 bit installer, good luck trying to get that to run πŸ˜ƒ. I think I did manage to get an old windows game running in ubuntu in 64 bit. It was a 32 bit game, but the installer was a 16 bit installer.
I'm not expecting this answer will win any awards, but might do as a nice place holder until someone provides a better answer πŸ˜€
Compiled Languages
Objective C/ Swift - Will this only work on apple devices? ()
.NET Framework - will mostly work on windows devices, although some code may work on linx via mono
Java - This is actually cross platform and runs on the Java Run Time, I'm not sure if what it compiles down to is the same for all machines, or whether it has to be compiled into something different for each platform
c++ Is compiled and what you compile on one OS will not work on another OS.
Interpreted languages
Python runs on any machine, atlthough if you want your script or code to be platform agnostic you have to take care
bash although primarily unix I have seen better support for this on windows lately, I strongly doubt that every script written for unix would run first time on windows without a hitch
php runs on unix based systems and windows. I'm not sure how much care is requrired to keep this code OS agnostic, although I have a feeling some care may be required.

Raspbian update independent of Motioneyeos update?

I have installed Motioneyeos on a Pi Zero and on a Pi2, and it works like a charm in both of them. The control of the 2 systems can be unified on the web server of any one of them. The web interface is clear and allows to customize hundreds aspects of the program. Anything perfect so far.
Trying to understand a little bit how does it work, I have logged to one of the 2 Pis through ssh and I have checked that the OS is kept to a bare minimum. uname -r returns 4.19.65.
On the web interface of the app it is possible to check if the last version of the program is the one running. I have checked, and yes, I have the last version.
My question is: does it make sense to upgrade the OS components used by the program (apt update, apt dist-upgrade) even if the last version of the program is the one running in my Pis? Apt is not even installed, so the first thing would be to bring it there and install it, but I am afraid that if I update the OS, the program may stop to work...
I answer myself thanks to the feedback received in another forum. Motioneyeos is an embedded software based on Buildroot and as such it is not possible to install any package on it. To be able to install a package on Motioneyeos, Motioneyeos has to be installed on an full OS as Raspbian following the instructions in Motioneyeos web ==>>

Upload and Deploy Golang application to VPS

I've made a Go app and when I run the exe locally it works fine. Where would I upload this to on my VPS? public_html/domain.com/somefolder ? or /usr/somefolder with SSH?
I have my app, my .exe and src-files, but what do I do with it when I deploy online on my VPS? I haven't been able to find a tutorial about this, so I hope you can help me.
do I upload all files in my src folder including the binaries from when I've written "go build"?
upload to where on my VPS? using ssh or cpanel / ftp program or what?
What are the steps from "go build" on your own local windows 8 computer to uploading and running it online on a linux server?
Ps.
Additionally will CentOS 5.1.1 although not supported https://golang.org/doc/install - allow for me to run an already linux compiled go program on my VPS, and does it only mean that I cannot install Go and do compilation on the CentOS 5.x server? Would CentOS 5.1.1 explain the "segmentation fault" error shh gives me when running the command "./[filename]"?
Well, usually, you would:
Copy the binary you created + all resource files (html, css, images, ...)
(optionally the source code as well)
Have a way to ensure the program keeps running
crontab can be used to check if your program is alive, but a simple monitoring program would suffice as well (which you can write yourself)
Run the binary as a non-privileged user
(you can also combine it with something like Docker if you want)
It does not make sense to put it inside public_html/domain.com/somefolder, as it is not public html code. You'd want your files somewhere they cannot be accessed unless using the application/binary you created.
My apologies for not having neat source links to my story. However, this does seem like the best thing to do.
Another important note:
Even though your VPS may run Windows, you can also deploy linux binaries to a Linux VPS (which are drastically cheaper) - looking at this SO question.
A short note I wrote on writing golang app on osx and deploying on Linux server: http://kumargaurav.co/2016/08/10/deploy-go-lang-app-linux-server/

Failing Direct3D test in WACK

I'm building a Windows Store app and I'm failing the App Certification Tool test for the Direct3D feature. This is a general app with no specific calls to any graphics feature.
I've tried running the tests on two different machines so I don't think my problem is hardware specific. More, I've tried testing a very basic app stripped of all UI controls except for a text block and I'm receiving the same error. The machines are running RTM builds of Windows 8 and VS2012.
Essentially, I'm asking, what should I look at next to resolve this issue?
Thanks--
Installing all available Windows Updates and try to run WACK again.
I had luck with this method on more than one machine. Apparently, pending updates cause the issue. install the updates, let the machine restart and finish the updating process. The issue should be gone after that.

Deploy files on a network share from a client machine using an installation package?

We have a large application that has been developed over 15 years and in installed in 200+ client locations. The application currently consists of an Access database and a bunch of executable and report files located on a network share. A Setup.EXE file is run on each client machine (dlls are installed on the client) and then the client machines run the executables directly from the network share. During our upgrade procedure the new executable and report files are copied to the network share and that way each client gets the update immediately.
Our current installation program is very old and, among other things, it doesn't handle x64 so we are in the process of moving to a new deployment tool. At the same time we are migrating client Access databases to SQL Server. I am having difficulty finding a deployment tool to do what we require. Specifically we need the install/upgrade file to do the following:
It must be able to be run from a client machine on a network and copy the new executable and report files to the network share. That share could be a Linux box or a dumb storage device.
Accept a password before running the installation
Allow the user to select the network share as the location to copy the executables
It must NOT add anything to the client machine from where the package is run (Add/Remove Programs, registry, etc.)
Connect to a SQL Server database and run a script
The install/upgrade must be contained in a single, standalone .msi or .exe file. (no dependencies on dlls or frameworks other than those that come with Windows XP)
The file must be able to be run in one simple step. It is the end user that runs the upgrade without our support and without involvement from IT.
It looks like the closest thing to what I need is WiX but the problem there is that whenever the .msi file is run from a client, the client machine thinks that a program is being installed so it allows the client machine to uninstall the product, which is not acceptable.
If the product were written today it would certainly be architected differently but it currently is what it is and we can’t change that. Any help here would be greatly appreciated!
WiX is just a toolset built on top of Windows Installer technology. It makes many things easier and simpler as well as hides lots of Windows Installer weird features... But, it is still limited by Windows Installer, its underlying technology.
Your list of requirements made me think that Windows Installer is not the right technology to choose. I would assume that you'll spend more time on workarounds, than on functional code... But I have no experience with other installation technologies, so I'll leave those recommendations to others.