Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] A nuisance in Vend::Util.pm?



******    message to minivend-users from jojo@buchonline.net     ******

On 18 Jun, Sergio Polini wrote:
> ******    message to minivend-users from Sergio Polini <s.polini@mclink.it>     ******
> 
> Perhaps I'm missing something, since I'm new to Minivend.
> My problem was that I could not stop it; both -stop and -kill gave me the same
> message about a file that could not be locked. I've found a workaround, but it
> is very dirty :-)
> 
> I've installed Minivend 4.04 on my Linux (RedHat 6.2) as sp:users and always run
> it as sp:users (I'm just studying for now...). My Linux is "localized" as
> italian: here is the problem, as far as I can guess.
> 
> The message I was getting was:
> 
>   Could not lock file: Risorsa temporaneamente non disponibile
> 
> i.e., "Resourse temporarily unavailable" in italian...
> 
> In Vend::Util.pm, subroutine flock_lock, I read:
> 
>         if (! flock($fh, $flag | $flock_LOCK_NB)) {
>             if ($! =~ m/^Try again/
>                 or $! =~ m/^Resource temporarily unavailable/
>                 or $! =~ m/^Operation would block/) {
>                 return 0;
>             }
>             else {
>                 die "Could not lock file: $! ($errno)\n";
>             }
>         }
> 
> The error code is checked againt its english description!
> I tried:
> 
>             else {
> 		my $errno = $! + 1000;
>                 die "Could not lock file: $! ($errno)\n";
>             }
> 
> so I was able to patch the if branch:
> 
>             if ($! =~ m/^Try again/
>                 or $! =~ m/^Resource temporarily unavailable/
> 		or $! == 11       # :-(
>                 or $! =~ m/^Operation would block/) {
>                 return 0;
>             }
> 
> Stop and kill work well now, but I'm not proud for my hack :-)
> 
> Any better ideas?

Unset all locale stuff before starting the MiniVend server!

Regards,

	Joachim

BTW: I´m not a linux user!

-- 
Hans-Joachim Leidinger
buch online                 jojo@buchonline.net
Munscheidstr. 14            FAX: +49 209 1671449
45886 Gelsenkirchen         FAX: 0209 1671449

-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: