|
|
|
|
@ -10,7 +10,6 @@ package plugin
|
|
|
|
|
import (
|
|
|
|
|
"errors"
|
|
|
|
|
"fmt"
|
|
|
|
|
packrpc "github.com/hashicorp/packer/packer/rpc"
|
|
|
|
|
"io/ioutil"
|
|
|
|
|
"log"
|
|
|
|
|
"math/rand"
|
|
|
|
|
@ -20,7 +19,10 @@ import (
|
|
|
|
|
"runtime"
|
|
|
|
|
"strconv"
|
|
|
|
|
"sync/atomic"
|
|
|
|
|
"syscall"
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
packrpc "github.com/hashicorp/packer/packer/rpc"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// This is a count of the number of interrupts the process has received.
|
|
|
|
|
@ -87,7 +89,7 @@ func Server() (*packrpc.Server, error) {
|
|
|
|
|
|
|
|
|
|
// Eat the interrupts
|
|
|
|
|
ch := make(chan os.Signal, 1)
|
|
|
|
|
signal.Notify(ch, os.Interrupt)
|
|
|
|
|
signal.Notify(ch, os.Interrupt, syscall.SIGTERM)
|
|
|
|
|
go func() {
|
|
|
|
|
var count int32 = 0
|
|
|
|
|
for {
|
|
|
|
|
|