Shutdown Timing When Computer “Ignition” Goes Low











up vote
0
down vote

favorite












I'm running ubuntu 18.04.1 LTS on an embedded "automotive" computer that's powered with 12VDC (no AC!). It has 3 power inputs: Power (12V), Ground and something labeled "ignition." When "ignition" goes low, I need the computer to immediately (within 10 seconds) start its shutdown because the 12V will go away shortly (after 30 seconds or so). I assume "ignition" is like a soft power button or maybe laptop closed or something similar.



I used to run Fedora Core 20 and the computer DID automagically shutdown when ignition went low exactly like I needed it to.



With ubuntu 18.04.01, this generally doesn't work in that the shutdown process doesn't happen either at all or at least not until the 12V goes away and the computer shuts off ungracefully without getting to shutdown first.



There are 3 cases with ubuntu 18.04.1 on my computer:
1. Monitor attached, logged in: a dialog with the message "The system will power off automatically in 60 seconds" pops up and starts counting down the 60 seconds. Unfortunately, there's only power for about 30, so it powers off ungracefully without shutting down.
2. Monitor attached, not logged in: computer starts shutdown and shuts down after a few seconds as desired when ignition goes low.
3. Monitor not attached: shutdown doesn't happen (prior to 12VDC going away).



I specifically need to get it to work for case (3.) (Monitor not attached) since there can't be a monitor in the actual embedded application.



Because it works for case (2.), it must be possible but I have no idea what config files to look at or what to change.










share|improve this question






















  • I don't have an Ubuntu to check, but you might find something to configure in /etc/systemd/logind.conf which is part of systemd. See man logind.conf and try setting PowerKeyIgnoreInhibited=yes for case 1.
    – meuh
    Nov 13 at 17:18















up vote
0
down vote

favorite












I'm running ubuntu 18.04.1 LTS on an embedded "automotive" computer that's powered with 12VDC (no AC!). It has 3 power inputs: Power (12V), Ground and something labeled "ignition." When "ignition" goes low, I need the computer to immediately (within 10 seconds) start its shutdown because the 12V will go away shortly (after 30 seconds or so). I assume "ignition" is like a soft power button or maybe laptop closed or something similar.



I used to run Fedora Core 20 and the computer DID automagically shutdown when ignition went low exactly like I needed it to.



With ubuntu 18.04.01, this generally doesn't work in that the shutdown process doesn't happen either at all or at least not until the 12V goes away and the computer shuts off ungracefully without getting to shutdown first.



There are 3 cases with ubuntu 18.04.1 on my computer:
1. Monitor attached, logged in: a dialog with the message "The system will power off automatically in 60 seconds" pops up and starts counting down the 60 seconds. Unfortunately, there's only power for about 30, so it powers off ungracefully without shutting down.
2. Monitor attached, not logged in: computer starts shutdown and shuts down after a few seconds as desired when ignition goes low.
3. Monitor not attached: shutdown doesn't happen (prior to 12VDC going away).



I specifically need to get it to work for case (3.) (Monitor not attached) since there can't be a monitor in the actual embedded application.



Because it works for case (2.), it must be possible but I have no idea what config files to look at or what to change.










share|improve this question






















  • I don't have an Ubuntu to check, but you might find something to configure in /etc/systemd/logind.conf which is part of systemd. See man logind.conf and try setting PowerKeyIgnoreInhibited=yes for case 1.
    – meuh
    Nov 13 at 17:18













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm running ubuntu 18.04.1 LTS on an embedded "automotive" computer that's powered with 12VDC (no AC!). It has 3 power inputs: Power (12V), Ground and something labeled "ignition." When "ignition" goes low, I need the computer to immediately (within 10 seconds) start its shutdown because the 12V will go away shortly (after 30 seconds or so). I assume "ignition" is like a soft power button or maybe laptop closed or something similar.



I used to run Fedora Core 20 and the computer DID automagically shutdown when ignition went low exactly like I needed it to.



With ubuntu 18.04.01, this generally doesn't work in that the shutdown process doesn't happen either at all or at least not until the 12V goes away and the computer shuts off ungracefully without getting to shutdown first.



There are 3 cases with ubuntu 18.04.1 on my computer:
1. Monitor attached, logged in: a dialog with the message "The system will power off automatically in 60 seconds" pops up and starts counting down the 60 seconds. Unfortunately, there's only power for about 30, so it powers off ungracefully without shutting down.
2. Monitor attached, not logged in: computer starts shutdown and shuts down after a few seconds as desired when ignition goes low.
3. Monitor not attached: shutdown doesn't happen (prior to 12VDC going away).



I specifically need to get it to work for case (3.) (Monitor not attached) since there can't be a monitor in the actual embedded application.



Because it works for case (2.), it must be possible but I have no idea what config files to look at or what to change.










share|improve this question













I'm running ubuntu 18.04.1 LTS on an embedded "automotive" computer that's powered with 12VDC (no AC!). It has 3 power inputs: Power (12V), Ground and something labeled "ignition." When "ignition" goes low, I need the computer to immediately (within 10 seconds) start its shutdown because the 12V will go away shortly (after 30 seconds or so). I assume "ignition" is like a soft power button or maybe laptop closed or something similar.



I used to run Fedora Core 20 and the computer DID automagically shutdown when ignition went low exactly like I needed it to.



With ubuntu 18.04.01, this generally doesn't work in that the shutdown process doesn't happen either at all or at least not until the 12V goes away and the computer shuts off ungracefully without getting to shutdown first.



There are 3 cases with ubuntu 18.04.1 on my computer:
1. Monitor attached, logged in: a dialog with the message "The system will power off automatically in 60 seconds" pops up and starts counting down the 60 seconds. Unfortunately, there's only power for about 30, so it powers off ungracefully without shutting down.
2. Monitor attached, not logged in: computer starts shutdown and shuts down after a few seconds as desired when ignition goes low.
3. Monitor not attached: shutdown doesn't happen (prior to 12VDC going away).



I specifically need to get it to work for case (3.) (Monitor not attached) since there can't be a monitor in the actual embedded application.



Because it works for case (2.), it must be possible but I have no idea what config files to look at or what to change.







power-management shutdown






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 8 at 20:45









Bret Wallach

112




112












  • I don't have an Ubuntu to check, but you might find something to configure in /etc/systemd/logind.conf which is part of systemd. See man logind.conf and try setting PowerKeyIgnoreInhibited=yes for case 1.
    – meuh
    Nov 13 at 17:18


















  • I don't have an Ubuntu to check, but you might find something to configure in /etc/systemd/logind.conf which is part of systemd. See man logind.conf and try setting PowerKeyIgnoreInhibited=yes for case 1.
    – meuh
    Nov 13 at 17:18
















I don't have an Ubuntu to check, but you might find something to configure in /etc/systemd/logind.conf which is part of systemd. See man logind.conf and try setting PowerKeyIgnoreInhibited=yes for case 1.
– meuh
Nov 13 at 17:18




I don't have an Ubuntu to check, but you might find something to configure in /etc/systemd/logind.conf which is part of systemd. See man logind.conf and try setting PowerKeyIgnoreInhibited=yes for case 1.
– meuh
Nov 13 at 17:18










1 Answer
1






active

oldest

votes

















up vote
1
down vote













The following ended up working.



I created the file /etc/acpi/events/PBTN with the following contents:



event=button/power PBTN 00000080 00000000
action=/etc/acpi/actions/power-button.sh %e


I created the file /etc/acpi/actions/power-button.sh (with execute permission) with the following contents:



halt -p





share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1091244%2fshutdown-timing-when-computer-ignition-goes-low%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    The following ended up working.



    I created the file /etc/acpi/events/PBTN with the following contents:



    event=button/power PBTN 00000080 00000000
    action=/etc/acpi/actions/power-button.sh %e


    I created the file /etc/acpi/actions/power-button.sh (with execute permission) with the following contents:



    halt -p





    share|improve this answer

























      up vote
      1
      down vote













      The following ended up working.



      I created the file /etc/acpi/events/PBTN with the following contents:



      event=button/power PBTN 00000080 00000000
      action=/etc/acpi/actions/power-button.sh %e


      I created the file /etc/acpi/actions/power-button.sh (with execute permission) with the following contents:



      halt -p





      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        The following ended up working.



        I created the file /etc/acpi/events/PBTN with the following contents:



        event=button/power PBTN 00000080 00000000
        action=/etc/acpi/actions/power-button.sh %e


        I created the file /etc/acpi/actions/power-button.sh (with execute permission) with the following contents:



        halt -p





        share|improve this answer












        The following ended up working.



        I created the file /etc/acpi/events/PBTN with the following contents:



        event=button/power PBTN 00000080 00000000
        action=/etc/acpi/actions/power-button.sh %e


        I created the file /etc/acpi/actions/power-button.sh (with execute permission) with the following contents:



        halt -p






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 19 at 22:57









        Bret Wallach

        112




        112






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1091244%2fshutdown-timing-when-computer-ignition-goes-low%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            數位音樂下載

            When can things happen in Etherscan, such as the picture below?

            格利澤436b