grierforensics / Great-DANE-Engine

Great DANE Engine
Other
9 stars 2 forks source link

Some problems with GreatDANEEngine service (installation, cert retrieval, service won't stop) #5

Open soulsymphonies opened 7 years ago

soulsymphonies commented 7 years ago

Hello, thanks first for the effort to create a DANE service, I have an issue with installing it on Windows 10 Creators update.

If have downloaded the installer for Windows, Great-DANE-Engine-Installer.jar and tried to install it. I have Windows 10 Creators update running 10.0.1.15063 and Java Runtime 1.8.0_121 installed on the system, the installer runs through, but it gives me a warning "Failed to execute C:\Program Files\Great DANE Engine\bin\installService.bat.

If I try to start the service GreatDANEEngine manually via the Services MMC it's listed there but I'm unable to start it.

In the system protocol I get the following error: Der Dienst "Grier Forensics GreatDANEEngine" wurde mit dem folgenden dienstspezifischen Fehler beendet: Unzulässige Funktion. (in English: the service stopped with the following error: unauthorized function) event-id 7024

The console command to query the exit codes of the service gives me the following infos about the service:

Microsoft Windows [Version 10.0.15063] C:\Users\rober>sc query GreatDANEEngine SERVICE_NAME: GreatDANEEngine TYPE : 10 WIN32_OWN_PROCESS STATE : 1 STOPPED WIN32_EXIT_CODE : 1066 (0x42a) SERVICE_EXIT_CODE : 1 (0x1) CHECKPOINT : 0x0 WAIT_HINT : 0x0

This is what is logged in commons-daemon.2017-04-15 in the logs folder, unfortunately my Windows is a German version, so some things are logged in German :

2017-04-15 20:44:16] [info] [ 5416] Commons Daemon procrun (1.0.15.0 64-bit) started [2017-04-15 20:44:16] [info] [ 5416] Service GreatDANEEngine name Grier Forensics GreatDANEEngine [2017-04-15 20:44:16] [info] [ 5416] Service 'GreatDANEEngine' installed [2017-04-15 20:44:16] [info] [ 5416] Commons Daemon procrun finished [2017-04-15 20:44:16] [info] [ 5568] Commons Daemon procrun (1.0.15.0 64-bit) started [2017-04-15 20:44:16] [info] [ 5568] Starting service 'GreatDANEEngine' ... [2017-04-15 20:44:16] [info] [10656] Commons Daemon procrun (1.0.15.0 64-bit) started [2017-04-15 20:44:16] [info] [10656] Running 'GreatDANEEngine' Service... [2017-04-15 20:44:16] [info] [ 2532] Starting service... [2017-04-15 20:44:16] [error] [ 2532] Failed creating java [2017-04-15 20:44:16] [error] [ 2532] ServiceStart returned 1 [2017-04-15 20:44:16] [info] [10656] Run service finished. [2017-04-15 20:44:16] [info] [10656] Commons Daemon procrun finished [2017-04-15 20:44:17] [error] [ 5568] Failed to start 'GreatDANEEngine' service [2017-04-15 20:44:17] [error] [ 5568] Der an einen Systemaufruf übergebene Datenbereich ist zu klein. [2017-04-15 20:44:17] [info] [ 5568] Start service finished. [2017-04-15 20:44:17] [error] [ 5568] Commons Daemon procrun failed with exit value: 5 (Failed to start service) [2017-04-15 20:44:17] [error] [ 5568] Der an einen Systemaufruf übergebene Datenbereich ist zu klein.

I would be grateful for assistance.

Kind regards, Robert Christian Strasser

soulsymphonies commented 7 years ago

I fixed this issue by myself, I had to install the Java JDK 1.8.0_121 instead of only the JRE 1.8.0_121, I also did set the JAVA_HOME variable to the JDK path and adjusted the PATH variable, as showed here https://javatutorial.net/set-java-home-windows-10 Maybe the README could be updated to show the required steps to run the service under Windows, so others don't have to figure out for themselves.

So now as this one works, and I can start the service and also I can connect to it via the Thunderbird plugin, is shows "success!", nonetheless there is another issue now

Although the Email Test at http://dst.grierforensics.com/#/start with all my email addresses works, it finds and uses my DNSSEC secured SMIMEA records and sends me an encrypted mail which I can open with my certificate, the Thunderbird plugin is not able locate the SMIMEA records, when I try to send to one of my SMIMEA enabled adresses and Thunderbird doesn't have the certificate already, the plugin seems not to fetch the certificate,

I would be grateful for help!

Greetings, Robert Christian Strasser

soulsymphonies commented 7 years ago

I managed to fix the other one two, it now works and fetches the certificates via the local DANE instance.

The issue was that the default Google DNS server 8.8.8.8 did not work for me, although I could dig the SMIMEA records while using this DNS server from the console and the router let's the DNS traffic UDP and TCP port 53 through somehow it did not work out, couldn't exactly specify why it doesn't work, I had to use the DNS forwarding DNS server of my local router here, which is an AVM Fritz!Box 7390, then it worked.

The only thing left now, is that the service can not be stopped again, once it is running, if I do so in the services panel, it say "stopping service" forever and never stopps the service, I have to restart the entire machine to get the service with a new configuration.

Thanks again for that great piece of software

Robert Christian Strasser

naegelejd commented 7 years ago

The Engine uses Apache Commons Daemon procrun tool for managing the service. (The greatdaneengine.exe binary is just procrun renamed). I wonder if there's an issue with procrun itself.

Are you able to start/stop the service successfully using only the service.bat script in the bin/ folder wherever you installed the Engine?

soulsymphonies commented 7 years ago

Thank you for your reply, if I try to stop the service via the commandline using service.bat stop, it also doesn't stop the service

It just shows forever that it's trying to stop the service:

Stopping the service 'GreatDANEEngine' ... Using GREATDANEENGINE_BASE: "C:\Program Files\Great DANE Engine"

and then if I wait long enough says: Failed to stop 'GreatDANEEngine' service

soulsymphonies commented 7 years ago

Although I'm not programming software, I was searching the internet, maybe this Java Service Wrapper would work more reliable than the procrun, maybe not, I was just following my intuition, so I post it here, it is called YAJSW (Yet Another Java Service Wrapper) and licensend unter Apache License

https://sourceforge.net/projects/yajsw/

naegelejd commented 7 years ago

You're correct that YAJSW is a viable alternative to procrun, however I found it much easier to get started with procrun. One requirement is that it is easily deployed using IzPack, the cross-platform installer software we use. Another option is to use a different installer package, such as WiX Toolset or Nullsoft Scriptable Install System (NSIS), in case anyone wants to attempt that route in the future.

I'll try to take a deeper look into the procrun issue before I attempt to switch to YAJSW.

soulsymphonies commented 7 years ago

Thank you ever so much.