How to poweroff when there's no systemd/init (e.g. using init=/bin/bash)?











up vote
3
down vote

favorite












poweroff complains that it can't connect to systemd via DBus (of course, it's not alive). I did sync followed by kill $$, thinking that pid 1 dying would cue the kernel to poweroff, but that caused a kernel panic. I then held the power button to force the poweroff.



What's the most proper way to power-off in this scenario?










share|improve this question


























    up vote
    3
    down vote

    favorite












    poweroff complains that it can't connect to systemd via DBus (of course, it's not alive). I did sync followed by kill $$, thinking that pid 1 dying would cue the kernel to poweroff, but that caused a kernel panic. I then held the power button to force the poweroff.



    What's the most proper way to power-off in this scenario?










    share|improve this question
























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      poweroff complains that it can't connect to systemd via DBus (of course, it's not alive). I did sync followed by kill $$, thinking that pid 1 dying would cue the kernel to poweroff, but that caused a kernel panic. I then held the power button to force the poweroff.



      What's the most proper way to power-off in this scenario?










      share|improve this question













      poweroff complains that it can't connect to systemd via DBus (of course, it's not alive). I did sync followed by kill $$, thinking that pid 1 dying would cue the kernel to poweroff, but that caused a kernel panic. I then held the power button to force the poweroff.



      What's the most proper way to power-off in this scenario?







      linux systemd power-management






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      JoL

      83539




      83539






















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          3
          down vote














          1. Unmount the filesystems that you had mounted. The root filesystem is a special case; for this you can use mount / -o remount,ro. umount / also happens to work on Linux, because it is effectively converted to the former command.

          2. poweroff -f


          The systemd-specific equivalent of poweroff -f is systemctl poweroff -f -f.



          That said, you don't need to worry about it too much, unless




          1. You have mounted an old filesystem like FAT - as used by the EFI system partition - or ext2, which does not implement journalling or equivalent. With a modern filesystem, sync is supposed to be enough, and the filesystem will recover quickly on the next boot.

          2. or you might have left a running process that writes to the filesystem, and you had intended to shut it down cleanly. In that case it's useful to umount the filesystems, because it will show a busy error to remind you about the remaining writer.






          share|improve this answer























          • Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
            – JoL
            1 hour ago


















          up vote
          1
          down vote













          Ok, so it just occurred to me that I had the option to exec init. From there, I would probably be able to later poweroff. I wonder if there are better alternatives, though.






          share|improve this answer





















          • @G-Man won't it start the normal boot process and give you your normal shell eventually?
            – muru
            15 mins ago










          • Hmmm.  Yeah, I guess so.
            – G-Man
            13 mins ago


















          up vote
          0
          down vote













          #exec /sbin/init 


          is what I use when I can't use "init 0" or any init command which is usually in single user mode to change root passwd.





          share





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f487238%2fhow-to-poweroff-when-theres-no-systemd-init-e-g-using-init-bin-bash%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote














            1. Unmount the filesystems that you had mounted. The root filesystem is a special case; for this you can use mount / -o remount,ro. umount / also happens to work on Linux, because it is effectively converted to the former command.

            2. poweroff -f


            The systemd-specific equivalent of poweroff -f is systemctl poweroff -f -f.



            That said, you don't need to worry about it too much, unless




            1. You have mounted an old filesystem like FAT - as used by the EFI system partition - or ext2, which does not implement journalling or equivalent. With a modern filesystem, sync is supposed to be enough, and the filesystem will recover quickly on the next boot.

            2. or you might have left a running process that writes to the filesystem, and you had intended to shut it down cleanly. In that case it's useful to umount the filesystems, because it will show a busy error to remind you about the remaining writer.






            share|improve this answer























            • Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
              – JoL
              1 hour ago















            up vote
            3
            down vote














            1. Unmount the filesystems that you had mounted. The root filesystem is a special case; for this you can use mount / -o remount,ro. umount / also happens to work on Linux, because it is effectively converted to the former command.

            2. poweroff -f


            The systemd-specific equivalent of poweroff -f is systemctl poweroff -f -f.



            That said, you don't need to worry about it too much, unless




            1. You have mounted an old filesystem like FAT - as used by the EFI system partition - or ext2, which does not implement journalling or equivalent. With a modern filesystem, sync is supposed to be enough, and the filesystem will recover quickly on the next boot.

            2. or you might have left a running process that writes to the filesystem, and you had intended to shut it down cleanly. In that case it's useful to umount the filesystems, because it will show a busy error to remind you about the remaining writer.






            share|improve this answer























            • Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
              – JoL
              1 hour ago













            up vote
            3
            down vote










            up vote
            3
            down vote










            1. Unmount the filesystems that you had mounted. The root filesystem is a special case; for this you can use mount / -o remount,ro. umount / also happens to work on Linux, because it is effectively converted to the former command.

            2. poweroff -f


            The systemd-specific equivalent of poweroff -f is systemctl poweroff -f -f.



            That said, you don't need to worry about it too much, unless




            1. You have mounted an old filesystem like FAT - as used by the EFI system partition - or ext2, which does not implement journalling or equivalent. With a modern filesystem, sync is supposed to be enough, and the filesystem will recover quickly on the next boot.

            2. or you might have left a running process that writes to the filesystem, and you had intended to shut it down cleanly. In that case it's useful to umount the filesystems, because it will show a busy error to remind you about the remaining writer.






            share|improve this answer















            1. Unmount the filesystems that you had mounted. The root filesystem is a special case; for this you can use mount / -o remount,ro. umount / also happens to work on Linux, because it is effectively converted to the former command.

            2. poweroff -f


            The systemd-specific equivalent of poweroff -f is systemctl poweroff -f -f.



            That said, you don't need to worry about it too much, unless




            1. You have mounted an old filesystem like FAT - as used by the EFI system partition - or ext2, which does not implement journalling or equivalent. With a modern filesystem, sync is supposed to be enough, and the filesystem will recover quickly on the next boot.

            2. or you might have left a running process that writes to the filesystem, and you had intended to shut it down cleanly. In that case it's useful to umount the filesystems, because it will show a busy error to remind you about the remaining writer.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 2 hours ago

























            answered 2 hours ago









            sourcejedi

            22.3k43398




            22.3k43398












            • Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
              – JoL
              1 hour ago


















            • Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
              – JoL
              1 hour ago
















            Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
            – JoL
            1 hour ago




            Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
            – JoL
            1 hour ago












            up vote
            1
            down vote













            Ok, so it just occurred to me that I had the option to exec init. From there, I would probably be able to later poweroff. I wonder if there are better alternatives, though.






            share|improve this answer





















            • @G-Man won't it start the normal boot process and give you your normal shell eventually?
              – muru
              15 mins ago










            • Hmmm.  Yeah, I guess so.
              – G-Man
              13 mins ago















            up vote
            1
            down vote













            Ok, so it just occurred to me that I had the option to exec init. From there, I would probably be able to later poweroff. I wonder if there are better alternatives, though.






            share|improve this answer





















            • @G-Man won't it start the normal boot process and give you your normal shell eventually?
              – muru
              15 mins ago










            • Hmmm.  Yeah, I guess so.
              – G-Man
              13 mins ago













            up vote
            1
            down vote










            up vote
            1
            down vote









            Ok, so it just occurred to me that I had the option to exec init. From there, I would probably be able to later poweroff. I wonder if there are better alternatives, though.






            share|improve this answer












            Ok, so it just occurred to me that I had the option to exec init. From there, I would probably be able to later poweroff. I wonder if there are better alternatives, though.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 2 hours ago









            JoL

            83539




            83539












            • @G-Man won't it start the normal boot process and give you your normal shell eventually?
              – muru
              15 mins ago










            • Hmmm.  Yeah, I guess so.
              – G-Man
              13 mins ago


















            • @G-Man won't it start the normal boot process and give you your normal shell eventually?
              – muru
              15 mins ago










            • Hmmm.  Yeah, I guess so.
              – G-Man
              13 mins ago
















            @G-Man won't it start the normal boot process and give you your normal shell eventually?
            – muru
            15 mins ago




            @G-Man won't it start the normal boot process and give you your normal shell eventually?
            – muru
            15 mins ago












            Hmmm.  Yeah, I guess so.
            – G-Man
            13 mins ago




            Hmmm.  Yeah, I guess so.
            – G-Man
            13 mins ago










            up vote
            0
            down vote













            #exec /sbin/init 


            is what I use when I can't use "init 0" or any init command which is usually in single user mode to change root passwd.





            share

























              up vote
              0
              down vote













              #exec /sbin/init 


              is what I use when I can't use "init 0" or any init command which is usually in single user mode to change root passwd.





              share























                up vote
                0
                down vote










                up vote
                0
                down vote









                #exec /sbin/init 


                is what I use when I can't use "init 0" or any init command which is usually in single user mode to change root passwd.





                share












                #exec /sbin/init 


                is what I use when I can't use "init 0" or any init command which is usually in single user mode to change root passwd.






                share











                share


                share










                answered 4 mins ago









                Calvin Dike

                112




                112






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f487238%2fhow-to-poweroff-when-theres-no-systemd-init-e-g-using-init-bin-bash%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

                    flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                    Mangá

                     ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕