I'm trying to create the equivalent to rc.local
that runs last during startup, but to run first during shutdown.
I basically copy/pasted /etc/init.d/rc.local
as the base template, and updated the header to be
#! /bin/sh
### BEGIN INIT INFO
# Provides: rc.shutdown
# Required-Start:
# Required-Stop: $all
# Default-Start:
# Default-Stop: 0
# Short-Description: Executes rc.shutdown if exists
# Description:
### END INIT INFO
However, when I run update-rc.d rc.shutdown enable
, I get
update-rc.d: error: rc.shutdown Default-Start contains no runlevels, aborting.
This is a shutdown script and so would have no default start. Interestingly enough the file /etc/init.d/halt
has the same header file, but there seems to be no problem there.
I'm using Debian 8.1
/etc/inittab
) so perhaps set those runlevels in the header?