Announcements

Help Wizard

Step 1

NEXT STEP

Spotify for Linux does not listen to SIGQUIT, but Spotify for OS X does.

Solved!

Spotify for Linux does not listen to SIGQUIT, but Spotify for OS X does.

Hi, I'm an avid Spotify user and glad it exists, but there is a seemingly easy to fix problem that is a major issue that affects all distributions. Spotify for Linux does not listen to SIGQUIT, which causes the notification icon's "Exit" menu to not work, as well as Spotify preventing logouts. I have to wait at least a minute before Spotify is force closed because it does not listen to SIGQUIT when logging out, which is a bit of a waste of time.

 

For those of you who do not know what this means, POSIX systems (Linux, UNIX, etc.) use signals for basic inter-app communication. For example, when you log out, your computer tells your apps open "SIGQUIT", or to nicely quit when possible to prevent data loss before logging out. Because there is a chance an app is frozen and isn't listening, most desktops have a timer built in when an app doesn't respond to SIGQUIT within a minute or so, so the desktop will then send SIGINT, which basically tells it to quit immediately, not saving any data. This is why Spotify prevents logout for around a minute, because the desktop is waiting for Spotify to cleanly exit without being forcibly killed.

 

Steps to reproduce for testing:

1: Open Spotify in a terminal

2: Press CTRL + \ to send SIGQUIT

3: Notice how nothing happens

4: Press CTRL + C to send SIGABRT

5: Notice how that worked.

 

Considering SIGQUIT tells it to cleanly exit, Spotify should catch SIGQUIT and terminate whenever it's safe. Additionally, catching SIGQUIT will prevent any potential database corruption caused by an unclean exit.

 

This does not affect the OS X version of Spotify, it registers CTRL + \ as SIGQUIT and exits. Perhaps the code that catches SIGQUIT can be borrowed from the OS X version of Spotify? To test this, you can run /Applications/Spotify.app/Contents/MacOS/Spotify in a terminal and send SIGQUIT with CTRL + \ , and it will quit after a second or so (OS X incorrectly reports this as a crash, since it was not closed through the GUI.)

 

A fix would be greatly appreciated 🙂

Reply

Accepted Solutions
Marked as solution


@Peter wrote:
Since Spotify on Linux is a preview and not a supported product, we are at the mercy of the developers in their free time to provide/update/maintain the linux client.

I would suggest posting this over on the main linux topic as that is the main place they read for feedback:
http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Spotify-0-9-11-for-GNU-Linux/td-p/842969


Thanks Peter, I'll be sure to repost over there.

View solution in original post

2 Replies

Since Spotify on Linux is a preview and not a supported product, we are at the mercy of the developers in their free time to provide/update/maintain the linux client.

I would suggest posting this over on the main linux topic as that is the main place they read for feedback:
http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Spotify-0-9-11-for-GNU-Linux/td-p/842969

Peter
Spotify Community Mentor and Troubleshooter

Spotify Last.FM Twitter LinkedIn Meet Peter Rock Star Jam 2014


If this post was helpful, please add kudos below!

Marked as solution


@Peter wrote:
Since Spotify on Linux is a preview and not a supported product, we are at the mercy of the developers in their free time to provide/update/maintain the linux client.

I would suggest posting this over on the main linux topic as that is the main place they read for feedback:
http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Spotify-0-9-11-for-GNU-Linux/td-p/842969


Thanks Peter, I'll be sure to repost over there.

Suggested posts