Beiträge von nrand

    hi, this is not all that useful as it the salt output not the service output, but I am not entirely surprised this is not working as I am missing something on your system. The script should have worked as the original failure would kill the script on all systems and we not seeing this. However, this does not mean there is no issue.


    So I going to need a few more bit of info form you, it also possible the script edit you did has an issue.:


    1. Can I have the output form the failed service. this can be obtained from 'sudo journalctl -u autoshutdown.service' this should contain were the script is now failing.


    2. Can I have the output of: 'cat /etc/default/locale' I will mimic your localisation just to see if that the issue.


    3. Less useful but I just what to check: 'bash --version'


    1. Is the most important as i need to know why the script is now falling.

    hmm, this work for me just find however, I really don't like the current _log function. cany you try replacing the current _log function with the following (again you have to edit the /usr/sbin/autoshitdown script by hand:


    Hopefully this will work for you without issues but let see. let me know how you get on.

    Hi, yet this is a bit odd, can I have a copy of your /etc/autoshutdown.conf. Also can you modify the script that is running /usr/sbin/autoshutdown and change line 1 to "#!/bin/bash -x" (you will need to be root to do this) this will show what the script is doing just prior the problem.

    If you had to change two line I have a different solution, which is more compatible with older scripts it turns out.


    Remove the previous fixes and change the following in /usr/sbin/autoshutdown, line 1151.


    Code
    From: '$1 ~ regex && !/SLAVE/ {print $1}')
    
    To: '$1 ~ regex && !/SLAVE/{sub(/@.*/,"",$1); print $1}')

    The script the will now dropped the '@<interface_name>' from the network interface identification throughout the script. For example: 'eth0.42@eth0' would know as 'eth0.42'. This is similar to what it used to do I think. Can you give it a try and double check it form me. If this is good I will get the release out with the fix.


    Thanks again for doing this for me

    Hi systemd would have triggered the restart and the script was trying to check if the interface will get assigned (it has a 60 second timeout). What you are seeing in new behaviour as of v5.1.11. The new behaviour is to fix the restart from suspend and hibernate when using DHCP (and is similar to that of the 4.X version of the script). You can optimise this behaviour using the FORCE_NIC setting (see /etc/autoshutdown.default for more details).


    So I am assuming the script started up and ran autoshutdown (even if a bit slower to start)? Can you confirm it is now working, then i add the fix the a new release. Thanks you for checking this for me

    Hi sorry did not see this till now. I think this is easily fixed please do the following:


    Change the following in /usr/sbin/autoshutdown, line 1126.


    Code
    From: local state; state="$(< "/sys/class/net/${net_iface}/operstate")"
    
    To: local state; state="$(< "/sys/class/net/${net_iface%@*}/operstate")"

    Please let me now if this work for you and if it does I will place the fix in the 5.1.12 release.


    if it does not work I need a bit more info to fix it (hopefully this will not be required). let me know how you get on :)

    Ok here a fix you can apply to 5.1.11 (released today) until the fix is release and it give it a bit of testing.


    Change the following in /usr/sbin/autoshutdown, line 83


    Code
    From: local -r server_ips="${3// /\\|}"
    
    To:   local -r server_ips="^\(${3// /\\|}\)$"


    This should fix it for you. can you confirm if it worked for you or not.

    aha SHUTDOWNCOMMAND="pm-suspend" the script has fully moved to systemd ether set "Suspend" in the GUI or set SHUTDOWNCOMMAND="systemctl suspend". There been a lot of changes to the script and the GUI most setting can be set in the GUI now.


    Hibernate should be similar 'systemctl hibernate' or "hibernate" in the GUI. there still a few issue to fix in the next release


    I wait for you to confirm you are working before I release all the fixed.


    Note: hybrid-sleep (Hybrid in GUI) need a fix in the next release also.

    _ping_range(): pinglist_array: 192.168.178.19 192.168.178.20 192.168.178.21 192.168.178.22 192.168.178.23 192.168.178.24 192.168.178.25 192.168.178.26 192.168.178.27 192.168.178.28 192.168.178.29 192.168.178.30 192.168.178.31 192.168.178.32 192.168.178.33 192.168.178.34 192.168.178.35 192.168.178.36 192.168.178.37 192.168.178.38 192.168.178.39 192.168.178.40 192.168.178.41 192.168.178.42 192.168.178.43 192.168.178.44 192.168.178.45 192.168.178.46 192.168.178.47 192.168.178.48 192.168.178.49 192.168.178.50 192.168.178.51 192.168.178.52 192.168.178.53 192.168.178.54 192.168.178.55'


    it worked for me , so I will need the logs

    hmm this dose not entirely make sense to me but i have issue with NVidia driver before. I do not think this is an interaction between the scrip however it look more like it an NVidia issue directly. However it look as it we have reached a solution that work so that all good.


    I will go about cleaning up the change and getting it ready for a proper release as the script as it is is a bit of a hack to test everting will work. FYI it will not support DHCP addresses no need for static addresses. So this change will form par of the 5.1.11. @Dagobert57 i will also fix the hybrid-sleep issues which is suspect has always been incorrect.


    Let me know if there is anything else (raise a issue in GItHub if you need or spot a problem I will address this ASAP)


    So I will assume this is resolved for now :)

    Ok from the log is look as it the autoshutdown-restart script is not working at all. I would remove any version of this file that you can find on the system and make sure you reinstall autoshutdown from a fresh (as it was working before). The reason I say this is in the log provided there is not entry in the log from the script firing.


    It you what yo make sure you are back as the 5.1.10 autoshutdown, you should back-up you autoshutdown settings. purge the package using apt purge (not you will loss you setting so make sure you backed them up) and reinstall. Mind I am assuming you have not done the above before hand.


    Once installed make sure that autoshutdown-restart is executable and located at /lib/systemd/system-sleep/. Re-apply you autoshutdown setting. To test the scrip work you do not have to have autoshutdown turn of the server. The script should run and log into /var/log/autoshutdown.log that is closed autoshutdown and restarted it after suspend. Something like:


    INFO: 'autoshutdown-restart(): Autoshutdown stopping' - at suspend


    and on restart:


    INFO: 'autoshutdown-restart(): Autoshutdown starting' - at resume


    if these log entry are not there then there is a system issue. Hope that helps

    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.

    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.