Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update windows.md #262

Merged
merged 4 commits into from Jan 25, 2017
Merged

Update windows.md #262

merged 4 commits into from Jan 25, 2017

Conversation

DimitrisSar
Copy link
Contributor

@DimitrisSar DimitrisSar commented Jan 24, 2017

[!] Changed file paths in all examples from C:\openhab\ to C:\openHAB2
[!] Changed from RC1 to Stable Release info and download links
[+] Added Windows service installation instructions
[+] Other cosmetic changes

Signed Off by: DimitrisSar (dimitris.sarantis@wired-net.gr)

[!] Changed file paths in all examples from `C:\openhab\ to `C:\openHAB2\
[!] Changed from RC1 to Stable Release info and download links
[+] Added Windows service installation instructions
[+] Other cosmetic changes

Signed Off by: DimitrisSar
@ThomDietrich
Copy link
Member

ThomDietrich commented Jan 24, 2017

Unrelated to this PR (I'll look at it later), would you at all be intrigued to build a batch/script files for the service setup task? ;)

@DimitrisSar
Copy link
Contributor Author

Sure.

The problem is now that I am trying to debug the service wrapper...
It doesn't work... Something is wrong with the wrapper.conf and I am trying in another Windows 10 PC to debug it...

@ThomDietrich
Copy link
Member

ThomDietrich commented Jan 24, 2017

Could you also check #180 #244 #216

Oh, okay good to know. Let me know when there are news. Thanks for looking into this!

@DimitrisSar
Copy link
Contributor Author

DimitrisSar commented Jan 24, 2017

@ThomDietrich : I am facing a challenge and I don't know how to address it...

The Service Wrapper configuration file (stored in C:\openHAB2\userdata\etc\openHAB2-wrapper.conf in my example) requires massive changes for the service to work. When generated with the command wrapper:install it does not work by default...

It requires the following changes:
Add in the Wrapper Properties all the environment variables for openHAB (e.g. OPENHAB_CONF)
Add several Java options in the JVM Parameters (e.g. -Dopenhab.logdir)
Even with all these changes... I don't know if the openHAB2 installation will be fully functional... (versus running the start.bat script)

I don't think that it would be good for the installation manual for Windows to include a step to fix the service wrapper configuration file since the number of changes is big...

How to deal with this?

Here is a working version with all these additions implemented (based on https://community.openhab.org/t/install-openhab-2-in-windows-10-as-windows-service/18375/8)

#********************************************************************
# Wrapper Properties
#********************************************************************
set.default.JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
set.default.KARAF_HOME=C:\openHAB2\runtime
set.default.KARAF_BASE=C:\openHAB2\userdata
set.default.KARAF_DATA=C:\openHAB2\userdata
set.default.KARAF_ETC=C:\openHAB2\userdata\etc

set.default.OPENHAB_HOME=C:\openHAB2
set.default.OPENHAB_CONF=C:\openHAB2\conf
set.default.OPENHAB_RUNTIME=C:\openHAB2\runtime
set.default.OPENHAB_USERDATA=C:\openHAB2\userdata
set.default.OPENHAB_LOGDIR=C:\openHAB2\userdata\logs
set.default.PATH=%PATH%;%KARAF_BASE%\lib;%KARAF_HOME%\lib

# Java Application
wrapper.working.dir=%KARAF_BASE%
wrapper.java.command=%JAVA_HOME%/bin/java
wrapper.java.mainclass=org.apache.karaf.wrapper.internal.service.Main
wrapper.java.classpath.1=%KARAF_HOME%/lib/boot/*.jar
wrapper.java.classpath.2=%KARAF_DATA%/lib/wrapper/*.jar
wrapper.java.library.path.1=%KARAF_DATA%/lib/wrapper/

# Application Parameters.  Add parameters as needed starting from 1
#wrapper.app.parameter.1=

# JVM Parameters
# note that n is the parameter number starting from 1.
wrapper.java.additional.1=-Dkaraf.home="%KARAF_HOME%"
wrapper.java.additional.2=-Dkaraf.base="%KARAF_BASE%"
wrapper.java.additional.3=-Dkaraf.data="%KARAF_DATA%"
wrapper.java.additional.4=-Dkaraf.etc="%KARAF_ETC%"
wrapper.java.additional.5=-Dcom.sun.management.jmxremote
wrapper.java.additional.6=-Dkaraf.startLocalConsole=false
wrapper.java.additional.7=-Dkaraf.startRemoteShell=true
wrapper.java.additional.8=-Djava.endorsed.dirs="%JAVA_HOME%/jre/lib/endorsed;%JAVA_HOME%/lib/endorsed;%KARAF_HOME%/lib/endorsed"
wrapper.java.additional.9=-Djava.ext.dirs="%JAVA_HOME%/jre/lib/ext;%JAVA_HOME%/lib/ext;%KARAF_HOME%/lib/ext"
wrapper.java.additional.10=-Dopenhab.home=C:\openHAB2
wrapper.java.additional.11=-Dopenhab.conf=C:\openHAB2\conf
wrapper.java.additional.12=-Dopenhab.runtime=C:\openHAB2\runtime
wrapper.java.additional.13=-Dopenhab.userdata=C:\openHAB2\userdata
wrapper.java.additional.14=-Dopenhab.logdir=C:\openHAB2\userdata\logs
wrapper.java.additional.15=-Dfelix.cm.dir=%OPENHAB_USERDATA%\config
wrapper.java.additional.16=-Dorg.osgi.service.http.port=8080
wrapper.java.additional.17=-Dorg.osgi.service.http.port.secure=8443

# Uncomment to enable jmx
#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616
#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.authenticate=false
#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.ssl=false

# Uncomment to enable YourKit profiling
#wrapper.java.additional.n=-Xrunyjpagent

# Uncomment to enable remote debugging
#wrapper.java.additional.n=-Xdebug -Xnoagent -Djava.compiler=NONE
#wrapper.java.additional.n=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=3

# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=512


#********************************************************************
# Wrapper Logging Properties
#********************************************************************
# Format of output for the console.  (See docs for formats)
wrapper.console.format=PM

# Log Level for console output.  (See docs for log levels)
wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.
wrapper.logfile=C:\openHAB2\userdata\logs\wrapper.log

# Format of output for the log file.  (See docs for formats)
wrapper.logfile.format=LPTM

# Log Level for log file output.  (See docs for log levels)
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
#  the log is rolled. Size is specified in bytes.  The default value
#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=10m

# Maximum number of rolled log files which will be allowed before old
#  files are deleted.  The default value of 0 implies no limit.
wrapper.logfile.maxfiles=5

# Log Level for sys/event log output.  (See docs for log levels)
wrapper.syslog.loglevel=NONE

#********************************************************************
# Wrapper Windows Properties
#********************************************************************
# Title to use when running as a console
wrapper.console.title=openHAB2

#********************************************************************
# Wrapper Windows NT/2000/XP Service Properties
#********************************************************************
# WARNING - Do not modify any of these properties when an application
#  using this configuration file has been installed as a service.
#  Please uninstall the service before modifying this section.  The
#  service can then be reinstalled.

# Name of the service
wrapper.ntservice.name=openHAB2

# Display name of the service
wrapper.ntservice.displayname=openHAB2

# Description of the service
wrapper.ntservice.description=openHAB 2 Service

# Service dependencies.  Add dependencies as needed starting from 1
wrapper.ntservice.dependency.1=

# Mode in which the service is installed.  AUTO_START or DEMAND_START
wrapper.ntservice.starttype=AUTO_START

# Allow the service to interact with the desktop.
wrapper.ntservice.interactive=false

@ThomDietrich
Copy link
Member

"If possible, the product should make documentation irrelevant"
Your description sounds a lot like what you actually want to do is update/add the wrapper script in openhab-distro. Is that correct? Is there any reason why you can not do that?

@DimitrisSar
Copy link
Contributor Author

Very good point (to include a proper wrapper.conf in the OH2 distro)!

I am not that good with scripting, but I will give it a try... maybe someone else can help also.

I have also another concern: I am not certain that the changes that I made in the wrapper.config are enough to have a stable system (maybe some environment variable is missing or some other parameter is wrongly configured). We will need some testers to double check the file contents.

@ThomDietrich
Copy link
Member

Regarding this issue: Maybe you could come up with a documentation that does not include the service for now? We can re-add it as soon as the wrapper question is solved. Having an up to date article with corrected info is more critical than adding new possibilities at the moment.

Regarding the wrapper: Just create a PR for distro and mention the problems you are seeing. Link the PR in the related community thread and the right people will comment.

@ThomDietrich
Copy link
Member

Yet another candidate openhab/openhab-distro#403

[-] Removed the windows service installation steps.  The Karaf service wrapper configuration file is broken (see : https://community.openhab.org/t/documenting-openhab-2/10568/151)
[!] I didn't update the section "Updating the openHAB Runtime".  This needs some improvements because the instructions do not work (see:  https://community.openhab.org/t/solved-openhab-2-update-issue/20978/7)
@DimitrisSar
Copy link
Contributor Author

I pushed another update to windows.md, removing the windows service installation steps
It only refreshes some info with regards to openHAB 2.0.0 Release Build and some small cosmetic changes
Check it please and maybe merge it to give a new set of instructions to the public.
Meanwhile, we will address the other issues at hand.

Copy link
Member

@ThomDietrich ThomDietrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, just a few comments.

Also did you see #244 ? Seems like we should not delete config.properties? Would you be able to check?

You didn't sign your commits. Please add your Sign-off-by including a mail address to the pull request description above. Thanks ;)


The following instructions will guide you through the process of setting up openHAB 2.

## Prerequisites

First, be sure to check that your system has the necessary [prerequisites]({{base}}/installation/index.html#prerequisites).

Add the JAVA_HOME System Environment Variable in Windows: Navigate to
`Control Panel\System and Security\System\Advanced system settings\Environment variables\System variables` and create a New System Variable based on your Java installation directory:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To stay in sync with other parts I'd suggest to put JAVA_HOME in ``.
The path through the Windows menu would be better described by -> or → or ➡

@@ -44,7 +53,7 @@ Assuming a successful install, you will now have various folders inside `C:\open
## Backup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one C:\openhab mentioning above

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, Could you name the headline "File Locations" and bring everything in sync with http://docs.openhab.org/installation/linux.html#file-locations
That would be nice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working on it now :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed another small update
Check please @ThomDietrich

[+] Added `` to JAVA_HOME
[+] Added `:arrow_right: to the windows navigation instructions for the System Environment Variable
[!] Fixed the example directory in "Assuming a successful install, you will now have various folders inside `C:\openHAB2`:"
[!] Changed from "Folder Structure" to "File Locations", replicating the linux.md way
[!] Remove the update step to  delete the `userdata\etc\config.properties` file... I will test the steps later and see if they work (haven't run them through yet to check them)

Signed-Off-By: dimitris.sarantis@wired-net.gr
@ThomDietrich
Copy link
Member

Great! Sadly we still have to correct a little detail. You've added :arrow_right: but will have to add ➡️. The former is not supported by jekyll.

Signed-off-by: Thomas Dietrich <thomas.dietrich@tu-ilmenau.de> (github: ThomDietrich)
@ThomDietrich ThomDietrich merged commit a6b86b8 into openhab:gh-pages Jan 25, 2017
@ThomDietrich
Copy link
Member

I've done that quick fix. The article is merged now. Thanks for your great help Dimitris ;)

@elupus
Copy link

elupus commented Feb 18, 2017

Just an updated startupscript with some less hardcoded paths. Should only need modification on top to adapt to other install locations.

#********************************************************************
# Wrapper Properties
#********************************************************************
set.default.OPENHAB_HOME=C:\openhab-2.0.0
set.default.JAVA_HOME=C:\Program Files\Java\jre1.8.0_101

set.default.KARAF_HOME=%OPENHAB_HOME%\runtime
set.default.KARAF_BASE=%OPENHAB_HOME%\userdata
set.default.KARAF_DATA=%OPENHAB_HOME%\userdata
set.default.KARAF_ETC=%OPENHAB_HOME%\userdata\etc
set.default.PATH=%PATH%;%KARAF_BASE%\lib;%KARAF_HOME%\lib

# Java Application
wrapper.working.dir=%KARAF_BASE%
wrapper.java.command=%JAVA_HOME%/bin/java
wrapper.java.mainclass=org.apache.karaf.wrapper.internal.service.Main
wrapper.java.classpath.1=%KARAF_HOME%/lib/boot/*.jar
wrapper.java.classpath.2=%KARAF_DATA%/lib/wrapper/*.jar
wrapper.java.library.path.1=%KARAF_DATA%/lib/wrapper/

# Application Parameters.  Add parameters as needed starting from 1
#wrapper.app.parameter.1=

# JVM Parameters
# note that n is the parameter number starting from 1.
wrapper.java.additional.1=-Dkaraf.home="%KARAF_HOME%"
wrapper.java.additional.2=-Dkaraf.base="%KARAF_BASE%"
wrapper.java.additional.3=-Dkaraf.data="%KARAF_DATA%"
wrapper.java.additional.4=-Dkaraf.etc="%KARAF_ETC%"
wrapper.java.additional.5=-Dcom.sun.management.jmxremote
wrapper.java.additional.6=-Dkaraf.startLocalConsole=false
wrapper.java.additional.7=-Dkaraf.startRemoteShell=true
wrapper.java.additional.8=-Djava.endorsed.dirs="%JAVA_HOME%/jre/lib/endorsed;%JAVA_HOME%/lib/endorsed;%KARAF_HOME%/lib/endorsed"
wrapper.java.additional.9=-Djava.ext.dirs="%JAVA_HOME%/jre/lib/ext;%JAVA_HOME%/lib/ext;%KARAF_HOME%/lib/ext"
wrapper.java.additional.10=-Dopenhab.home="%OPENHAB_HOME%"
wrapper.java.additional.11=-Dopenhab.conf="%OPENHAB_HOME%\conf"
wrapper.java.additional.12=-Dopenhab.runtime="%OPENHAB_HOME%\runtime"
wrapper.java.additional.13=-Dopenhab.userdata="%OPENHAB_HOME%\userdata"
wrapper.java.additional.14=-Dopenhab.logdir="%OPENHAB_HOME%\logs"
wrapper.java.additional.15=-Dfelix.cm.dir="%OPENHAB_HOME%\userdata\config"
wrapper.java.additional.16=-Dorg.osgi.service.http.port=8080
wrapper.java.additional.17=-Dorg.osgi.service.http.port.secure=8443

# Uncomment to enable jmx
#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616
#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.authenticate=false
#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.ssl=false

# Uncomment to enable YourKit profiling
#wrapper.java.additional.n=-Xrunyjpagent

# Uncomment to enable remote debugging
#wrapper.java.additional.n=-Xdebug -Xnoagent -Djava.compiler=NONE
#wrapper.java.additional.n=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=3

# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=512


#********************************************************************
# Wrapper Logging Properties
#********************************************************************
# Format of output for the console.  (See docs for formats)
wrapper.console.format=PM

# Log Level for console output.  (See docs for log levels)
wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.
wrapper.logfile=%OPENHAB_HOME%\userdata\logs\wrapper.log

# Format of output for the log file.  (See docs for formats)
wrapper.logfile.format=LPTM

# Log Level for log file output.  (See docs for log levels)
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
#  the log is rolled. Size is specified in bytes.  The default value
#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=10m

# Maximum number of rolled log files which will be allowed before old
#  files are deleted.  The default value of 0 implies no limit.
wrapper.logfile.maxfiles=5

# Log Level for sys/event log output.  (See docs for log levels)
wrapper.syslog.loglevel=NONE

#********************************************************************
# Wrapper Windows Properties
#********************************************************************
# Title to use when running as a console
wrapper.console.title=openHAB2

#********************************************************************
# Wrapper Windows NT/2000/XP Service Properties
#********************************************************************
# WARNING - Do not modify any of these properties when an application
#  using this configuration file has been installed as a service.
#  Please uninstall the service before modifying this section.  The
#  service can then be reinstalled.

# Name of the service
wrapper.ntservice.name=openHAB2

# Display name of the service
wrapper.ntservice.displayname=openHAB2

# Description of the service
wrapper.ntservice.description=openHAB 2 Service

# Service dependencies.  Add dependencies as needed starting from 1
wrapper.ntservice.dependency.1=

# Mode in which the service is installed.  AUTO_START or DEMAND_START
wrapper.ntservice.starttype=AUTO_START

# Allow the service to interact with the desktop.
wrapper.ntservice.interactive=false

@Confectrician Confectrician added this to the 2.x.x milestone Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants