| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "time" | |
| ) | |
| const ( | |
| self = "/proc/self/exe" | |
| ) | |
| func main() { | |
| l, err := os.Readlink(self) | |
| if err != nil { | |
| panic(err) | |
| } | |
| fmt.Printf("Path: %s\n", l) | |
| time.Sleep(time.Duration(1 * time.Second)) | |
| fmt.Println("Starting new process") | |
| c := exec.Cmd{ | |
| Path: self, | |
| Stdout: os.Stdout, | |
| Stderr: os.Stderr, | |
| } | |
| if err := c.Run(); err != nil { | |
| panic(err) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment