## Troubleshooting
-### If the launch agent fails to start
-
-Check for a stale `~/.passage.sock` file, which may have been left behind in the event of a system crash, and remove it.
-
## Limitations
Passage uses the [keybase/go-keychain](https://github.com/keybase/go-keychain) library to access the keychain, which currently only knows how to read "generic" (A.K.A. "application") passwords, not "Internet" passwords.
func main() {
resetCache()
path := getSockPath()
+
+ // Check to see if there is a pre-existing or stale socket present.
+ if _, err := os.Stat(path); !os.IsNotExist(err) {
+ // Socket already exists.
+ if _, err = net.Dial("unix", path); err == nil {
+ // Socket is live!
+ log.Fatal("Live socket already exists at: " + path)
+ }
+
+ // Likely a stale socket left over after a crash.
+ log.Print("Dead socket found at: " + path + " (removing)")
+ if err = os.Remove(path); err != nil {
+ log.Fatal(err)
+ }
+ }
+
+ // Start listening.
syscall.Umask(0077)
listener, err := net.Listen("unix", path)
if err != nil {