reboot

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package reboot covers two Windows admin needs the old install scripts handled with a delayed-move primitive and a scatter of registry probes:

  • Scheduling a file to be replaced or deleted at the next boot, for files that are locked/in-use right now. This is MoveFileEx with MOVEFILE_DELAY_UNTIL_REBOOT.
  • Detecting whether the machine is already waiting on a reboot, so a rollout can hold off (or a health gate can fail) instead of stacking changes on a box that is half-patched.

Both are Windows-only; off Windows every function returns ErrUnsupportedPlatform.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedPlatform = errors.New("winadmin/reboot: only supported on Windows")

ErrUnsupportedPlatform is returned off Windows.

Functions

func DeleteOnReboot

func DeleteOnReboot(path string) error

DeleteOnReboot schedules path for deletion at the next reboot — for a locked file you cannot remove now.

func Pending

func Pending() (bool, error)

Pending reports whether any "a reboot is pending" signal is set on the machine.

func PendingReasons

func PendingReasons() ([]string, error)

PendingReasons returns the specific reboot-pending signals that are set (empty when none are) — e.g. "pending file rename operations", "windows update".

func ReplaceOnReboot

func ReplaceOnReboot(src, dst string) error

ReplaceOnReboot schedules src to take the place of dst at the next reboot — the way to update a file that is locked and in use now. dst is replaced if it already exists. If dst is empty, src is scheduled for deletion instead (see DeleteOnReboot).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL