[vitunes] Re: Socket stuff (was: mailling list problems ?)

  • From: Ryan Flannery <ryan.flannery@xxxxxxxxx>
  • To: vitunes@xxxxxxxxxxxxx
  • Date: Thu, 24 Feb 2011 13:54:40 -0500

Hi,

On Thu, Feb 24, 2011 at 5:16 AM, kilian <kilian.klimek@xxxxxxxxxxxxxx> wrote:
> Hi,
>
> On Thu, Feb 24, 2011 at 01:16:42AM -0500, Ryan Flannery wrote:
>> Hi list,
>>
>> > ps: Ryan, there in a pull request for you on github.
>>
>> Received and merged!  I quite like.  Works fine on OpenBSD.
>>
>> Can anyone test on OS X?
>>
>> Two comments/questions:
>>
>> 1. If we fail to open the socket, is exitting reasonable?  That seems
>> a bit heavy.
>>
>> 2. If vitunes has a socket, and exits unexpectedly
>> (segfault/SIGKILL/etc), the socket still exists.  Easy thoughts around
>> this?   A lock/pid file perhaps?
>>
>> -ryan
>>
>
> 2: This is already taken care of. In sock_listen, the socket file is
> deleted first (because if it exists, the bind call would fail).

Hmm.. it doesn't appear to be working on my end.  Steps to problem:
1. I launch vitunes in one term, and use a few "vitunes -c '...'" from
the other term and the socket works fine.
2. I then "pkill -9 vitunes"
3. Then I re-launch vitunes
4. This new (second) vitunes doesn't delete/recreate the socket...
that is, "vitunes -c '...'" from another term will not work on this
new instance.

> 1: There are very few reasons why that can fail. My reasoning was that
> if it fails (e.g. because the socket file exists and can't be deleted by
> us), a vitunes user needs _some_ feedback about what is going on.
> Displaying a message in the bottom bar is IMHO not an option because
> that might shadow other errors. So, it's far from ideal but it was the
> best option.

Ok, that sounds fine to me then.

> Using perror(3) / strerror(3) to produce a better error message would
> have been good though.

Yah, I think an err(3) would be fine.  I'm trying to stick to warn/err
for all messages like that.

-ryan

Other related posts: