Set a TrueNAS shutdown-script timeout for the real task

Match lifecycle phase, sequential execution and timeout to the intended script before relying on a shutdown task.

Resilient network core with engineered blue and gold data paths.
DSE visual intelligenceNetworks & infrastructureGuide · 3 min read
Executive summary

What you need to know

Match lifecycle phase, sequential execution and timeout to the intended script before relying on a shutdown task.

Potentially affected

TrueNAS 25.10 administrators configuring Init/Shutdown Script tasks.

DSE recommendation

Review the complete script chain and rehearse bounded normal and overrun cases on a disposable system.

Bottom line: Choose the lifecycle phase and a justified timeout before enabling a script task. Use a harmless rehearsal to check its timing and evidence, and keep the intended shutdown work separate from a claim that every dependency will remain available.

Source fact: what the authority says

The TrueNAS Init/Shutdown guide places Pre Init after filesystems and networking are available, Post Init just before services start and Shutdown after services begin stopping. Scripts in one category run sequentially in the order they were added, and a hanging or slow script delays the next script in that category. The Timeout setting limits a script’s run time, and shutdown resources or services might no longer be available. A script must have its execute bit set and defaults to dash unless a shebang selects another interpreter.

What the source does not establish

The source defines task timing and execution controls, not a guarantee that an arbitrary script is safe during shutdown. This article does not establish the availability of a particular external system, interpreter dependency or application-consistent backup at that point.

Applicability questions

  • Which lifecycle category actually matches the intended task?
  • What earlier scripts run in the same category?
  • What resources does the complete invoked chain need, and when are they available?
  • What normal duration, timeout and operator response are approved?

DSE recommendation: controlled next steps

The following steps are DSE recommendations based on the cited source.

DSE recommends reviewing the entire invoked chain, including child scripts, network requests and interpreter selection. Give each required resource an owner and a proposed availability check. Do not choose Shutdown merely because the command worked in an interactive session on a fully running system.

Prepare a proposed harmless task that records its start, end and a unique test identifier to an approved local destination. Place a second harmless marker task after it in the same category. Define what observations would distinguish successful completion, an overrun and an unavailable dependency.

Choose a timeout from the task’s approved operating envelope rather than copying an example. Agree what work may remain incomplete if the limit is reached and who investigates it. Keep destructive cleanup or secret handling out of the initial rehearsal.

Review the category order before enabling another task. Preserve the original task settings and a supported recovery route for a system that fails to boot or shut down as expected. Treat a changed script body or interpreter as a reason to repeat the bounded review.

Verification and evidence

Proposed verification: on a disposable or expressly approved representative system, run a normal-duration lifecycle exercise and then a separately approved overrun case. Observe both tasks, elapsed time and the resulting system state. Preserve actual records without asserting that the proposed cases have already passed.

Repeat the dependency check at the selected lifecycle phase rather than substituting a later interactive run. Compare the recorded order with the approved sequence and investigate missing markers. Accept only the named task and conditions; leave broader backup or application recovery acceptance to its separate procedure.

Official references

Source review completed October 29, 2026. Recheck the official documentation and deployment-specific applicability before a production change.

Primary reference

Review the official source

TrueNAS — Managing Init/Shutdown Scripts · Verified October 29, 2026

Open official reference ↗
Plan the next step

Need help applying this guidance safely?

DSE can help confirm applicability, protect service continuity, and validate the result across physical security and IT systems.

Talk with DSE