Skip to content
This repository was archived by the owner on Feb 24, 2023. It is now read-only.

Commit 8d7dc52

Browse files
Revert "Systemd-docker client detaches if -d option is given by user"
1 parent 136a9ce commit 8d7dc52

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

main.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ type Context struct {
4343
Pid int
4444
PidFile string
4545
Client *dockerClient.Client
46-
Detach bool
4746
}
4847

4948
func setupEnvironment(c *Context) {
@@ -83,7 +82,6 @@ func parseContext(args []string) (*Context, error) {
8382
flags.BoolVar(&c.Notify, []string{"n", "-notify"}, false, "setup systemd notify for container")
8483
flags.BoolVar(&c.Env, []string{"e", "-env"}, false, "inherit environment variable")
8584
flags.Var(&flCgroups, []string{"c", "-cgroups"}, "cgroups to take ownership of or 'all' for all cgroups available")
86-
flags.BoolVar(&c.Detach, []string{"d", "-detach"}, false, "detach from container")
8785

8886
err := flags.Parse(args)
8987
if err != nil {
@@ -552,18 +550,16 @@ func mainWithArgs(args []string) (*Context, error) {
552550
return c, err
553551
}
554552

555-
if !c.Detach {
556-
go pipeLogs(c)
553+
go pipeLogs(c)
557554

558-
err = keepAlive(c)
559-
if err != nil {
560-
return c, err
561-
}
555+
err = keepAlive(c)
556+
if err != nil {
557+
return c, err
558+
}
562559

563-
err = rmContainer(c)
564-
if err != nil {
565-
return c, err
566-
}
560+
err = rmContainer(c)
561+
if err != nil {
562+
return c, err
567563
}
568564

569565
return c, nil

0 commit comments

Comments
 (0)