Giter Site home page Giter Site logo

Comments (26)

davsclaus avatar davsclaus commented on July 23, 2024

I wonder how we can get the pid on windows. Also how to kill a process. We may have some commands which we cannot do as well as on linux.

Thought working my way to port the launcher script so we can run jube.

from jube.

jstrachan avatar jstrachan commented on July 23, 2024

I've done some googling; not sure its that easy TBH :)

A process name (the name of the folder that the start/stop scripts are run within) is unique; I wonder if we need to pass the process name into the start process command; so we can grep the running processes for the name.

http://ss64.com/nt/tasklist.html

Not sure if that works mind you :)

from jube.

chirino avatar chirino commented on July 23, 2024

It's tricky, but I think it should be possible. For example, if you create a file called test.vbs with the following content:

  Dim WshShell, oExec
  Set WshShell = CreateObject("WScript.Shell")
  Set oExec = WshShell.Exec("notepad")
  WScript.Echo oExec.ProcessID

And you run it with cscript test.vbs then it prints out the pid of the running notepad process that it launched.

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

I just found tasklist as a command. I dont remember such a command from my old windows days. Though it shows the pid for the tasks. And there is also jps from java itself.

screen shot 2014-11-19 at 3 23 26 pm

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

Yay got a bit working now.

I can now run or start jube on Windows using the launcher script. And just got it able to figure out the pid as well. I haven't yet looked at starting a process as nohub so when you use start.bat you get a 2nd dos window.

But take notice of screenshot below where it prints the pid of jube which is 3056.
And there is a taskkill command so we can kill it also with taskkill /pid 3056.

screen shot 2014-11-19 at 9 06 02 pm

from jube.

jstrachan avatar jstrachan commented on July 23, 2024

who-hooo!

from jube.

jstrachan avatar jstrachan commented on July 23, 2024

I noticed that Karaf uses a Start/Stop class on windows. We could always use some Java code if that helps (though TBH not sure what Java can do that a .BAT/.CMD can't ;)

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

Yeah I thought that as well we could drop a tool JAR somewhere to use.

Though if it was windows 95 it may be a problem but seems like the newer windows from xp/2000 kinda is possible. I just got the status and start/run to work.

The only problem is that there is no nohup to start a process in the background etc. I guess its the service wrapper thingy needed. Though lets see how far I get today so we have a java image working on windows. I expect then the tomcat/karaf images is easier to port as well. And I suppose the wildfly one is doable as well.

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

And btw I tried a winbash project that is a .exe and a set of ports of linux commands. It was able to run the launcher .sh scripts. Though the ps command was not available - but I though it was icky to have to distribute an .exe file to go along.

from jube.

jstrachan avatar jstrachan commented on July 23, 2024

Ah cool! :)

It wouldn't be a biggie to include winbash.exe inside the jube distro so that processes can use it?

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

Okay I got the java jube image covered now (fingers crossed).

Still to go is the tomcat / karaf and wildfly images

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

Tomcat is now done, so its karaf and wildfly tomorrow

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

Behold we are conquering windows now. Just got jube being able to run the camel-spring quickstart.

jube-on-windows

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

Don't fall of the chair, but we got jube with tomcat running on windows now. Even the hawtio connect button worked, though I had to type admin/admin 2 times.

jube-win-tomcat

from jube.

jstrachan avatar jstrachan commented on July 23, 2024

who-hoo! Just in time for a Friday beer to celebrate! :)

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

And it even works as a service. I can access 9001 or what the port was, and its proxied to the 57xxx port that tomcat runs. And I killed tomcat, and jube just started a new Tomcat ;)

Yes its time for a beer and dinner. Have a nice weekend.

from jube.

jstrachan avatar jstrachan commented on July 23, 2024

awesome stuff - yay! Have a great weekend too!

BTW I've been trying to make most REST-ish or web-ish quickstarts respond to the / directory so that if you open a quickstart from the Services tab it does something useful. e.g. the cxf-rest war does now - so folks can just click a few times and test out the quickstarts nicely - via kube services

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

And Karaf is also running now

karaf

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

I wonder if the HTTP server of Karaf should be exposes as a kube service?

from jube.

jstrachan avatar jstrachan commented on July 23, 2024

Yeah. I guess different Apps may use karaf and wish to expose different services.

So it might be nice for each quickstart for example to define its own service; so you could view all, say, karaf CXF quickstarts as a single service - which is different from the Camel quickstarts etc

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

Ah yeah, so if a quickstart leverages the HTTP server of Karaf, then it should expose it as a service.

And currently that is mostly the soap/rest karaf quickstarts.

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

There is 2 images left, wildfly and zookeeper.

from jube.

jstrachan avatar jstrachan commented on July 23, 2024

Yeah. I started adding services to some of the quickstarts so they work like that. e.g.

then if you run those quickstarts, they appear on the Services tab in hawtio and you can click on the URL to try out the quickstart ;)

Incidentally it'd be awesome if the fabric8:json maven goal that generates the kubernetes JSON, also detected if a fabric8.service.port property was set & automatically generated the service entry in the JSON too (we'd have to switch from being a vanilla ReplicationController to being a Config to do that) - then we can start deleting all these kuberentes-extra.json files - which are tricky to write and very error prone - and just reuse the labels / container port / service port from the maven properties to generate a JSON file with the service definition inside too.

Mostly its a case of changing this template to detect the fabric8.service.port and if present add a Service definition
https://github.com/jstrachan/fabric8/blob/changes/components/kubernetes-template/src/main/resources/io/fabric8/templates/default.mvel

I've just raised #3163 to track this

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

I logged #155 about the missing wildfly image. Then closing this as we have for 4 kinds now that are used by the quickstarts.

from jube.

ctomc avatar ctomc commented on July 23, 2024

guys, any good reason why not use powershell? given how many problems you have with batch scripts...

from jube.

davsclaus avatar davsclaus commented on July 23, 2024

For jube we have a number of different images for

  • java = standalone java
  • tomcat
  • karaf
  • wildfly

And for the last 3 they have .bat scritps to run on windows. So its only the standalone java we had to do ourself 100%.

For powershell what would that bring to the table? Do you see any improvement we can do?

And you are sure welcome to help with the support on Windows and jube in general ;)

from jube.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.