WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Can't write to files on shutdown (inittrd / rc.shutdown)  (Read 3415 times)

Offline mb

  • Jr. Member
  • **
  • Posts: 69
Can't write to files on shutdown (inittrd / rc.shutdown)
« on: December 20, 2011, 04:17:19 PM »
I am trying to record a value on each shutdown; that is each 'poweroff' or 'reboot'. Searching pointed me towards /etc/init.d/rc.shutdown, and /etc/inittrd.. (/opt/shutdown.sh is not called on these commands).

A simplified example of what i am trying to do would be 'echo "test" > /opt/test'.. after reboot /opt/test is either empty or unchanged.

I put the above command at the start of rc.shutdown, or in the form;
Code: [Select]
...
::restart:echo "test" > /opt/test
::restart:/etc/init.d/rc.shutdown
::restart:/sbin/init
...
« Last Edit: December 20, 2011, 06:07:19 PM by mb »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Can't write to files on shutdown
« Reply #1 on: December 20, 2011, 04:26:03 PM »
opt/test needs to be added to /opt/.filetool.lst and a backup needs to be run.

Offline mb

  • Jr. Member
  • **
  • Posts: 69
Re: Can't write to files on shutdown
« Reply #2 on: December 20, 2011, 04:32:39 PM »
I have a persistant /opt

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Can't write to files on shutdown (inittrd / rc.shutdown)
« Reply #3 on: December 20, 2011, 06:38:11 PM »
Did you remove all references to opt in /opt/.filetool.lst and then do a backup?

Offline mb

  • Jr. Member
  • **
  • Posts: 69
Re: Can't write to files on shutdown (inittrd / rc.shutdown)
« Reply #4 on: December 20, 2011, 06:43:26 PM »
yes.