Bump aws-oidc version
Ignore SIGHUP on unix systems
This commit is contained in:
parent
20c5cf00ea
commit
da6ba96063
@ -22,9 +22,12 @@ import (
|
||||
"golang.org/x/crypto/ssh/agent"
|
||||
)
|
||||
|
||||
var sigs = []os.Signal{os.Kill, os.Interrupt}
|
||||
var logger = logrus.New()
|
||||
var log *logrus.Entry
|
||||
var (
|
||||
sigExit = []os.Signal{os.Kill, os.Interrupt}
|
||||
sigIgnore = []os.Signal{}
|
||||
logger = logrus.New()
|
||||
log *logrus.Entry
|
||||
)
|
||||
|
||||
var cli struct {
|
||||
Config string `kong:"arg,type='string',help='sshrimp config file (default: ${config_file} or ${env_var_name} environment variable)',default='${config_file}',env='SSHRIMP_CONFIG'"`
|
||||
@ -118,9 +121,11 @@ func launchAgent(c *config.SSHrimp) error {
|
||||
sshrimpAgent := sshrimpagent.NewSSHrimpAgent(c, signer)
|
||||
|
||||
// Listen for signals so that we can close the listener and exit nicely
|
||||
log.Debugf("Exiting on signals: %v", sigs)
|
||||
log.Debugf("Ignoring signals: %v", sigIgnore)
|
||||
signal.Ignore(sigIgnore...)
|
||||
log.Debugf("Exiting on signals: %v", sigExit)
|
||||
osSignals := make(chan os.Signal)
|
||||
signal.Notify(osSignals, sigs...)
|
||||
signal.Notify(osSignals, sigExit...)
|
||||
go func() {
|
||||
<-osSignals
|
||||
listener.Close()
|
||||
|
@ -7,5 +7,6 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
sigs = append(sigs, syscall.SIGTERM)
|
||||
sigExit = append(sigExit, syscall.SIGTERM)
|
||||
sigIgnore = append(sigIgnore, syscall.SIGHUP)
|
||||
}
|
||||
|
2
go.mod
2
go.mod
@ -6,7 +6,7 @@ replace github.com/b-b3rn4rd/gocfn => github.com/stoggi/gocfn v0.0.0-20200214083
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.73.0
|
||||
git.narnian.us/lordwelch/aws-oidc v0.0.3
|
||||
git.narnian.us/lordwelch/aws-oidc v0.0.4
|
||||
github.com/AlecAivazis/survey/v2 v2.2.4
|
||||
github.com/BurntSushi/toml v0.3.1
|
||||
github.com/aws/aws-lambda-go v1.19.0
|
||||
|
4
go.sum
4
go.sum
@ -36,8 +36,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
git.narnian.us/lordwelch/aws-oidc v0.0.3 h1:cl3kSy0j84CTK6dmpTDDKdvGXKG6Msb8Y7DXYgySEN8=
|
||||
git.narnian.us/lordwelch/aws-oidc v0.0.3/go.mod h1:lfAaTDbI5Ip4TjBDAvJnPNmSLCMAS9hNRWgqwmm4bTk=
|
||||
git.narnian.us/lordwelch/aws-oidc v0.0.4 h1:wdr41SugBP7j7W2QiZDy2JyGx2Mt1ErW4Hz6U6SBAXg=
|
||||
git.narnian.us/lordwelch/aws-oidc v0.0.4/go.mod h1:lfAaTDbI5Ip4TjBDAvJnPNmSLCMAS9hNRWgqwmm4bTk=
|
||||
github.com/99designs/keyring v0.0.0-20190110203331-82da6802f65f h1:WXiWWJrYCaOaYimBAXlRdRJ7qOisrYyMLYnCvvhHVms=
|
||||
github.com/99designs/keyring v0.0.0-20190110203331-82da6802f65f/go.mod h1:aKt8W/yd91/xHY6ixZAJZ2vYbhr3pP8DcrvuGSGNPJk=
|
||||
github.com/AlecAivazis/survey/v2 v2.2.4 h1:OAh6g17JmXsjVVHTnfQFEi6K+YZX6mrC+pT8IPkUlpk=
|
||||
|
Loading…
x
Reference in New Issue
Block a user