Hi gilphilbert
Is it acceptable to have an extension modify those scripts? ...
For an extension you intend to submit to Tinycore, I would say no.
For a personal extension, sure. Tinycore is a toolkit you can modify to fit your needs.
... I'm guessing I would have to add my command to /etc/init.d/rc.shutdown ...
You could, but where would you place your commands? rc.shutdown goes something like this:
1. Sync filesystems # No problems here.
2. Disable swap space # No problems here.
3. Kill all processes # Maybe a problems here, could kill a needed daemon.
4. Unmount all extensions # Problem if your commands will depend on an extension.
5. Delete extensionssions being updated # Problem if your commands will depend on those extensions.
6. Unmount tce directory # Problem if your commands will depend on the tce directory.
7. Unmount backup directory # Problem if your commands will depend on the backup directory.
8. Unmount everything else # Problem, no place to run commands from.
exitcheck.sh poweroff -> /opt/shutdown.sh -> /sbin/poweroff -> /etc/inittab -> /etc/init.d/rc.shutdown
poweroff basically just tells inittab to run rc.shutdown, so you can ignore those 2.
I would use /opt/shutdown.sh because it's already included in your backup and that's what it's there for.
Place this at the end of /opt/shutdown.sh:
sync
sleep 1
sync
This will force all writes to storage devices to complete. Then place your commands after that.
... OK, that was stupid, I accept that
Not really, considering the context:
... Once the system is safely down (file systems unmounted, etc.) ...
The first thing that comes to mind is data preservation, not can I still run a command.