Autoshutdown: No valid network interface found

  • I also deleted the spaces as you told me in FORCE_NIC and I had the same problem again as if there was no entry.


    cat /sys/class/net/enp3s0/operstate also says "up". All services (ssh, SMB, ...) work.


    Here is the log output:


  • I changed the /lib/systemd/system-sleep/autoshutdown-restart as you described it in #20 and deleted the entry in FORCE_NIC. After restarting the machine it worked without any problem (green point in the dashboard). The NAS shut down and restarted, but in the dashboard there is now the well known red point and no logging any more in the logfile of the plugin.


    What else can I do or test?

  • I wanted to clarify my post in # 22 again: The change with "sleep 30" meant that after booting the whole thing only worked once. After booting, the point in the dashboard was green and the plugin worked (log file was written), then shutdown automatically after all conditions were met. After waking up, however, the point is red and the plug-in does not work again, nothing is written to the log file either. Not even that the network was not found, absolutely nothing.


    Sorry that my explanation in # 22 may not have been entirely clear.

  • Ok, well I think this showed what I needed it needed a delay to allow the service to restart. I now think i have a fix. Yo need to remove the sleep code from autoshutdown-restart. To get the original version of the file do the following:

    Code
    wget https://raw.githubusercontent.com/OpenMediaVault-Plugin-Developers/openmediavault-autoshutdown/master/lib/systemd/system-sleep/autoshutdown-restart
    sudo cp autoshutdown-restart /lib/autoshutdown-restart

    To test the fix, we use a similar method to above:

    Code
    wget https://raw.githubusercontent.com/nrandon/openmediavault-autoshutdown/suspend_test/usr/sbin/autoshutdown
    sudo cp autoshutdown /usr/sbin/autoshutdown
    sudo systemctl restart autoshutdown.service

    After testing to go back to original:

    Code
    wget https://raw.githubusercontent.com/OpenMediaVault-Plugin-Developers/openmediavault-autoshutdown/master/usr/sbin/autoshutdown
    sudo cp autoshutdown /usr/sbin/autoshutdown
    sudo systemctl restart autoshutdown.service

    Let me now how you get on :) if this work I will commit all the bit and clean it up a little

  • Hi can you check that yuo have execution right on both /usr/sbin/autoshutdown and /lib/systemd/system-sleep/autoshutdown-restart


    if not:

    Code
    sudo chmod +x /usr/sbin/autoshutdown
    sudo chmod +x /lib/systemd/system-sleep/autoshutdown-restart

    Make sure /lib/systemd/system-sleep/autoshutdown-restart also has the correct content i.e. as when downloaded with the wget


    If this above does not fix the issue I will need the verbose log form the new script.


    Note: If there is no log at all something else is up check - sudo journalctl -u autoshutdown.service

  • Ok I found the bug. You shouldn't do tests when you're supposed to go to bed ...


    I copied the file "autoshutdown-restart" into the directory "/lib" and not into "/lib/systemd/system-sleep", where it should actually go (see your post # 26, I didn't notice it right away) .

    Therefore the sleep code was still there. And then one of the two files was not executable this morning. After I changed that, everything works fine with the version at "https://raw.githubusercontent.com/nrandon/openmediavault-autoshutdown/suspend_test/usr/sbin/autoshutdown".


    Will this then correspond to version 5.1.11 of the plugin? Should I go back to the original version at "https://raw.githubusercontent.com/OpenMediaVault-Plugin-Developers/openmediavault-autoshutdown/master/usr/sbin/autoshutdown" or will this be done automatically as part of the next update?


    Thank you very much for your work and your help!

  • Bad news, after suspending over night I had the red light back again. may be yesterday I had another power-safe mode. I used the "stand by" command from the web page, autoshutdown is using suspend....


    so #26 is also NOT working for me

  • hi chris_kmn can you also verify details posted in #30 note the path problem found with /lib/systemd/system-sleep/autoshutdown-restart (see #31). if these are not you problem, I will need verbose logs from the failure to see why it not working.

  • Path is correct and I also gave exec rights to the files.


    after I've activated verbose and deleted the old log, the logfile was empty after restart from suspend (?), service was inactive.


    dmesg log shows interface is up after about 5 secs:


  • and this is the journal log:



    but I will repeat everything one more time...

  • well... I think I misunderstood the problem with the path. I thought Dagobert did the mistake and did not realise that it is a mistake in #26.


    So I copied to the correct path and gave exec rights, suspend-resume and still error, but this time with an error in the log:


  • hi, well i found a problem with the fix also so I am going to have to re-think this. I suspect your using DHCP and the lease expired on the ip or something similar. The timing issues is hard to fix across a set of network devices as I can brick the current fix in a few ways so it not robust. If I make it robust the scrip will take a long time to come online. However it would be no worst then the original i guess. give me a bit to think and see if i can find a better solution.

  • Ok I have got a working solution, to test first re-install the plugin so we start from a clean position, then:

    Code
    wget https://raw.githubusercontent.com/nrandon/openmediavault-autoshutdown/suspend_test/usr/sbin/autoshutdown
    chmod +x autoshutdown
    sudo mv /usr/sbin/autoshutdown /usr/sbin/autoshutdown.orig
    sudo cp autoshutdown /usr/sbin/autoshutdown
    sudo systemctl restart autoshutdown.service

    This script will force VERBOSE mode just in case we need the logs.


    Once tested move the orig if required:

    Code
    sudo mv /usr/sbin/autoshutdown.orig /usr/sbin/autoshutdown

    Hope this work for you.

  • All I can say is that the solution from post # 26 (with corrected path) worked for me.


    I have no more entries in the expert settings and use the "Suspend" entry from the selection menu as a command to shut down. That's how it works. The NAS shuts down fine and there is no longer a red dot. :-)


    However, I wanted to go one step further and switch to the "Suspend-Hybrid" entry, since this will probably not lead to any loss of data in the event of a power failure: https://wiki.archlinux.org/ind…ent#Suspend_and_hibernate


    The log file also says that the kernel supports this. The shutdown command is set to "systemctl hybrid". However, when I enter this command via ssh, I get the error message "Unknown operation hybrid." and nothing happens.


    If, on the other hand, I enter the command "systemctl hybrid-sleep" via ssh (see the above link), it works. Of course, I can also force it with the entry SHUTDOWNCOMMAND = "systemctl hybrid-sleep" in the expert settings.


    But wouldn't it be better if that would also work if you select the appropriate entry?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!