HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: //etc.defaults/init/before-halt.conf
description "unmount root file system when poweroff/reboot"

start on runlevel [06] and stopped syno_poweroff_task

console none

pre-start script
	## stop syslog-ng before kill all process
	stop syslog-ng || true
	## mount root fs to read only on safe mode
	if /usr/syno/bin/synobootseq --is-safe-shutdown ; then
		if ! /bin/umount /; then
			start syslog-ng || true
			/usr/bin/logger -p user.err  "failed to umount root on safe mode, please check /var/log/safe-mode-ps.list" || true
			/bin/ps -e -o pid,user,vsz,stat,command > /var/log/safe-mode-ps.list || true
		fi
		if [ -f /tmp/ups.safedown ]; then
			/usr/syno/bin/synoups shutdownups
		fi
		stop
		exit 0
	fi
	## DDSM do not run killall
	if /usr/syno/bin/synoddsmtool --is-ddsm > /dev/null 2>&1; then
		/usr/syno/synoddsm/scripts/synoddsmctns_util shutdown-process || true
		stop
		exit 0
	fi
end script

script
	start kill-all-process RETRY_COUNT=1 || true
end script

# vim:ft=upstart