openhab / openhab-distro

The binary distribution of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.3k stars 391 forks source link

Error in /var/lib/dpkg/info/openhab2.postinst for fresh installation #437

Closed gutwinski closed 7 years ago

gutwinski commented 7 years ago

Hello, this is my first entry ever in GitHub, so bear with me. When I recently did a fresh install of the openHAB2 SNAPSHOT on a RaspberyPi with Raspbian Jessie, I encountered the following error in the post installation script:

_The following NEW packages will be installed: openhab2 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 53.2 MB of archives. After this operation, 60.0 MB of additional disk space will be used. Get:1 http://openhab.jfrog.io/openhab/openhab-linuxpkg/ unstable/main openhab2 all 2.1.0 20170314145804-1 [53.2 MB] Fetched 53.2 MB in 30s (1,760 kB/s) Selecting previously unselected package openhab2. (Reading database ... 156452 files and directories currently installed.) Preparing to unpack .../openhab2_2.1.0 20170314145804-1all.deb ... Unpacking openhab2 (2.1.0 20170314145804-1) ... Processing triggers for systemd (215-17+deb8u6) ... Setting up openhab2 (2.1.0 20170314145804-1) ... /var/lib/dpkg/info/openhab2.postinst: 81: [: Illegal number: configure

A quick look at the script at line 81 showed this:

_case "$1" in configure|1|2) if [ -z $2 ] && [ $1 -ne 2 ] ; then

this is a fresh installation

                    if [ -x /bin/systemctl ] ; then
                            echo "### NOT starting on installation, please $
                            echo " sudo /bin/systemctl daemon-reload"
                            echo " sudo /bin/systemctl enable openhab2.serv$
                            echo "### You can start openhab2 by executing"
                            echo " sudo /bin/systemctl start openhab2.servi$
                    elif [ -x /usr/sbin/update-rc.d ] ; then_

It seems it's only about the instructions on how to install openHAB2 as a service. So, I did not miss much and was able to continue. However, I suppose that it should get fixed for future users.

I wasn't able to figure out what's wrong, so I leave it here for the experts to fix.

Cheers, Andreas

BClark09 commented 7 years ago

Hi @gutwinski, thanks for the issue report, would you be able to close this and copy the issue over to https://github.com/openhab/openhab-linuxpkg ? As this is where the package is created. I can take a look to see what's wrong and fix it for other people.

gutwinski commented 7 years ago

Issue closed and moved to https://github.com/openhab/openhab-linuxpkg.