Tiny Core Linux

Tiny Core Base => Micro Core => Topic started by: mb on December 20, 2011, 04:17:19 PM

Title: Can't write to files on shutdown (inittrd / rc.shutdown)
Post by: mb 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
...
Title: Re: Can't write to files on shutdown
Post by: gerald_clark 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.
Title: Re: Can't write to files on shutdown
Post by: mb on December 20, 2011, 04:32:39 PM
I have a persistant /opt
Title: Re: Can't write to files on shutdown (inittrd / rc.shutdown)
Post by: gerald_clark on December 20, 2011, 06:38:11 PM
Did you remove all references to opt in /opt/.filetool.lst and then do a backup?
Title: Re: Can't write to files on shutdown (inittrd / rc.shutdown)
Post by: mb on December 20, 2011, 06:43:26 PM
yes.