GithubHelp home page GithubHelp logo

install's Introduction

Disclaimer

This script is for informational purpose only. It can be used as an example to guide a new user through the installation steps but its logic is not ideal and can easily lead to a corrupt setup. Therefore, a manual installation after understanding the overall architecture is highly recommended.

Install

Script install LinKnx & KnxWeb

Installation de KnxD / LinKnx / KnxWeb

Credits : Ivan Morgade, Anthony PENHARD Script libre: GPLv3

Install de :

  • pthsem : 2.0.8
  • KnxD : "git stable version"
  • LinKnx : 0.0.1.32 ( + mysql pour les logs )
  • KnxWeb : 2.1.0 ( + serveur web apache2 )
  • créer un "user" : "knx" mot de passe "knx"
  • possibilité d'installer :
  • Webmin : Dernière version stable

Liste des commandes :

wget https://github.com/linknx/install/archive/master.tar.gz && tar -xzf master.tar.gz

cd install-master

sudo chmod u+x install-trio.sh

sudo sh ./install-trio.sh --with-mysql --login=knx --password=knx --with-webmin

install's People

Contributors

energy01 avatar 2franix avatar

Stargazers

Tatsche avatar Nicolas avatar

Watchers

 avatar James Cloos avatar  avatar  avatar Nicolas avatar

install's Issues

knxd master is not the right one to use

in your script you use this

git clone https://github.com/knxd/knxd.git
mv knxd-master knxd
cd knxd

you should use stable branch (git checkout stable) instead. This is currently v0.12 which does not use pthsem anymore but has a dependency on libev, libev-dev. You cannot rely on master branch.

Service says fail to start however linknx running

Hi, I have just completed migration from my prehistoric system to new safer environment, based on Ubuntu 18.04.01 LTS 64 bit running in in virtualbox container - thus more safe / quick to recover.

Everything went quite well, few minor and one major things to report:

  • when install_trio script run again, it fails on not able to check version of knxweb (as it was previously installed, but not compltely) configured - had to bypass manually
  • install failing on pthsem - needed to manually download and build using install_trio script as guide
  • got stuck in knxweb check_config not being able to get from page 2 after clicking "Check" - finally checked apache error log and found out that simplexml was not properly installed (I installed lamp prior to install_trio using the taslek install lamp)

The major thing that worries me is:

  • service linknx reports failure when starting, although the linknx is actually working
  • subsequently service stop does not work and I need to kill / kilall the process

I can see this in syslog:

Jan  6 09:20:24 vub1 systemd[1]: Listening on KNX Daemon (socket).
Jan  6 09:20:24 vub1 systemd[1]: Starting KNX Daemon...
Jan  6 09:20:24 vub1 systemd[1]: Started KNX Daemon.
Jan  6 09:20:35 vub1 systemd[1]: Started Session 74 of user vasek.
Jan  6 09:21:12 vub1 systemd[1]: Starting LSB: linknx initscript...
Jan  6 09:21:12 vub1 linknx[6444]: *** Starting service: linknx using /usr/local/bin/linknx and args : --confi$
Jan  6 09:21:13 vub1 systemd[1]: linknx.service: Control process exited, code=exited status=1
Jan  6 09:21:13 vub1 systemd[1]: linknx.service: Failed with result 'exit-code'.
Jan  6 09:21:13 vub1 systemd[1]: Failed to start LSB: linknx initscript.
service linkx status

shows:

Unit linkx.service could not be found.
vasek@vub1:~$ service linknx status
● linknx.service - LSB: linknx initscript
   Loaded: loaded (/etc/init.d/linknx; generated)
   Active: failed (Result: exit-code) since Sun 2019-01-06 09:21:13 CET; 53min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 6444 ExecStart=/etc/init.d/linknx start (code=exited, status=1/FAILURE)
    Tasks: 1 (limit: 2320)
   CGroup: /system.slice/linknx.service
           └─6454 /usr/local/bin/linknx --config=/var/www/html/knxweb2/linknx.xml -p/var/run/linknx.pid -d/var/log/linknx.log -w

led 06 09:21:12 vub1 systemd[1]: Starting LSB: linknx initscript...
led 06 09:21:12 vub1 linknx[6444]: *** Starting service: linknx using /usr/local/bin/linknx and args : --config=/var/www/html/knxweb2/linknx.xml -p/var/run/l
led 06 09:21:13 vub1 systemd[1]: linknx.service: Control process exited, code=exited status=1
led 06 09:21:13 vub1 systemd[1]: linknx.service: Failed with result 'exit-code'.
led 06 09:21:13 vub1 systemd[1]: Failed to start LSB: linknx initscript.
ps aux |grep linknx 

shows

root      6454  0.2  0.4 121396  9820 ?        Ss   09:21   0:08 /usr/local/bin/linknx --config=/var/www/html/knxweb2/linknx.xml -p/var/run/linknx.pid -d/var/log/linknx.log -w

so the service is actually running.

/etc/init.d/linknx is actually default

#!/bin/sh
### BEGIN INIT INFO
# Provides:          linknx
# Required-Start:    $local_fs $remote_fs $syslog knxd mysql
# Required-Stop:     $local_fs $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: linknx initscript
# Description:       This file should be used to construct scripts to be
#                    placed in /etc/init.d.
### END INIT INFO
# chmod u+x linknx
# update-rc.d linknx defaults

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="service"
NAME=linknx
DAEMON=/usr/local/bin/$NAME
PIDFILE=/var/run/$NAME.pid
PATH_LINKNX_XML=/var/lib/linknx
#DAEMON_ARGS="--config=/etc/linknx.xml -p $PIDFILE -d/var/log/linknx.log -w"
#DAEMON_ARGS="--config=/var/www/knxweb2/linknx.xml -p $PIDFILE -d/var/log/linknx.log -w"
DAEMON_ARGS="--config=$PATH_LINKNX_XML/linknx.xml -p $PIDFILE -d/var/log/$NAME.log -w"
SCRIPTNAME=/etc/init.d/$NAME
USER=root
export LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH="/usr/local/lib"

#/etc/init.d/expo start

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
# [ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Temp-fix! remove surrounding whitespaces from seperator '='
[ -r /etc/default/$NAME ] && cat /etc/default/$NAME | sed 's/ =/=/' | sed 's/= /=/' > /etc/default/$NAME.out
[ -r /etc/default/$NAME.out ] && . /etc/default/$NAME.out

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
  export LD_LIBRARY_PATH=/usr/local/lib
  export LD_LIBRARY_PATH="/usr/local/lib"
  # Return
  #   0 if daemon has been started
  #   1 if daemon was already running
  #   2 if daemon could not be started
  echo "*** Starting $DESC: $NAME using $DAEMON and args : $DAEMON_ARGS with user $USER "
  start-stop-daemon --start --quiet --pidfile $PIDFILE -c $USER --exec $DAEMON --test > /dev/null \
          || return 1
  start-stop-daemon --start --quiet --pidfile $PIDFILE -c $USER --exec $DAEMON -- \
          $DAEMON_ARGS \
          || return 2
  # Add code here, if necessary, that waits for the process to be ready
  # to handle requests from services started subsequently which depend
  # on this one.  As a last resort, sleep for some time.
}

#
# Function that stops the daemon/service
#
do_stop()
{
  # Return
  #   0 if daemon has been stopped
  #   1 if daemon was already stopped
  #   2 if daemon could not be stopped
  #   other if a failure occurred
  start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
  RETVAL="$?"
  [ "$RETVAL" = 2 ] && return 2
  # Wait for children to finish too if this is a daemon that forks
  # and if the daemon is only ever run from this initscript.
  # If the above conditions are not satisfied then add some other code
  # that waits for the process to drop all resources that could be
  # needed by services started subsequently.  A last resort is to
  # sleep for some time.
  start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
  [ "$?" = 2 ] && return 2
  # Many daemons don't delete their pidfiles when they exit.
  rm -f $PIDFILE
  return "$RETVAL"
}

#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
  #
  # If the daemon can reload its configuration without
  # restarting (for example, when it is sent a SIGHUP),
  # then implement that here.
  #
  start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
  return 0
}

case "$1" in
  start)
        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
        do_start
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  stop)
        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
        do_stop
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
    status)
        status_of_proc -p $PIDFILE $DAEMON $NAME
        ;;
  #reload|force-reload)
        #
        # If do_reload() is not implemented then leave this commented out
        # and leave 'force-reload' as an alias for 'restart'.
        #
        #log_daemon_msg "Reloading $DESC" "$NAME"
        #do_reload
        #log_end_msg $?
        #;;
  restart|force-reload)
        #
        # If the "reload" option is implemented then remove the
        # 'force-reload' alias
        #
        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
        case "$?" in
          0|1)
                do_start
                case "$?" in
                    0) log_end_msg 0 ;;
                    1) log_end_msg 1 ;; # Old process is still running
                    *) log_end_msg 1 ;; # Failed to start
                esac
                ;;
          *)
                # Failed to stop
                log_end_msg 1
                ;;
        esac
        ;;
  *)
        #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
        #echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        echo "Usage: $SCRIPTNAME {start|stop|restart|status|force-reload}" >&2
        exit 3
        ;;

It seems to me that the "test" run fails, but leaves the deamon running?

Any suggestions would be welcome.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.