[SOLVED] autoshutdown only works once

  • Hi,


    I have kinda weired problem with the autoshutdown plugin. It is configured to suspend the server via pm-suspend.


    - On a fresh booted system it works nicely.
    - If I pm-suspend the system via cli command the autoshutdown still works.
    - However, when the script has suspended the OMV server for the first time and I wake the server up again, the script doesn't work any more. It is not even running (checked with ps -ef). I can't find anything in the logs.
    And BTW, a friend of mine sees exactly the same behaviour.


    Well, still to mention, I am running OMV 0.4, with latest updates installed.


    Thanks, Chris


    For reference, here is my /etc/autoshutdown.conf

  • Hmmmm, the script exits at shutdown/suspend and it doesn't restart at wakeup, thats right.
    I'll add a cronjob or start script to do that. I just have to think about it, whats the best solution.


    We have 2 options:
    1. check every x min, if the script is running and restart it if neccessary
    2. loop the script after shutdown/suspend -> shutdown/suspend and after x min, begin new (like at the start of the script)


    Which one do you prefer?
    CU

  • Hi Solo,


    thanks for your quick response.


    Well I had a similar problem some time ago with a self installed function. I solved it with a tiny script in the path /etc/pm/sleep.d
    The script would just issue a restart of the autoshutdown daemon. Only problem, you need to have pm-utils installed, not sure if this is a dependency of the plugin today.


    Other than that I would prefer option 2.
    Thanks

  • Can you please paste the script here? Thx
    Maybe we can add it to ASD. I thought of something like this in /etc/pm/sleep.d:
    #!/bin/sh
    /usr/local/bin/autoshutdown.sh
    exit 0


    Do we have to name it with "S" or "K"? If someone wants to use hibernate / sleep, then pm-utils must be installed afair.

  • Yes this is the script you need to make it work. No more no less :)


    For hibernate purposes I think it's the same. As far as I understand the pm-utils docu /etc/pm/sleep.d hooks will run after resume from supend. No matter if it was a suspend to RAM or suspend to disk, but haven't tried it myself since waking up from hibernation is not propperly configured on my system.


    Not sure what "ASD" and "Do we have to name it with "S" or "K" " means... :-/

  • ASD = AutoShutDown ;)


    for "S.." and "K.." look here:

    Zitat

    In each run-level you will find a series of if links pointing to start-up scripts located in /etc/init.d. The names of these links all start as either K or S, followed by a number. If the name of the link starts with an S, then that indicates the service will be started when you go into that run level. If the name of the link starts with a K, the service will be killed (if running).

    -> Link

  • Oh my goodness, I love abbreviations ;)


    Not sure why you are thinking about runlevels. But I am not at all enough into runlevels at all.


    So let me conclude my proposal, which I just tested a minute ago:


    - add the package pm-utils to the dependecies of openmediavault-autoshutdown
    - add a file to the ASD package, path is: /etc/pm/sleep.d
    - a self explaining file name would be something like: autoshutdown_restart
    - trigger "chmod 755 autoshutdown_restart"
    - the content of that file that I just tested was:

    Zitat

    #!/bin/bash
    sudo /etc/init.d/autoshutdown restart
    exit

  • As we already have a daemon for starting autoshutdown, this is looking fine. Adding pm-utils for autoshutdown is a question i have to discuss with marcelbeck.


    I'll try that script over the weekend. RL keeps me busy atm.
    Sorry

  • Sure, no problem for me. It does work on my system now, but I thought it should do for all other users as well.


    Just one more remark. Everybody who wants to use suspend or hibernation mode will need pm-utils to be installed. So I think the overhead installing this is not too big.


    Thanks

  • Hello,


    I'm using a script in /etc/pm/sleep.d its called autoshutdown.



    the problem is, it restarts with no issues, but it is not using /etc/autoshutdown.conf.... even if it says it does.
    no connections are recognized, so it is shutting down after the selected cycles. Does anyone else have the same problem?


    EDIT:
    I've checked again, and the problem also occurs on normal startup. The ASD script is only working correctly if I use the WebGUI and save the ASD settings. Then it waits for 5 minutes and is checking for connections. Otherwise it waits 5 minutes and doesn't find any connections and is shutting down after the selected cycles....
    there must be a way to load a specified conf file, because it looks like the script is searching for the conf file, is finding it but is not reading the settings from the conf file, or am I wrong?

    OMV 6.x with bpo Kernel running on:
    Board: ASRock H410M-ITX and Intel Pentium G6400T
    RAM: 16GB DDR4-3000 Corsair
    Case: Coolermaster Elite 120 Advanced
    HDD: 1x 250GB NVME SSD Transcend and 2x 6TB 3.5" Seagate IronWolf ST6000VN001 + 1x 4TB 3.5" Seagate ST40000VN008

  • @Solo
    I dont know exactly how i fixed it.
    But i added the NETSTATWORD="verbunden" and edited my conf File in /etc/autoshutdown.conf to my Ports and cycles.


    Now everything is working like it should. Except, forked-daapd, but that's not so bad...


    Thanks anyway. Have a nice evening

    OMV 6.x with bpo Kernel running on:
    Board: ASRock H410M-ITX and Intel Pentium G6400T
    RAM: 16GB DDR4-3000 Corsair
    Case: Coolermaster Elite 120 Advanced
    HDD: 1x 250GB NVME SSD Transcend and 2x 6TB 3.5" Seagate IronWolf ST6000VN001 + 1x 4TB 3.5" Seagate ST40000VN008

  • The Problem is not between forked-daapd and the autoshutdown Script. Because the Port is 3689 and is Entered in the Script.


    Its a Problem with forked-daapd itself, its not working with Remote 3.0 iPhone/iPad App, it Shows up in the app but if you try to Start the Playback it Stops immediatly. There is a fix in github.com but i dont know how to implement the fix to my Version, nor i can Compile a New Version from github. Allways getting errors with libavcodec and avio_buffer or something like this... im not at home right now to Check the right error.


    Would be nice if someone else with more Knowledge about compiling under Linux than me, could handle this. But it looks like there are not many Out there using the daapd function:(

    OMV 6.x with bpo Kernel running on:
    Board: ASRock H410M-ITX and Intel Pentium G6400T
    RAM: 16GB DDR4-3000 Corsair
    Case: Coolermaster Elite 120 Advanced
    HDD: 1x 250GB NVME SSD Transcend and 2x 6TB 3.5" Seagate IronWolf ST6000VN001 + 1x 4TB 3.5" Seagate ST40000VN008

  • I'll update the script on github and then give you infos how to update yours tomorrow.


    Edit:
    Please try this script attached to this post and report back, if it is working after suspend/hibernate
    you need only the new autoshutdown.sh and /etc/pm/sleep.d/autoshutdown-restart. Extract and copy the files to the location:

    Code
    tar xfvz autoshutdown_v0.3.4.3.tar.gz 
    mkdir /etc/pm/sleep.d/
    cp usr/local/bin/autoshutdown.sh /usr/local/bin
    cp etc/pm/sleep.d/autoshutdown-restart /etc/pm/sleep.d/


    See the README for more infos about new features

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!