1

I'm recently made my old laptop into a server using Ubuntu Desktop 15.04. But because my laptop has an almost dead battery I want Ubuntu to save all data that it's on (or at least close the running programs) and safely shut down. How can I make sure Ubuntu does this when the AC adapter is unplugged?

I might be able to get this done easily by just adjusting the critical battery level to 95-ish. But I don't know what Ubuntu does during shutdown at critical battery level. If this could be the fix then I'd like to know: what does Ubuntu do when shutting down at critical battery level?

charmesal
  • 23
  • 4
  • shut down does a normal shutdown and you will need to save your data before – mchid Jul 16 '15 at 23:51
  • Thanks for clearing that up. If it does just do a normal shutdown I might be able to do it that way. Thanks. – charmesal Jul 17 '15 at 12:08
  • @charmesal Did you ever figure out how to do this? –  Apr 01 '17 at 11:09
  • @MarkYisri I did not. I eventually got myself a cheap server. But I did find some solutions for you. If you know how to program you van use this link. If you can't program, then you could check out link and create a simple bash script Hope this helps :) edit: I also just found this suggested post link – charmesal Apr 02 '17 at 14:08
  • @charmesal Thanks for the info! I am an enthusiast programmer myself so that's fine. (I'm only a student.) –  Apr 05 '17 at 22:51

1 Answers1

2

The package that handles the AC-to-battery transition is pm-utils. On a command line, looking at the files in the pm-utils package will tell you where to go next:

    $ dpkg -L pm-utils
    ...<snip>...
    /usr/share/man/man1/pm-is-supported.1.gz
    /usr/share/man/man8/pm-powersave.8.gz
    /usr/share/man/man8/pm-action.8.gz
    ...<snip>...
    /usr/share/doc/pm-utils/HOWTO.hooks.gz
    /usr/share/doc/pm-utils/AUTHORS
    /usr/share/doc/pm-utils/README.debugging
    /usr/share/doc/pm-utils/TODO.Debian
    /usr/share/doc/pm-utils/README.distributions
    /usr/share/doc/pm-utils/TODO
    /usr/share/doc/pm-utils/README
    /usr/share/doc/pm-utils/HOWTO.modules
    /usr/share/doc/pm-utils/changelog.Debian.gz
    /usr/share/doc/pm-utils/copyright
    /usr/share/doc/pm-utils/NEWS.gz
    ...<snip>...  
waltinator
  • 36,399