LINUX.ORG.RU

История изменений

Исправление tip78, (текущая версия) :

ВО, нашёл рабочий вариант, через systemd:

конкретно у меня такое работает:

[Unit]
Description=Pre-Shutdown Processes
Before=shutdown.target reboot.target halt.target
# This works because it is installed in the target and will be executed before the target state is entered
# Also consider kexec.target

[Service]
Type=oneshot
#User=username
#Group=groupname
RemainAfterExit=true
ExecStart=/bin/true
ExecStop=/nfs/shutdown.sh

[Install]
WantedBy=multi-user.target

Исходная версия tip78, :

ВО, нашёл рабочий вариант, через systemd: https://unix.stackexchange.com/questions/48973/execute-a-command-before-shutdown

конкретно у меня такое работает:

[Unit]
Description=Pre-Shutdown Processes
Before=shutdown.target reboot.target halt.target
# This works because it is installed in the target and will be executed before the target state is entered
# Also consider kexec.target

[Service]
Type=oneshot
#User=username
#Group=groupname
RemainAfterExit=true
ExecStart=/bin/true
ExecStop=/nfs/shutdown.sh

[Install]
WantedBy=multi-user.target