For probably a year or two I’ve had this annoying issue with skypeforlinux-bin where sometimes when it’s running in the system tray and I launch it again, instead of opening the existing running instance it will start a new instance of Skype.
I’ve never been able to find any reports of this issue, but after many months of trying different things to fix it I eventually found that it’s because the Electron SingletonCookie file under /tmp/scoped_dirXXXXXX/
was randomly disappearing.
To work around this I wrote a launch script for Skype to restore the cookie file if it’s been deleted:
#!/bin/sh
SKYPE_DIR="$HOME/.config/skypeforlinux"
if pidof -q skypeforlinux && [ -e "$SKYPE_DIR/SingletonSocket" ]; then
SOCKET_DIR=`dirname $(readlink "$SKYPE_DIR/SingletonSocket")`
if [ ! -L "$SOCKET_DIR/SingletonCookie" ]; then
cp -P "$SKYPE_DIR/SingletonCookie" $SOCKET_DIR
echo "Restored $SOCKET_DIR/SingletonCookie"
fi
fi
exec /usr/bin/skypeforlinux $@
It works perfectly. But the cause of this issue is still a mystery to me.
- Is this a Skype-only issue or does it happen with other single-instance Electron apps?
- Is something else on my system deleting this SingletonCookie file because it looks like a broken symlink?
- Why aren’t more people experiencing and reporting this issue?
- Why does the flatpak version of Skype not have this issue?
So many unanswered questions…
If anyone feels like doing some digging, here’s my system info: https://0x0.st/X3Bc.txt