Documentation
¶
Index ¶
- Constants
- Variables
- func ControlService(s service.Service, name, action string) error
- func CopyDir(srcPath string, destPath string) error
- func NPC() (string, error)
- func NPS() (string, error)
- func RemoveStaleExecutables()
- func RestartAfterUpdate(s service.Service, name string, replaced []string) error
- func UpdateNpc() ([]string, error)
- func UpdateNps() ([]string, error)
Constants ¶
const SystemdScript = `` /* 776-byte string literal not displayed */
const SysvScript = `` /* 2263-byte string literal not displayed */
SysvScript Keep it in sync with the template from service_sysv_linux.go file Use "ps | grep -v grep | grep $(get_pid)" because "ps PID" may not work on OpenWrt
Variables ¶
var BuildTarget string
Functions ¶
func ControlService ¶ added in v0.34.8
ControlService runs a service control action. SysV init systems are driven through the init script directly so BusyBox based systems such as OpenWrt work as well.
func CopyDir ¶
CopyDir copies the files under srcPath into destPath, creating directories as needed.
func NPC ¶ added in v0.34.8
NPC installs the npc executable and returns the path the service should run.
func NPS ¶ added in v0.34.8
NPS installs the nps executable, web assets and, on a fresh install, the config directory. It returns the path the service should run.
func RemoveStaleExecutables ¶ added in v0.34.8
func RemoveStaleExecutables()
RemoveStaleExecutables deletes executables that an earlier update moved aside on Windows. They stay locked until the process running them exits, so failures are ignored and retried on the next start or update.
func RestartAfterUpdate ¶ added in v0.34.8
RestartAfterUpdate restarts the service so it runs the replaced executables. Only an installed and running service is restarted; otherwise the new version takes effect on the next start. When the service is known to run an executable outside replaced it is left alone, since a restart would not pick up the update. A nil s means the service manager is unavailable.
Types ¶
This section is empty.