Announcement

Collapse
No announcement yet.

Restarting Homeseer on Linux - is systemctl restart ok?

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

    Restarting Homeseer on Linux - is systemctl restart ok?

    Hello,

    I am running homeseer on Ubuntu 18.04 and I was wondering if it is ok/safe to restart homeseer running under systemd using the systemctl restart command?

    Thanks!

    Mitch

    Sent from my SM-N950U using Tapatalk


    #2
    Depends on your systemd script. HS3 doesn't behave as a proper service application in that it doesn't perform a clean shutdown upon receipt of SIGTERM -- instead it exits instantly.

    See https://forums.homeseer.com/forum/ho...ge#post1250541

    The homeseer.service script, in conjunction with the hs3stop.sh script will do what you want.

    Comment


      #3
      Mitch,

      I am also running HomeSeer on Ubuntu 18.04. You should be OK using systemctl restart, just make sure that there is a long enough timeout in the systemd HomeSeer unit definition to let HomeSeer shut down on its own. The potential issue is that it doesn't shut down before the timeout and systemd will kill it, which could result in database problems. Although I've never had this happen and I used to use systemctl to shut it down all the time.

      To be extra safe I usually manually shut it down. I start it with screen so that I can connect via screen and do the shutdown from the console. Then I know it has shut down properly.

      This is what my HomeSeer.service unit file looks like:

      Code:
      [Unit]
      Description=HomeSeer
      After=network.target
      
      [Service]
      WorkingDirectory=/usr/local/HomeSeer
      ExecStart=/usr/bin/screen -S HomeSeer -d -m ./go
      ExecStop=/usr/local/HomeSeer/stop_homeseer.sh
      TimeoutStopSec=120
      Type=forking
      
      [Install]
      WantedBy=multi-user.target
      Bill

      Comment


        #4
        Thanks to you both! I will be modifying my .service script to support properly shutting down now. I also see on that thread zwolfpack posted that someone got the Razberry zwave board working -- now I'll have to go look at that since I have one on a spare Rpi laying around.

        Comment


          #5
          this is how I do it :

          /hs3.service:


          Code:
          [Unit]
          Description=HomeSeer HS3 Home Automation Server
          After=network.target
          
          [Service]
          WorkingDirectory=/HomeSeer
          ExecStart=/usr/bin/mono /HomeSeer/HSConsole.exe --log
          ExecStop=/HomeSeer/stop_homeseer.sh
          Restart=on-failure
          TimeoutStopSec=90
          
          [Install]
          WantedBy=multi-user.target
          /HomeSeer/stop_homeseer.sh :

          Code:
          #!/bin/bash
          /usr/bin/curl  'http://127.0.0.1/LinuxTools' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'ConfirmShutdownhs=Yes' --compressed
          sleep 30s

          Comment


            #6
            Looking at stop_homeseer.sh and hs3stop.sh I realize I need to do some serious studying up on curl! LOL
            Thanks!

            Comment

            Working...
            X