Код: Выделить всё
# /etc/inittab
#
# Copyright (C) 2001 Erik Andersen
#
# Note: BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use
# sysvinit.
#
# Format for each entry: :::
#
# id == tty to run on, or empty for /dev/console
# runlevels == ignored
# action == one of sysinit, respawn, askfirst, wait, and once
# process == program to run
# Startup the system
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mkdir -p /dev/pts /dev/shm
::sysinit:/bin/mount -a
::sysinit:/bin/mkdir -p /run/lock/subsys
::sysinit:/sbin/swapon -a
null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd
null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin
null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout
null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
::sysinit:/bin/hostname -F /etc/hostname
# now run any rc scripts
::sysinit:/etc/init.d/rcS
# Put a getty on the serial port
tty1::respawn:/sbin/getty -L tty1 0 vt100 # GENERIC_SERIAL
# Stuff to do for the 3-finger salute
#::ctrlaltdel:/sbin/reboot
# Stuff to do before rebooting
::shutdown:/etc/init.d/rcK
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r
- выполняет init.d/rcK.
- заменяет все периферийные устройства.
- отключает все файловые системы.
Код: Выделить всё
#!/bin/sh
# Stop all init scripts in /etc/init.d
# executing them in reversed numerical order.
#
for i in $(ls -r /etc/init.d/S??*) ;do
# Ignore dangling symlinks (if any).
[ ! -f "$i" ] && continue
case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set stop
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i stop
;;
esac
done
Код: Выделить всё
S00iucode-tool S01syslogd S02klogd S02sysctl S21haveged S35iptables S40network S50crond S99system rcS
S01seedrng S02acpid S02modules S10udev S30dbus S40bluetoothd S44modem-manager S50sshd rcK
Я хотел бы уменьшить эту задержку, но мне нужно позаботиться о том, чтобы никакие данные не были повреждены или пропали после перезагрузки. Например, мой процесс записывает на диск текстовые журналы и данные телеметрии.
Я могу использовать /sbin/poweroff -f, и задержка уменьшается до ~1 с, и это здорово, но безопасно ли это? Кажется, синхронизация еще называется?
Код: Выделить всё
poweroff [-d delay] [-n] [-f]
Halt and shut off power
Options:
-d Delay interval for halting
-n No call to sync()
-f Force power off (don't go through init)
Каковы ваши рекомендации по ускорению выключения платы?
Я впервые делаю что-то подобное, спасибо за любую помощь или совет, который вы можете дать!
Подробнее здесь: https://stackoverflow.com/questions/798 ... -practices
Мобильная версия