mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-27 10:47:35 +00:00
clientupdate: restart tailscale after install on DSM6 (#9363)
DSM6 does not automatically restart packages on install, we have to do it explicitly. Also, DSM6 has a filter for publishers in Package Center. Make the error message more helpful when update fails because of this filter not allowing our package. Fixes #9361 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
This commit is contained in:
parent
668a0dd5ab
commit
c0ade132e6
@ -219,7 +219,8 @@ func (up *Updater) updateSynology() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the latest version and list of SPKs from pkgs.tailscale.com.
|
// Get the latest version and list of SPKs from pkgs.tailscale.com.
|
||||||
osName := fmt.Sprintf("dsm%d", distro.DSMVersion())
|
dsmVersion := distro.DSMVersion()
|
||||||
|
osName := fmt.Sprintf("dsm%d", dsmVersion)
|
||||||
arch, err := synoArch(runtime.GOARCH, synoinfoConfPath)
|
arch, err := synoArch(runtime.GOARCH, synoinfoConfPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -260,8 +261,20 @@ func (up *Updater) updateSynology() error {
|
|||||||
// just spits out a JSON result when done.
|
// just spits out a JSON result when done.
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if dsmVersion == 6 && bytes.Contains(out, []byte("error = [290]")) {
|
||||||
|
return fmt.Errorf("synopkg install failed: %w\noutput:\n%s\nplease make sure that packages from 'Any publisher' are allowed in the Package Center (Package Center -> Settings -> Trust Level -> Any publisher)", err, out)
|
||||||
|
}
|
||||||
return fmt.Errorf("synopkg install failed: %w\noutput:\n%s", err, out)
|
return fmt.Errorf("synopkg install failed: %w\noutput:\n%s", err, out)
|
||||||
}
|
}
|
||||||
|
if dsmVersion == 6 {
|
||||||
|
// DSM6 does not automatically restart the package on install. Do it
|
||||||
|
// manually.
|
||||||
|
cmd := exec.Command("nohup", "synopkg", "start", "Tailscale")
|
||||||
|
out, err := cmd.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("synopkg start failed: %w\noutput:\n%s", err, out)
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user