All Forums
 Embedded Linux
 Linux FAQ
 Linux power failure
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

KnowledgeBase

296 Posts

Posted - 24 May 2002 :  15:42:39  Show Profile  Email Poster
Linux power failure

Typically, linux power failure works like this:
    1. Some process or the kernel notices that the power has failed and sends a SIGPWR to the init process.

    2. The init process traps the power failed signal and reads and removes the file /etc/powerstatus.

    3. Then init reads the file /etc/inittab and executes one of these lines based on the power status:
      FAIL
      pf::powerwait:/etc/init.d/powerfail start

      OK
      po::powerokwait:/etc/init.d/powerfail stop

      LOW
      pn::powerfailnow:/etc/init.d/powerfail now

      These lines can be modified to call any script or program.

The init and inittab in the root file systems on ADS boards have this functionality.

To implement a power failure scheme on your board, you must provide:
  • a process or kernel change that
    - detects the power failure,
    - updates the /etc/powerstatus file
    - sends the SIGPWR signal to init

  • a /etc/init.d/powerfail script that performs the desired action for your situation


31-Dec-2003: jlackey - update information related to the root file system
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000