Ankündigung

Einklappen
Keine Ankündigung bisher.

Start über systemctrl funktinoiert nicht.

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Start über systemctrl funktinoiert nicht.

    Hi,
    habe Probleme mit dem Start von knxd 0.14.16:85fe31e

    Ein
    knxd /etc/knxd.conf
    funktioniert problemlos.

    Mit
    systemctl start knxd.service
    bekomme ich folgende Fehler:

    Code:
    Aug 11 23:39:40 ubuntu systemd[1]: knxd.service: Ignoring invalid environment assignment 'trace-mask=0': /etc/knxd.conf
    Aug 11 23:39:40 ubuntu systemd[1]: knxd.service: Ignoring invalid environment assignment 'client-addrs=1.1.251:3': /etc/knxd.conf
    Aug 11 23:39:40 ubuntu systemd[1]: Starting KNX Daemon...
    -- Subject: Unit knxd.service has begun start-up
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- Unit knxd.service has begun starting up.
    Aug 11 23:39:40 ubuntu knxd[8945]: Usage: knxd configfile [main_section]
    Aug 11 23:39:40 ubuntu knxd[8945]: Please consult /usr/share/doc/knxd/inifile.rst
    Aug 11 23:39:40 ubuntu systemd[1]: knxd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
    Aug 11 23:39:40 ubuntu systemd[1]: Failed to start KNX Daemon.
    -- Subject: Unit knxd.service has failed
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- Unit knxd.service has failed.
    --
    -- The result is failed.
    Aug 11 23:39:40 ubuntu systemd[1]: knxd.service: Unit entered failed state.
    Aug 11 23:39:40 ubuntu systemd[1]: knxd.service: Failed with result 'exit-code'.
    Aug 11 23:39:43 ubuntu polkitd(authority=local)[774]: Registered Authentication Agent for unix-process:8962:428532 (system bus name :1.25 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale
    Aug 11 23:39:43 ubuntu polkit-agent-helper-1[8968]: PAM unable to dlopen(pam_winbind.so): /lib/security/pam_winbind.so: cannot open shared object file: No such file or directory
    Aug 11 23:39:43 ubuntu polkit-agent-helper-1[8968]: PAM adding faulty module: pam_winbind.so
    Aug 11 23:39:47 ubuntu polkitd(authority=local)[774]: Operator of unix-process:8962:428532 successfully authenticated as unix-user:mode to gain ONE-SHOT authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.26 [systemctl
    Aug 11 23:39:50 ubuntu systemd[1]: knxd.service: Service hold-off time over, scheduling restart.
    Aug 11 23:39:50 ubuntu systemd[1]: Stopped KNX Daemon.
    -- Subject: Unit knxd.service has finished shutting down
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- Unit knxd.service has finished shutting down.
    Aug 11 23:39:50 ubuntu systemd[1]: knxd.service: Ignoring invalid environment assignment 'trace-mask=0': /etc/knxd.conf
    Aug 11 23:39:50 ubuntu systemd[1]: knxd.service: Ignoring invalid environment assignment 'client-addrs=1.1.251:3': /etc/knxd.conf
    Aug 11 23:39:50 ubuntu systemd[1]: Starting KNX Daemon...
    -- Subject: Unit knxd.service has begun start-up
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- Unit knxd.service has begun starting up.
    Aug 11 23:39:50 ubuntu knxd[8971]: Usage: knxd configfile [main_section]
    Aug 11 23:39:50 ubuntu knxd[8971]: Please consult /usr/share/doc/knxd/inifile.rst
    Aug 11 23:39:50 ubuntu systemd[1]: knxd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
    Aug 11 23:39:50 ubuntu systemd[1]: Failed to start KNX Daemon.
    -- Subject: Unit knxd.service has failed
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- Unit knxd.service has failed.
    --
    -- The result is failed.
    Aug 11 23:39:50 ubuntu systemd[1]: knxd.service: Unit entered failed state.
    Aug 11 23:39:50 ubuntu systemd[1]: knxd.service: Failed with result 'exit-code'.
    Aug 11 23:39:50 ubuntu polkitd(authority=local)[774]: Unregistered Authentication Agent for unix-process:8962:428532 (system bus name :1.25, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale de_DE.UTF-8) (disconnected from bus)
    Meine /etc/knxd.conf
    Code:
    [B.tpuarts]
    device = /dev/ttyUSB_KNX
    driver = tpuart
    
    [debug-server]
    name = mcast:knxd
    
    [debug-tunnel]
    trace-mask = 0
    
    [main]
    addr = 1.1.251
    client-addrs = 1.1.251:3
    cache = A.cache
    connections = server,B.tpuarts
    systemd = systemd
    
    [server]
    debug = debug-server
    discover = true
    server = ets_router
    tunnel = tunnel
    
    [tunnel]
    debug = debug-tunnel
    
    
    # configuration for knxd.service
    #KNXD_OPTS=" -e 1.1.251 -t 0 -T -D -S -c tpuarts:/dev/ttyUSB_KNX"
    
    # The default options are "-u /tmp/eib -b ip:"
    # which tell knxd to route between all of
    #  /tmp/eib (legacy socket (-u))
    #  multicast client (-b ip:).
    # knxd's own bus address is 0.0.1; it will assign 0.0.2…0.0.9 to clients.
    # The knxd.socket file also tells knxd to listen to
    #  /run/eib (socket activation via systemd)
    #  TCP port 6720 (socket activation via systemd)
    # You *need* the -e option. Clients cannot connect without "-E".
    
    # You can read knxd's logs with
    # $ journalctl -u knxd --since "10 min ago"
    # (or whatever). See the manpage for details.
    # You need to be a member of the "adm" group.
    # Add "-f9 -t1023" to the beginning of the command line for extensive logging.
    
    # *** DO NOT use "-u" / "-u /run/knx" or "-i" / "-i 6720" here.
    # Systemd already does that on behalf of knxd, via 'knx.socket'.
    
    # *** DO NOT use both "-RS" and "-b ip:" (unless you specify a
    # different multicast address on one of them). You'd create a loop.
    
    # If you have KNX hardware on a serial port or USB, add the appropriate
    # "-b TYPE:…" option. In this case, you probably want to set up a multicast
    # server, not a client (i.e. use "-D -T -R -S", not "-b ip:").
    # DO NOT use both.
    #
    # If your KNX hardware is a KNX/IP gateway that doesn't do multicast,
    # use "-b ipt:192.168.1.2" (or its DNS name) to talk to it.
    #
    # KNX MUST NOT have more than one path between any two devices. Thus,
    # you need to make sure that the KNX/IP gateway does not route multicast
    # before you use both "-S" and "-b ipt:".
    
    # The default bus address of knxd is 0.0.1. If that's in use in your KNX
    # network (or if you run more than one knxd on your network), set a
    # different address, for example "-e 7.0.99".
    
    # You should have a block of free addresses on your KNX bus which knxd can
    # assign to clients: "-E 7.0.100:28" will use 7.0.100 through 7.0.127.
    # If no such range is given, or if it's full, knxd uses its own address.
    # That mostly works, but separate addresses are much better.
    
    # Run `knxd --help` to get a complete list of available options and drivers.
    
    ## DO NOT use the following options:
    ## -i           -- /lib/systemd/system/knxd.socket does this for us
    ## -u /run/knx  -- likewise
    ## -d           -- /lib/systemd/system/knxd.service expects knxd to run in the foreground
    ## -p PIDFILE   -- please use systemctl to control knxd
    
    ###############################################################################
    # This file is ignored when NOT using systemd: edit /etc/default/knxd instead #
    ###############################################################################

    LG

    mode

    #2
    im syslog steht alle 10 Sekunden
    Code:
    Aug 12 00:49:38 ubuntu systemd[1]: Reloading.
    Aug 12 00:49:39 ubuntu systemd[1]: knxd.service: Service hold-off time over, scheduling restart.
    Aug 12 00:49:39 ubuntu systemd[1]: Stopped KNX Daemon.
    Aug 12 00:49:39 ubuntu systemd[1]: knxd.service: Ignoring invalid environment assignment 'trace-mask=0': /etc/knxd.conf
    Aug 12 00:49:39 ubuntu systemd[1]: knxd.service: Ignoring invalid environment assignment 'client-addrs=1.1.251:3': /etc/knxd.conf
    Aug 12 00:49:39 ubuntu systemd[1]: Starting KNX Daemon...
    Aug 12 00:49:39 ubuntu knxd[18277]: Usage: knxd configfile [main_section]
    Aug 12 00:49:39 ubuntu knxd[18277]: Please consult /usr/share/doc/knxd/inifile.rst
    Aug 12 00:49:39 ubuntu systemd[1]: knxd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
    Aug 12 00:49:39 ubuntu systemd[1]: Failed to start KNX Daemon.
    Aug 12 00:49:39 ubuntu systemd[1]: knxd.service: Unit entered failed state.
    Aug 12 00:49:39 ubuntu systemd[1]: knxd.service: Failed with result 'exit-code'.
    Aug 12 00:49:49 ubuntu systemd[1]: knxd.service: Service hold-off time over, scheduling restart.
    Aug 12 00:49:49 ubuntu systemd[1]: Stopped KNX Daemon.
    Aug 12 00:49:49 ubuntu systemd[1]: knxd.service: Ignoring invalid environment assignment 'trace-mask=0': /etc/knxd.conf
    Aug 12 00:49:49 ubuntu systemd[1]: knxd.service: Ignoring invalid environment assignment 'client-addrs=1.1.251:3': /etc/knxd.conf
    Aug 12 00:49:49 ubuntu systemd[1]: Starting KNX Daemon...
    Aug 12 00:49:49 ubuntu knxd[18296]: Usage: knxd configfile [main_section]
    Aug 12 00:49:49 ubuntu knxd[18296]: Please consult /usr/share/doc/knxd/inifile.rst
    Aug 12 00:49:49 ubuntu systemd[1]: knxd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
    Aug 12 00:49:49 ubuntu systemd[1]: Failed to start KNX Daemon.
    Aug 12 00:49:49 ubuntu systemd[1]: knxd.service: Unit entered failed state.
    Aug 12 00:49:49 ubuntu systemd[1]: knxd.service: Failed with result 'exit-code'.
    Habe dann
    Code:
    systemctl disable knxd.socket
    systemctl disable knxd.service
    systemctl stop knxd.socket
    systemctl stop knxd.service
    ausgeführt, damit das Log nicht weiter zugespammt wird. Keine Wirkung :-( Was ist da los? Bin mit systemctl noch nicht so richtig warm geworden :-(


    Was gerad noch auffällt, knxd manuell gestartet.
    Dann blockiert aber
    Code:
     /usr/bin/knxtool groupwrite ip:localhost 0/0/1 1
    und nichts passiert :-(
    Zuletzt geändert von mode; 11.08.2017, 23:56.

    Kommentar


      #3
      Ok gelöst! :-)

      Code:
      systemctl edit --full knxd
      Dort habe ich die Zeile
      Code:
      ExecStart=/usr/bin/knxd $KNXD_OPTS
      gefunden.
      Scheinbar ist die Variable bei mir leer
      Daher habe ich die Zeile durch
      Code:
      ExecStart=/usr/bin/knxd /etc/knxd.conf
      ersetzt und der knxd startet schon mal :-)

      Wie kann man dies "schön" lösen und die Variable füllen?
      In der alten Welt wird die $KNXD_OPTS Variable in der /etc/knxd.conf gesetzt.
      Da die /etc/knxd.conf jetzt aber die Config im ini Format enthält, ist dies nicht mehr der Fall. Ausserdem aktzeptiert knxd ja ab sofort nur noch den Pfad zur Config im Ini Format und keine direkten Paraemeter mehr. Ist das Startup Script ggfs. nicht auf die neue Konfig eingestellt?


      Jetzt komme ich mit dem groupwrite noch nicht weiter
      Code:
       sudo /usr/bin/knxtool groupwrite ip:localhost 0/0/1 1
      Open failed: Connection refused
      ETS Monitor läuft über den knxd

      Was genau muss ich an der Konfig des knxd jetzt noch anpassen damit knxtool funktioniert?

      LG

      mode

      Kommentar


        #4
        So letzter Stand vor Bettchen.

        Meine knxd.conf sieht nun so aus
        Code:
        [A.tcp]
        server = knxd_tcp
        systemd-ignore = true
        [C.tpuarts]
        device = /dev/ttyUSB_KNX
        driver = tpuart
        [debug-server]
        name = mcast:knxd
        [debug-tunnel]
        trace-mask = 0x0
        [main]
        cache = B.cache
        addr = 1.1.251
        client-addrs = 1.1.251:3
        connections = server,A.tcp,C.tpuarts
        systemd = systemd
        [server]
        debug = debug-server
        discover = true
        server = ets_router
        tunnel = tunnel
        [tunnel]
        debug = debug-tunnel

        Ports für Routing und Tunneling sind offen
        Code:
        sudo netstat -l -n -p | grep knx
        tcp        0      0 0.0.0.0:6720            0.0.0.0:*               LISTEN      5049/knxd
        udp        0      0 0.0.0.0:3671            0.0.0.0:*                           5049/knxd
        Knxtool mag noch immer nicht
        Code:
         knxtool groupswrite ip:localhost 1/1/80 1
        Connect failed: Connection reset by peer

        LG

        mode

        Kommentar


          #5
          knxd.conf war noch nie eine .ini-Datei. Wieso speicherst du die nicht in "/etc/knxd.ini" und setzt KNXD_OPTS darauf?

          Du hast nur zwei freie Adressen, die frisst der ETS wahrscheinlich auf. Gib ihm mal ein paar mehr. Wenn das nix hilft, mach Logging an.
          DistKV, Home Assistant, 1wire, KNX, Python, Asterisk, SMD-Lötkolben

          Kommentar


            #6
            Hallo Smurf, vielen Dank für die Antwort am frühen Morgen.
            Hab jetzt die .conf und .ini Files geordnet. Nun läuft alles wie gewünscht:

            Anbei noch für die Nachwelt als kleines HowTo:

            Code:
            cat /etc/knxd.conf
            # configuration for knxd.service
            KNXD_OPTS="/etc/knxd.ini"

            Code:
            cat /etc/knxd.ini
            [A.tcp]
            server = knxd_tcp
            systemd-ignore = true
            [C.tpuarts]
            device = /dev/ttyUSB_KNX
            driver = tpuart
            [debug-server]
            name = mcast:knxd
            [debug-tunnel]
            trace-mask = 0x0
            [main]
            cache = B.cache
            addr = 1.1.240
            client-addrs = 1.1.240:8
            connections = server,A.tcp,C.tpuarts
            systemd = systemd
            [server]
            debug = debug-server
            discover = true
            server = ets_router
            tunnel = tunnel
            [tunnel]
            debug = debug-tunnel
            Code:
            systemctl status knxd.service
            ● knxd.service - KNX Daemon
               Loaded: loaded (/etc/systemd/system/knxd.service; enabled; vendor preset: enabled)
               Active: active (running) since Sat 2017-08-12 10:51:04 CEST; 10min left
             Main PID: 1613 (knxd)
                Tasks: 1 (limit: 4915)
               Memory: 1.7M
                  CPU: 26ms
               CGroup: /system.slice/knxd.service
                       └─1613 /usr/bin/knxd /etc/knxd.ini
            
            Aug 12 10:51:03 ubuntu systemd[1]: Starting KNX Daemon...
            Aug 12 10:51:04 ubuntu systemd[1]: Started KNX Daemon.

            Code:
            systemctl status knxd.socket
            ● knxd.socket - KNX Daemon (socket)
               Loaded: loaded (/etc/systemd/system/knxd.socket; enabled; vendor preset: enabled)
               Active: active (running) since Sat 2017-08-12 10:39:05 CEST; 2min 3s ago
               Listen: /var/run/knx (Stream)
                       [::]:6720 (Stream)
            
            Aug 12 10:39:05 ubuntu systemd[1]: Listening on KNX Daemon (socket).
            Code:
            netstat -lnp | grep knx
            udp        0      0 0.0.0.0:3671            0.0.0.0:*                           1613/knxd
            unix  2      [ ACC ]     STREAM     HÖRT         16540    1/init               /var/run/knx
            Dass hier nicht auf Port 6720 gehört wird, ist scheinbar normal da wir auf den Socket /var/run/knx hören und knxd.socket im Bedarfsfall von Port 6720 auf den Socket weiterleitet?!?

            Code:
            knxtool groupswrite ip:localhost 1/1/80 1
            Send request
            --> Licht an


            Eine Frage noch: Wie viele "Verbindungen zieht sich die ETS im Bus Monitormodus denn? Gestern lag das nicht senden können wahrscheinlich wirklich daran dass ich nur 3 Verbindungen hatte und der ETS Busmonitor lief...

            Vielen Dank Smurf für die tolle Arbeit!


            lg

            Mode

            Kommentar


              #7
              Die ETS zieht zwei oder drei Verbindungen. Du hattest nur zwei (die eigene Adresse (-e) wird übersprungen).
              DistKV, Home Assistant, 1wire, KNX, Python, Asterisk, SMD-Lötkolben

              Kommentar


                #8
                Zitat von mode Beitrag anzeigen
                Code:
                 
                 netstat -lnp | grep knx
                Dass hier nicht auf Port 6720 gehört wird, ist scheinbar normal da wir auf den Socket /var/run/knx hören und knxd.socket im Bedarfsfall von Port 6720 auf den Socket weiterleitet?!?
                Nein, keine Weiterleitung. Versuch es mal mit "grep 6720", dann siehst du, dass der TCP Socket dem init Prozess gehört - wenigstens auf meinem System ist das so.
                EIB/KNX, VISU mit knxd + linknx + knxweb, Steuerbefehle via SMS und Email mit postfix + procmail

                Kommentar


                  #9
                  Code:
                  sudo netstat -lnp | grep 6720
                  tcp6       0      0 :::6720                 :::*                    LISTEN      1/init
                  Indeed, komisch aber dass dort angeblich nur auf allen IPv6 Adressen gelauscht wird. Ich habe hier garkein IPV6 im Einsatz. Und es funktioniert ja mit IPv4. Hast du eine Idee warum dass so ist?

                  Kommentar


                    #10
                    Linux verwendet denselben Socket für IPv4 und IPv6, wenn man einen IPv6-Socket anlegt und auf ankommende Verbindungen lauscht (so man das nicht explizit verbietest, wofür es keinerlei Grund gibt).
                    DistKV, Home Assistant, 1wire, KNX, Python, Asterisk, SMD-Lötkolben

                    Kommentar

                    Lädt...
                    X