Autoshutdown and TVHeadend SleepScript wont work

    • OMV 3.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Autoshutdown and TVHeadend SleepScript wont work

      Hello,

      on my NAS i got TVHeadend and autoshutdown plugin.
      When nobody use the NAS it goes sucessfully in suspend-hybrid...

      But when i wake up the NAS TVHeadend wont work.

      So i have this script which works perfectly when i go over Terminal in suspend-hybrid and wake up. But when it goes with autoshutdown in suspend it wont work.

      Here the script:

      Display Spoiler

      case "$1" in
      hibernate|suspend)
      /etc/init.d/tvheadend stop
      modprobe -r cx23885
      ;;
      resume|thaw)
      sleep 1
      modprobe cx23885
      /etc/init.d/tvheadend start
      ;;
      *)
      ;;
      esac


      Can someone help me why it wont work with ASD??

      The script is in: /etc/pm/sleep.d
    • What version of Debian is this install?
      The pm-utils folder scripts still works in Jessie+, but systemd also provides a facility for this.
      From the script I see is missing the shebang at the beginning. The rest seems ok.
      Have you checked the pm-suspend log?
      New wiki
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • Sorry that was wrong from me.
      My Version is OMV 3.0.86 which based on Debian 8.

      When i test it with inid or systemctl to stop tvheadend and suspend the modul in Terminal it works.
      When it goes in suspend from autoshutdown plugin in both things it wont stop and start.

      After wake up, TVH is not available.

      In Extra options there is only: TEMPPROCNAMES="-"

      PM is activate on server. Dont know why it only goes in Terminal and not with the plugin
    • Hello everybody,
      I have a similar problem and even with searching the forums I am not able to fix it. I am using TV Headend on OMV 3.0, everything works fine without suspending. Since there were some problems on pm-suspend with tvheadend and the dvr card I had to create a script in /etc/pm/sleep.d and define the suspend modules, I come across this in another Forum (forum.kodi.tv/showthread.php?tid=125819).

      After I set everything up, I tested it with pm-suspend in ssh, everything worked. But when it is suspending the Autoshutdown Addon, it is not working. Some of my approaches:

      1. Adding the script as well to /usr/lib/pm-utils/sleep.d

      --> Not working

      2. SHUTDOWNCOMMAND="systemctl suspend"

      --> TV-Headend is still working but somehow the DVR Card is gone.

      Since I read here (autoshutdown-plugin prevents execution of anacron after suspend) that the Autoshutdown Addon is using a different version of pm-suspend, it would help me a lot if I just can make it, take the one I am executing in ssh. I searched for it in all the scripts but I didn't find anything.


      After a long search, it would be very helpful if anyone could help me or give me a hint on that! :)
    • Interesting. I was facing the problem the last days and couldn't find a solution (till today - read the next words). I was trying hibernation, hybrid-hibernation and suspend but no chance to get the service-script to work.
      After suspend tvheadend complies that there's no free adapter available. That means before suspend/hiberantion... the modules for the TV-card are unloaded but not loaded after resume.
      I also tried to use a script unter "pm-utils". This worked but only when you send the server via command line to suspend. So I found out that the "Autoshutdown-Plugin is the reason for that.
      During searching for a solution I found this posting here. So I made this changes under

      Source Code

      1. /etc/systemd/system/oscam.service

      and also the changes in

      Source Code

      1. usr/share/openmediavault/mkconf/autoshutdown
      and after a reboot everything worked like a charm. Of course I had to make the service under


      Source Code

      1. /etc/systemd/system/
      again.


      @RainerUwe

      What kind of tv-card are you using?

      @ryecoaaron

      You posted here that you committed this changes. Unfortunately they're not in the Autoshutdown-Plugin (I use OMV v4 with all the latest updates and the ASP from the omv-extra-Repo). Also the others changes there are not in the ASP. Would you be so kind and update the ASP so that these problems here are gone?

      Thanks in advance
      OMV-Server-HW: MoBo Fujitsu D3417-B2 (Intel-LAN), Intel Xeon E3-1245 v6 Kaby Lake (4x3.70GHz), 16GB-Ram ECC UDIMM, 1x512GB SSD Samsung 850 Pro (sda2 - 30GB system, 4GB swap, sda5/rest - for work), 4x3TB WD Red's Snapraid w/ mergerfs, 2x DVB-S2 card DVBSky s952v3,

      OMV-Server-SW: Debian Stretch with 4.15.x-Backports-Kernel (always up-to-date), OMV 4.1.x (always latest), omv-extras-plugin (always latests), AutoShutdown-Plugin, Virtualbox (with DSM 6.1.x), PlexMediaServer, SMB-Shares, TVHeadendServer (unstable release)

      BackupServer: Synology DS1010+ with 4GB Ram, 9TB@SHR (different hdd's), DSM 5.2-5967-2
    • @Huberer Thank you!


      I made those changes and in the autoshutdown log, I can see, that it is now using 'systemctl suspend' as shutdown command. After I send a wol it woke up and to my surprise this time TV-Headend was running. Before the modification, this was not the case. So I tried to watch something, and then got the following errors:


      2018-02-17 mpegts: 11347V in Astra 19.2 - tuning on Montage Technology M88RS6000 : DVB-S #0
      2018-02-17 diseqc: failed to set voltage (e=No such device or address)
      (My TV-Card is DVBSky S952 V3)


      For pm-utils I had to define "SUSPEND_MODULES" which I found using "lsmod | grep dvb" (which were in my case "dvb-core rc_dvbsky rc_core"). With this modification, I could easily, watch something from TV-Headend, send a pm-suspend(via ssh), send wol, continue watching (i repeated that several times).


      It is strange for me that, after pm-suspend from autoshutdown-plugin, tv-headend was not avaliable and 'lsmod | grep dvb' had an empty output. After the modification, I made TV-Headend is available and 'lsmod | grep dvb' is returning the modules as if they were oke. You mentioned that you had setup scripts under 'pm-utils', is there maybe a different source now for systemctl and I have to suspend the modules in a different way.


      In fact, I tested, after autoshutdowns systemctl suspend I send a wol, tested tv_headend stream (not working with the already mentioned error), executed pm-suspend from terminal, send wol, tested tv_headend stream --> and it worked!


      At the moment I am very confused, it would be very nice if you could help me with that.
    • @RainerUwe

      delete the old stuff in pm-utils and I guess you're speaking german so have a look here. Your error means that tvheadend is loaded but not the modules (smipcie, m88rs6000t, m88ds3103 and deb_core).
      This is what works right now for me after the modification of the autoshutdown.service.
      This is how my dvbsky-sleep.service looks like (I use the DVBSky S952 v3 too - see my signature):

      Source Code

      1. [Unit]
      2. Description=Restart tvheadend and dvbsky
      3. Before=suspend.target
      4. StopWhenUnneeded=yes
      5. [Service]
      6. Type=oneshot
      7. RemainAfterExit=yes
      8. ExecStart=/bin/systemctl stop tvheadend.service ; /sbin/modprobe -r smipcie m88rs6000t m88ds3103 dvb_core
      9. ExecStop=/sbin/modprobe smipcie m88rs6000t m88ds3103 dvb_core ; /bin/systemctl start tvheadend.service
      10. [Install]
      11. WantedBy=suspend.target
      Display All




      As you can see I use suspend.target instead of sleep.target (the script in the above link) because I use suspend under ASP.
      With

      Source Code

      1. systemctl enable dvbsky-sleep.service
      you can enable the service. Afterwards do a reboot.
      This works right now after (at least) 100.000 failed tests (because of this wrong settings in the autoshutdown.service).
      OMV-Server-HW: MoBo Fujitsu D3417-B2 (Intel-LAN), Intel Xeon E3-1245 v6 Kaby Lake (4x3.70GHz), 16GB-Ram ECC UDIMM, 1x512GB SSD Samsung 850 Pro (sda2 - 30GB system, 4GB swap, sda5/rest - for work), 4x3TB WD Red's Snapraid w/ mergerfs, 2x DVB-S2 card DVBSky s952v3,

      OMV-Server-SW: Debian Stretch with 4.15.x-Backports-Kernel (always up-to-date), OMV 4.1.x (always latest), omv-extras-plugin (always latests), AutoShutdown-Plugin, Virtualbox (with DSM 6.1.x), PlexMediaServer, SMB-Shares, TVHeadendServer (unstable release)

      BackupServer: Synology DS1010+ with 4GB Ram, 9TB@SHR (different hdd's), DSM 5.2-5967-2
    • Huberer wrote:

      Would you be so kind and update the ASP so that these problems here are gone?
      As with all changes to the script in that plugin, I don't have a way to test. So, if you could test and report back, I will update the repo.
      omv 4.1.8.2 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.8
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please read this before posting a question.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      Huberer wrote:

      Would you be so kind and update the ASP so that these problems here are gone?
      As with all changes to the script in that plugin, I don't have a way to test. So, if you could test and report back, I will update the repo.
      @ryecoaaron

      After some days of testing I can say that with these changes here and here (the others I haven't tested because of time lack) the Autoshutdown-Plugin runs great. Especially the changes from the first link are top because they made it possible to run my own script in /etc/systemd/system.

      I guess that the other posted changes are also good to be updated.

      Would you be so kind and update the plugin with all the commits?

      Thanks in advance
      OMV-Server-HW: MoBo Fujitsu D3417-B2 (Intel-LAN), Intel Xeon E3-1245 v6 Kaby Lake (4x3.70GHz), 16GB-Ram ECC UDIMM, 1x512GB SSD Samsung 850 Pro (sda2 - 30GB system, 4GB swap, sda5/rest - for work), 4x3TB WD Red's Snapraid w/ mergerfs, 2x DVB-S2 card DVBSky s952v3,

      OMV-Server-SW: Debian Stretch with 4.15.x-Backports-Kernel (always up-to-date), OMV 4.1.x (always latest), omv-extras-plugin (always latests), AutoShutdown-Plugin, Virtualbox (with DSM 6.1.x), PlexMediaServer, SMB-Shares, TVHeadendServer (unstable release)

      BackupServer: Synology DS1010+ with 4GB Ram, 9TB@SHR (different hdd's), DSM 5.2-5967-2
    • Huberer wrote:

      Would you be so kind and update the plugin with all the commits?
      Done.
      omv 4.1.8.2 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.8
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please read this before posting a question.
      Please don't PM for support... Too many PMs!
    • Thank you
      OMV-Server-HW: MoBo Fujitsu D3417-B2 (Intel-LAN), Intel Xeon E3-1245 v6 Kaby Lake (4x3.70GHz), 16GB-Ram ECC UDIMM, 1x512GB SSD Samsung 850 Pro (sda2 - 30GB system, 4GB swap, sda5/rest - for work), 4x3TB WD Red's Snapraid w/ mergerfs, 2x DVB-S2 card DVBSky s952v3,

      OMV-Server-SW: Debian Stretch with 4.15.x-Backports-Kernel (always up-to-date), OMV 4.1.x (always latest), omv-extras-plugin (always latests), AutoShutdown-Plugin, Virtualbox (with DSM 6.1.x), PlexMediaServer, SMB-Shares, TVHeadendServer (unstable release)

      BackupServer: Synology DS1010+ with 4GB Ram, 9TB@SHR (different hdd's), DSM 5.2-5967-2
    • @ryecoaaron

      I read in another forum that there're still problems with the ASP under OMV v3 (no updated commits). Did you only updated the plugin under OMV v4? I can't test because my server is running under OMV v4.
      OMV-Server-HW: MoBo Fujitsu D3417-B2 (Intel-LAN), Intel Xeon E3-1245 v6 Kaby Lake (4x3.70GHz), 16GB-Ram ECC UDIMM, 1x512GB SSD Samsung 850 Pro (sda2 - 30GB system, 4GB swap, sda5/rest - for work), 4x3TB WD Red's Snapraid w/ mergerfs, 2x DVB-S2 card DVBSky s952v3,

      OMV-Server-SW: Debian Stretch with 4.15.x-Backports-Kernel (always up-to-date), OMV 4.1.x (always latest), omv-extras-plugin (always latests), AutoShutdown-Plugin, Virtualbox (with DSM 6.1.x), PlexMediaServer, SMB-Shares, TVHeadendServer (unstable release)

      BackupServer: Synology DS1010+ with 4GB Ram, 9TB@SHR (different hdd's), DSM 5.2-5967-2
    • Huberer wrote:

      I read in another forum that there're still problems with the ASP under OMV v3 (no updated commits). Did you only updated the plugin under OMV v4?
      I did only update the v4 plugin. Because I don't use this plugin, I have no idea when the changes work on OMV 3.x as well. Just because they are both systemd doesn't mean the solution works. I would also think any OMV 3.x version issues would have been mentioned by now? Posts on another forum will never be seen by someone who can make changes.
      omv 4.1.8.2 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.8
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please read this before posting a question.
      Please don't PM for support... Too many PMs!