openhab / openhab-syno-spk

openHAB Synology SPK Install Package
Eclipse Public License 2.0
161 stars 42 forks source link

Support a DSM 6 package #3

Closed yphyph01 closed 8 years ago

yphyph01 commented 8 years ago

Hi,

When trying to install the new package for OpenHAB 1.8, I've got the following error on Synology DSM6 Beta1: "The User Home Service is not enabled. Please activate ..." But the User Home Service is activated on my NAS :-( Any idea how to solve this package installation issue? Regards Yann

cniweb commented 8 years ago

Hi Yann,

take a look here: https://www.synology.com/de-de/dsm/6.0beta/ReleaseNote#known_issue or report a bug: https://account.synology.com/support/beta_dsm_form.php

Regards, Chris

cniweb commented 8 years ago

@yphyph01 can I close this issue?

yphyph01 commented 8 years ago

Hi Christian,

Thank you for your answer and follow-up.

I’ve opened a case to synology. This issue is not yet a recognized synology bug.

So basically, I don’t know if the issue comes from the DSM 6 or from the package.

Do you have any successful installation on DSM6.0 Beta?

Regards

Yann

De : Christian Häussler [mailto:notifications@github.com] Envoyé : mercredi 20 janvier 2016 16:11 À : cniweb/openhab-syno-spk openhab-syno-spk@noreply.github.com Cc : yphyph01 yann@philippe.me Objet : Re: [openhab-syno-spk] Package 1.8.0: Enabled User Home Service (#3)

@yphyph01 https://github.com/yphyph01 can I close this issue?

— Reply to this email directly or view it on GitHub https://github.com/cniweb/openhab-syno-spk/issues/3#issuecomment-173232895 . https://github.com/notifications/beacon/APhY_MQPeYh-yKkhI5jtYS-_yyBlhTPiks5pb5r9gaJpZM4HDzvM.gif

itn3rd77 commented 8 years ago

Hi,

tried install on DSM 6 Beta2 with the same error. User Home Service is activated.

Any ideas?

Regards,

Ingo

cniweb commented 8 years ago

OK, suggestion: We gather here to experience DSM 6.0 and OpenHAB regarding User Home Service. Please inform me, with whom it works and not with whom. Depending on the result, we will see if a patch for DSM 6.0 packages is necessary or not.

OK?

Thanks, Chris

itn3rd77 commented 8 years ago

Ok. Here is what I figured out so far.

Inside the installer.sh you check if the "User-Home Service" is enabled by creating a new user and checking if the home directory exists.

With DSM 6.0 the creation of the home directory seems to take place asynchronously. I had to put a "sleep 3" after the line where you create the user Testing123.

After all I wondered if the is a better way to check if the "User-Home Service" is enabled. And found the command 'synogetkeyvalue'. You can check if the "User-Home Service" is enabled with the following command:

synogetkeyvalue /etc/synoinfo.conf userHomeEnable

This gives you 'no' or 'yes' as result. Don´t know if this is DSM 6.0 specific. I don´t have access to a a box running DSM 5.2 anymore.

cniweb commented 8 years ago

OK, i try it in DSM 5.2, it works:

synogetkeyvalue /etc/synoinfo.conf userHomeEnable yes

I make a patch and a new preversion for 1.8.0 (DSM 6.0), OK?

cniweb commented 8 years ago

I have add a new prerelease: https://github.com/cniweb/openhab-syno-spk/releases/tag/1.8.0.003 Please try!

yphyph01 commented 8 years ago

thank you for your work Christian. I've tested the new SPK on DSM 6.0Beta2. The "Enabled User Home Service" error disappeared.

Good step ahead but I'm still facing a issue at the end of the installation with a crazy message :"The package is successfully installed. Please Launch the package to repair it".

My quick observations:

How could I help you to investigate this issue? Any idea on the issue?

Regards

cniweb commented 8 years ago

OK I try it on a DSM 5.2, it´s work!

Can you look in your log files (/var/logs)?

yphyph01 commented 8 years ago

@cniweb Hi, I found an error on the synopkg.log file: 2016/02/01 20:14:31 install OpenHAB 1.8.0-003: Begin: postinst /var/packages/OpenHAB/scripts/installer.sh: line 79: unzip: command not found mv: cannot stat ‘/volume2/@tmp/OpenHAB-runtime-1.8.0/*’: No such file or directory rmdir: failed to remove ‘/volume2/@tmp/OpenHAB-runtime-1.8.0’: No such file or directory 2016/02/01 20:14:40 install OpenHAB 1.8.0-003: End: postinst ret=[0]

Indeed, Synology remove the unzip command in the DSM 6 Beta version. It's replace by 7zip. Please have a look at: https://forum.synology.com/enu/viewtopic.php?f=260&t=106327&p=400791&hilit=unzip#p400791

I'll try to update your installer.sh with the 7zip command

Regards

yphyph01 commented 8 years ago

@cniweb in installer.sh, replacing the line 79 with 7z x ${TEMP_FOLDER}/${DOWNLOAD_FILE} -o${EXTRACTED_FOLDER} && rm ${TEMP_FOLDER}/${DOWNLOAD_FILE} and the files are correctly unzipped But that's not enough. I've noticed that we don't have the control of the package. In the package center, the openhab package is always shown as "stopped" but the package is running. java processes are executed and shown in process list.So, we can't start or stop the package

Hope this help

cniweb commented 8 years ago

Since I have no DiskStation on DSM 6 Beta is running, I can not try it out unfortunately. I can not help you, unfortunately, I'm sorry!

vectah0 commented 8 years ago

I can confirm that there is no service control of the package on DSM 6.0beta. Package is always being shown as stopped

vectah0 commented 8 years ago

@yphyph01

A temp workaround for getting proper status of the package in DSM 6 beta2 could be something like this:

Edit: /var/packages/OpenHAB/scripts/start-stop-status.sh

Add PID variable:

PIDFILE="/var/services/homes/openhab/.daemon.pid"

Change status to:

  status)
    [ ! -f "$PIDFILE" ] && return 1

        if ps -p $(cat "$PIDFILE") > /dev/null; then
                exit 0
                    else
                exit 1
        fi
        ;;

It should now return package status properly

cniweb commented 8 years ago

@vectah0 Looks good, I should adjust it in my package?

A general question: Would not it be better to build your own package for 6.0, it has apparently changed much?

cniweb commented 8 years ago

OK, i create a new branch for DSM 6 beta package and change the status check: https://github.com/openhab/openhab-syno-spk/commit/0c1c4dcf7bce0d7bd20ec55eeb10b211b9ae23ae And the unzip command to 7z: https://github.com/openhab/openhab-syno-spk/commit/5ad20a05ed2d957b84298287675dc8c473fea026

cniweb commented 8 years ago

OK, I have the two requirements now separated! This Issue is only for a package > DSM 6

cniweb commented 8 years ago

I make a new release: https://github.com/openhab/openhab-syno-spk/releases/tag/1.8.1-DSM6-beta Please try and provide feedback, thanks!

xbmcnut commented 8 years ago

@vectah0 Can you please advise where I place the 'Add PID variable' in the start-stop-status.sh?

vectah0 commented 8 years ago

you place it at the beginning of the start-stop-status.sh file where other variables are defined

xbmcnut commented 8 years ago

Thanks @vectah0. Like this?

DAEMON_USER="`echo ${SYNOPKG_PKGNAME} | awk {'print tolower($_)'}`"
DAEMON_ID="${SYNOPKG_PKGNAME} daemon user"
ENGINE_SCRIPT="start_runtime.sh"
DAEMON_USER_SHORT=`echo ${DAEMON_USER} | cut -c 1-8`
PIDFILE="/var/services/homes/openhab/.daemon.pid"

daemon_status ()
vectah0 commented 8 years ago

yes

cniweb commented 8 years ago

This exactly I have implemented: https://github.com/openhab/openhab-syno-spk/blob/DSM-6.0-beta/scripts/start-stop-status.sh#L10 in my DSM6 Package: https://github.com/openhab/openhab-syno-spk/releases/tag/1.8.1-DSM6-beta Where is your problem?

xbmcnut commented 8 years ago

@cniweb Thank you, but not working for me under 2.0.0-beta2 with DSM 5.2-5644 Update 5. OH2 working fine, service not showing as running in Package Manager though.

cniweb commented 8 years ago

@yphyph01 This Issue is only for DSM6 package, open a new Issue or use #4, please.

cniweb commented 8 years ago

I have released a new OpenHab 2.0 DSM 6 release: https://github.com/openhab/openhab-syno-spk/releases/tag/2.0.0-beta2-DSM6-RC Try it, please!

cniweb commented 8 years ago

@yphyph01 @itheiss Can I close this Issue?

yphyph01 commented 8 years ago

Yes, I think you can close this thread. A DSM 6 package is available. The issue #17 is used for the bug fixing of the package. Regards