Announcement

Collapse
No announcement yet.

Shutdown plugin Airplayspeak (Linux)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Shutdown plugin Airplayspeak (Linux)

    This issue was there is hs3. I remember seeing something about the shutdown process here..

    so i guess i should put it here... this is the log from the console view :


    Code:
    [02:56:13:3683:[Shutdown]->-------------------------------------------------------------------
    02:56:13:3684:[Shutdown]-> HomeSeer Successfully Shut Down Now
    02:56:13:3685:[Shutdown]->-------------------------------------------------------------------
    HomeSeer Linux has shut down.
    Error in avahi-sharp event loop: System.Threading.SynchronizationLockException: Object synchronization method was called from an unsynchronized block of code.
    at (wrapper managed-to-native) System.Threading.Monitor.Exit(object)
    at Avahi.Client.PollLoop () [0x00026] in <fb88040940de4728bee4f76c4c09c2b5>:0
    mono_os_mutex_trylock: pthread_mutex_trylock failed with "Invalid argument" (22)

    spud

    #2
    moved to correct forum
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Forgot to mention it, but in version Beta 3.0.0.14 I fixed the shutdown of the plugin.

      Comment


        #4
        Thanks Spud !!

        Comment


          #5
          I do not see the beta 3.0.0.14 in the updater(Linux)

          Comment


            #6
            spud Hi Spud, did you sent the update for linux too? In the updater ? I can also install mannually if you prefer.

            thanks

            Comment


              #7
              there is a problem with the dev portal, for some reason it does not send the linux beta version to the updater (only the windows one)

              attached are the files to install manually.
              Attached Files

              Comment


                #8
                it does not work

                ./hs3stop.sh
                { "Response":"ok" }
                1153 /usr/bin/mono /HomeSeer/HSConsole.exe --log
                2448 /usr/bin/mono /HomeSeer/HSPI_EasyTrigger.exe
                2506 /usr/bin/mono /HomeSeer/HSPI_ZWave.exe
                2865 /usr/bin/mono /HomeSeer/HSPI_AIRPLAY_SPEAK.exe
                2926 /usr/bin/mono /HomeSeer/HSPI_PUSHOVER.exe
                3019 /usr/bin/mono /HomeSeer/HSPI_ULTRALOG3.exe
                3043 /usr/bin/mono /HomeSeer/HSPI_LutronCaseta.exe
                3067 /usr/bin/mono /HomeSeer/HSPI_HSBuddy.exe
                3226 /usr/bin/mono /HomeSeer/HSPI_SqueezeBox.exe
                3241 /usr/bin/mono /HomeSeer/HSPI_Big5.exe
                3281 /usr/bin/mono /HomeSeer/HSPI_SKWARE_DEVICE_HISTORY.exe
                3316 /usr/bin/mono /HomeSeer/HSPI_MyHSToken.exe
                1153 /usr/bin/mono /HomeSeer/HSConsole.exe --log
                2506 /usr/bin/mono /HomeSeer/HSPI_ZWave.exe
                2865 /usr/bin/mono /HomeSeer/HSPI_AIRPLAY_SPEAK.exe
                3316 /usr/bin/mono /HomeSeer/HSPI_MyHSToken.exe
                1153 /usr/bin/mono /HomeSeer/HSConsole.exe --log
                2865 /usr/bin/mono /HomeSeer/HSPI_AIRPLAY_SPEAK.exe
                2865 /usr/bin/mono /HomeSeer/HSPI_AIRPLAY_SPEAK.exe
                2865 /usr/bin/mono /HomeSeer/HSPI_AIRPLAY_SPEAK.exe
                2865 /usr/bin/mono /HomeSeer/HSPI_AIRPLAY_SPEAK.exe
                2865 /usr/bin/mono /HomeSeer/HSPI_AIRPLAY_SPEAK.exe
                2865 /usr/bin/mono /HomeSeer/HSPI_AIRPLAY_SPEAK.exe
                2865 /usr/bin/mono /HomeSeer/HSPI_AIRPLAY_SPEAK.exe
                2865 /usr/bin/mono /HomeSeer/HSPI_AIRPLAY_SPEAK.exe
                2865 /usr/bin/mono /HomeSeer/HSPI_AIRPLAY_SPEAK.exe


                each line = 5 secs . The plugin still takes 1 min to shutdown


                here is the content of ./hs3stop.sh


                Code:
                 cat hs3stop.sh
                #!/bin/sh
                # hs3stop.sh - stop the HS3 application
                # supports: systemd service shutdown
                
                # import login credentials used to login to web server
                # these are ignored if password not required
                inifile=$(dirname $0)/Config/$(basename $0 .sh).ini
                login=
                test -r $inifile && . $inifile
                
                # extract web server port from settings.ini
                hs3root=$(dirname $0)  # where this script lives
                webport=$(awk -F= '\
                {
                    gsub("\015", "") # remove CR character
                    if ($1 == "gWebSvrPort") print $2
                }
                ' $hs3root/Config/settings.ini)
                
                # send application shutdown command
                for i in $(seq 1 5)
                do
                   /usr/bin/curl 'http://127.0.0.1:$webport/JSON?request=runevent&id=11'
                    sleep 6
                    curl -f -s -o /dev/null ${login:+-u} $login -X POST -F 'scriptcmd=hs.shutdown()' -F 'runscript=Execute Command' "http://127.0.0.1:$webport/ControlPanel"
                    rc=$?
                    test $rc -eq 0 && break
                    sleep 2
                done
                
                # if curl cmd unsuccessful, terminate main process
                test $rc -ne 0 -a -n "$MAINPID" && kill $MAINPID
                
                # delay until all HomeSeer mono processes terminate
                mono=$(which mono) || exit
                while pgrep -af $mono.'*'\(HSConsole\|HomeSeer\)
                do
                    sleep 5
                done

                Comment


                  #9
                  spud Hi,

                  do you think there will be any update on this? Thanks

                  Comment


                    #10
                    stopping the avahi-daemon service at every shutdown did the trick with : systemctl stop avahi-daemon . Now hs takes 20s to shutdown instead of 60s.

                    Comment

                    Working...
                    X