-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
Restructured folder layout #318
Conversation
This PR introduces some changes in the directory structure that might have impact on other parts. @theoweiss Could you please check if anything needs to be adapted for the debian packaging? Please note that with that change the start.sh script in the root is adapted, so this needs to be taken into account. @ThomDietrich Can you assess the implications on the documentation? I didn't see too much that would need to be adapted. @cniweb Please check that Docker and Synology images correctly handle this change. |
- moved etc folder to userdata - moved runtime/karaf to runtime - moved userdata/lock to userdata/tmp/lock - removed userdata/deploy - removed runtime/etc, only kept runtime/services.cfg Signed-off-by: Kai Kreuzer <kai@openhab.org>
@kaikreuzer I'll check it. |
Thank you @cniweb for the mention and keeping me up to date.. Are there other changes except of the runtime/karaf/bin path which has changed? Regards and thank you for your work on that, @kaikreuzer 👍 |
Regarding docs:
The first two are quick changes I can do after this PR is merged. One easy change is also needed in openHABian: openhab/openhabian#34 |
Sorry @thopiekar for having missed you - I somehow didn't remember that your QNAP package also does OH2 :-) Will keep you in the loop in future as well :-) All, thanks for your prompt feedback! So in general, I take your responses as an approval of this change. For the planning, I would suggest to merge this on Thursday, if nobody vetoes. |
@kaikreuzer You are not alone here after all and at the end I was mentioned here, too. So at the end no problem at all. Just one question left: Do we have to care about keeping the current settings save on updates/upgrades? Eg. moving the settings from the old to the new locations? |
@thopiekar As so far the settings always got lost with every update, I don't think we have to take care of that - not sure though, how you have handled the upgrade procedure so far? Did you keep runtime/karaf/etc folder in place? |
@kaikreuzer So far I followed the instructions by a user from the forums and just replaced the runtime and removed the userdata/cache and userdata/tmp, as you can see here: https://github.com/openhab/openhab-qnap-qpkg/blob/master/shared/openHAB.sh#L141 Until now I didn't know that I also had to care about runtime/karaf/etc 🙄 |
Nobody knew and soon nobody has to know :-) But good, your procedure is then very much in line with what I suggest in #299. |
#299 sounds good. Hope we'll find more problems there. |
I think we should also move org.apache.karaf.shell.cfg, specifically for the sshPort and sshHost parameters that are typically modified by users Moreover, as a Mac OS user, I also have to save and restore any openhab-wrapper_._ related files in order to keep things running. That is not only runtime/karaf/etc/openHAB-wrapper.conf and siblings, but also runtime/karaf/lib/wrapper/* |
@kgoderis See the very first line in this issue. The whole etc folder is moved. |
@kaikreuzer I'm preparing a PR at the moment for QPKG. |
Without being able to give a clear answer on the question, here's a more general idea: |
|
Fix for: #37 Needed for: openhab/openhab-distro#318 Signed-off-by: Christian Häussler <c-n-i@web.de> (github: cniweb)
Fix for #36 Needed for: openhab/openhab-distro#318 Signed-off-by: Christian Häussler <c-n-i@web.de> (github: cniweb)
The items/sitemaps won't refresh unless the path is set correctly. The logs can stay where they're being set and won't break the package, but I assumed the apt packages still wanted logs in /var/log like other services instead of /var/lib. |
Judging by the comments in the forum I think the |
I'll edit anywhere I've mentioned it. Meanwhile, I'm working on a PR to fix the issue for the deb package. |
Good idea! @theoweiss and @thopiekar might be interested to know. |
I believe I've made the appropriate necessary changes at: https://github.com/BClark09/openhab-distro/tree/deb-fix But I'm currently testing it before I make the PR. |
Looks good but I'm missing special upgrade steps. As I see it this will deliberately damage every upgrading users setup!? |
That sounds scary, in what way? |
I'm sorry if I'm wrong! e.g. https://community.openhab.org/t/new-folder-structure/16526/13 |
This happens because it's moved, it would have been replaced each time before this PR anyway right?
Since I'm currently running on the build Debian package of my branch and I haven't found any problems, I think I should make a PR and let @theoweiss give the all clear? |
Okay I'm not sure either. I think priority is to get a fix for the more eminent problem out there. Still I think doing what Kai mentioned as changes while the upgrade would definitely not hurt...
|
Just to mention: I'm using the online openHAB2 version (manually installed, no apt) and I had to use the command |
The error message says "REMOTE HOST IDENTIFICATION HAS CHANGED" and "It is also possible that a host key has just been changed". |
Fair enough, I agree, do you think the following in preinst would be sufficient? #...
OLD_ETC=/var/lib/openhab2/etc/
NEW_ETC=/usr/share/openhab2/runtime/karaf/etc/
#...
moveOldDir(){
[ ! -d ${NEW_ETC} ] && mkdir -p ${NEW_ETC}
[ -d ${OLD_ETC} ] && mv ${OLD_ETC}* ${NEW_ETC} && rm -rf ${OLD_ETC}
rm -rf /var/lib/openhab2/{kar,lock,deploy}
true
}
#...
upgrade)
moveOldDir
;;
#... We should probably continue this conversation on the PR. |
@BClark09 Are you sure that this script works like expected by the most people? See: https://wiki.debian.org/DpkgConffileHandling - section: "Moving a conffile" Btw. they argue the same:
But I think it depends on which behavior we want here... |
I'm no expert here by all means. |
@ThomDietrich: Ok. So if we want feedback from the user, then this should be correct 😉 |
I think we should be okay for this instance because we're moving non-conf files to become conf files. The majority of the file contents will not have changed and if they have then of course we should prompt the user. We definitely don't want to do this post-install because you'll be overwriting any necessary changes we make at a later date. EDIT: The script fails the package if the folder exists but is empty, I'm omitting it for now. |
Ok, so there are no problems by openhab-distro itself? (Without looking at the problems we have in our different packages..) |
CHanges related to openhab/openhab-distro#318 * Add HABmin and HABPanel UIs to Overview Signed-off-by: Christian Häussler <c-n-i@web.de> (github: cniweb) * Update working devices openhab/openhab-syno-spk#29 Signed-off-by: Christian Häussler <c-n-i@web.de> (github: cniweb) * Updating paths for new OH2 folder layout Fix for #129 Needed for: openhab/openhab-distro#318 Signed-off-by: Christian Häussler <c-n-i@web.de> (github: cniweb) * Updating paths for new OH2 folder layout Fix for #129 Needed for: openhab/openhab-distro#318 Signed-off-by: Christian Häussler <c-n-i@web.de> (github: cniweb) * Updating paths for new OH2 folder layout Fix for #129 Needed for: openhab/openhab-distro#318 Signed-off-by: Christian Häussler <c-n-i@web.de> (github: cniweb) * Updating paths for new OH2 folder layout Fix for #129 Needed for: openhab/openhab-distro#318 Signed-off-by: Christian Häussler <c-n-i@web.de> (github: cniweb) * Improve console interface text * Correct path information, clarify details * Update logging.md * Remove redundant already commented content * Add exlicit syntax to code fences Signed-off-by: Thomas Dietrich <thomas.dietrich@tu-ilmenau.de>
@kaikreuzer docs.openhab.org is up to speed. |
What's the status of fixing the broken paths? |
The problem with broken paths is related only to deb based installation. Discussed in a new issue: #322 |
@kaikreuzer Same goes for openHABian |
Not sure that this is even possible, as the call to wrapperService.install() seems to imply that there is little control as to which folders will be used. I am by no means a Karaf expert, so maybe @dvanherbergen you can have a look at this? [Secondly, I have no clue how to set up the IDE so that it uses Karaf for debugging purposes] |
Fix for: #37 Needed for: openhab/openhab-distro#318 Signed-off-by: Christian Häussler <c-n-i@web.de> (github: cniweb)
Fixes #315
Fixes #225
Signed-off-by: Kai Kreuzer kai@openhab.org