[ FAILURE ] Stopped with error /dev/dm-0
Place file on:
/etc/init.d/stop-cryptswap
Then execute:
sudo chmod +x /etc/init.d/stop-cryptswap
sudo update-rc.d cryptswap-stop defaults
#!/bin/bash | |
# | |
### BEGIN INIT INFO | |
# Provides: stop-cryptswap | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Should-Start: $network $time | |
# Should-Stop: $network $time | |
# Default-Start: 0 6 | |
# Default-Stop: | |
# Short-Description: Stop the cryptswap partition for fix bug | |
# Description: Stop the cryptswap, on Ubuntu 16.04.5 LTS | |
### END INIT INFO | |
# | |
set -e | |
set -u | |
${DEBIAN_SCRIPT_DEBUG:+ set -v -x} | |
. /lib/lsb/init-functions | |
SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) | |
ERR_LOGGER="logger -p daemon.err -t /etc/init.d/stop-cryptswap -i" | |
cd / | |
umask 077 | |
# | |
# main() | |
# | |
case "${1:-''}" in | |
'start') | |
sudo /sbin/swapoff -a | |
sudo /sbin/cryptsetup luksClose cryptswap1 | |
log_daemon_msg "Umount cryptswap1 ===> Success!" "stop-cryptswap" | |
;; | |
'stop') | |
log_daemon_msg "Do nothing..." "stop-cryptswap" | |
;; | |
'restart') | |
set +e; $SELF stop; set -e | |
$SELF start | |
log_daemon_msg "Restarting..." "stop-cryptswap" | |
;; | |
'reload'|'force-reload') | |
log_daemon_msg "Do nothing..." "stop-cryptswap" | |
;; | |
'status') | |
log_daemon_msg "Do nothing..." "stop-cryptswap" | |
;; | |
*) | |
echo "Usage: $SELF start|stop|restart|reload|force-reload|status" | |
exit 1 | |
;; | |
esac | |
exit 0 |