Akopia Akopia Services

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

Re: [mv] Still struggling with mv4 installation.



******    message to minivend-users from "Bill Randle" <billr@exgate.tek.com>     ******



Just to throw my $0.02 into the fray...

I believe I know specifically *where* minivend is dying, but I don't
know *why*. From looking at your startup log and an inspection of
the code, here's what's happening as the server starts up after
you type "minivend --start":
	1. the minivend script does a bunch of initialization,
	   prints the version number:
		- - - [25/March/2000:01:15:38 +0100] - - MiniVend V4.02
	  configures any catalogs, then calls:
		Vend::Server::run_server()
	  (which is in lib/Vend/Server.pm)

	2. when run_server() starts up, the first thing it does is
	   create a file to store the process ID of the server.
	   Unless you change it in minivend.cfg, the file is named
	   "minivend.pid" and is created in the <minivend-root>/etc
	   directory. This is succeeding because you'd see an error
	   message if it failed.

	3. next, run_server() prints the START message:
		- - - [25/March/2000:01:15:38 +0100] - - START server (7943)
(UNIX)
	   So, we know we got this far sucessfully. Now, the system
	   fcntl() function is called to tell the OS to keep that
	   process ID file open when the code later does a fork()
	   and exec() [never mind if you don't understand that].

	4. next, run_server() forks two children, the second of which
	   does the initial dirty work. The child now calls grab_pid().

	5. the purpose of grab_pid() is to gain exclusive access to
	   that process ID file we created earlier. It does this by
	   calling lockfile() [in lib/Vend/Util.pm].

	6. [we're almost there] the lockfile() routine does the
	   flock() system call to set that exclusive access mode.
	   The flags passed to flock() are:
		LOCK_EX  - get exclusive access
		LOCK_NB  - don't hang around and wait (block) if
			   somebody else has already locked this file
	   This is where the failure is occuring. The flock() call is
	   returning with an error code which causes minivend to exit
	   and print the error message "Could not lock file: <reason>"
	   where <reason> is the reason given by the operating system
	   for the failure.

Now the flock() call in lockfile() is actually a Perl library function.
I haven't looked at the source code for this, but I imaging it just
takes its arguments and calls the OS flock() function.

BTW, if step 6 had succeeded, you would have seen the "MiniVend server
started..." in the error.log file, so we know it didn't get that far.

So, the big question is why is flock() on the PID file failing in
FreeBSD but working on all the other Unix OS's? I don't have an
answer, as I don't have a FreeBSD system to look at. Your directory
permission in etc look OK and it didn't fail in creating the file.

If it were me, I would check the man page for flock ("man flock")
on a FreeBSD system. Does it mention anything about a Permission
denied error in the ERRORS section? If that doesn't turn up anything,
I'd ask on one of the FreeBSD mailing lists if there's anything
special/different about the FreeBSD version of flock() as compared
to Linux or Solaris.

	-Bill Randle
	billr@exgate.tek.com

On Mar 24,  4:37pm, Ed LaFrance wrote:
} Subject: Re: [mv] Still struggling with mv4 installation.
}
} [ text/plain
}   Encoded with "quoted-printable" ] :
******    message to minivend-users from Ed LaFrance <newmedia@newmediaems.com>
    ******
}
} At 11:00 PM 3/24/00 +0100, you wrote:
} >******    message to minivend-users from Hans-Joachim Leidinger
} ><jojo@buchonline.net>     ******
} >
} >Ed LaFrance schrieb:
} >[DEL]
} >[DEL]
} > > on port 7786: bind: Address already in use at
} >           ^^^^^^
} >[DEL]
} > > I don't know if this problem is caused because I tried to manually rename
} > > minivend.cfg.dist and start the server, or some other problem(s)...
} > >
} > > You were right that deleting mvend/etc/minivend.pid allowed me to issue
} > > server commands, but as soon as it appears I get 'Could not lock file:
} > > Permission Denied' again.  If I delete it and issue the stop command, I
} > get:
} > >
} > > The Minivend server was not running
} > (/home/v/visprox/mvend/etc/minivend.pid).
} > >
} > > I am kind of lost here.  Any further suggestions you may have would be
} > > appreciated.
} >
} >Ed,
} >
} >is the port 7787 running for you only? If no, edit minivend.cfg and
} >change the TCPMap to the another port number. Two or more minivend
} >server on the same port cause the failure of minivend server starting,
} >if the TCPMap isnīt right. (I hope i write my english right.)
} >What happen if you start the minivend server with the command
} >"bin/minivend -u"?
}
} Here are two instances of trying to start the server.  The first was with
} 'bin/minivend -u', without changing anything.  The second, I changed TCPMap
} to 8080 and did 'bin/minivend -start':
}
} - - - [25/March/2000:01:15:37 +0100] - - Low traffic settings.
} - - - [25/March/2000:01:15:38 +0100] - - MiniMate is NOT active.
} - - - [25/March/2000:01:15:38 +0100] - - MiniVend V4.02
} - - - [25/March/2000:01:15:38 +0100] - - START server (7943) (UNIX)
} - - - [25/March/2000:01:15:39 +0100] - - Could not lock file: Permission
denied
}  >
} - - - [25/March/2000:01:16:58 +0100] - - Low traffic settings.
} - - - [25/March/2000:01:16:59 +0100] - - MiniMate is NOT active.
} - - - [25/March/2000:01:16:59 +0100] - - MiniVend V4.02
} - - - [25/March/2000:01:16:59 +0100] - - START server (7953) (INET and UNIX)
} - - - [25/March/2000:01:17:00 +0100] - - Could not lock file: Permission
denied
}
}
} >Do you use vlink (UNIX) or tlink (INET)?
} >Are the files vlink and tlink in your <vendroot>/bin?
}
} No they are not.
}
} >Can you list and see all the files in your cgi-bin directory?
} >Can you see the owner and group of the files in your cgi-bin directory?
}
} There are no minivend-related files in my CGI-BIN.  I haven't gotten that
} far; I don't have a catalog installed.  I am still trying to get the server
} installed and running in mvend/.
}
}
} >If the user and owner of the files vlink and tlink in your
} ><vendroot>/bin directory is right, copy one of this file into the
} >cgi-bin directory and rename it to the right catalog name. Hmmm...are
} >you able to delete all files in your cgi-bin directory and after that to
} >use bin/makecat again? Hmm...if there are some another permission
} >trouble/problem, the bin/makecat will tell you about this. If not! There
} >are another permissions trouble! Hmmm...did you look the <vendroot>/etc
} >directory? Has the <vendroot>/etc the right user and group name?
} >Hmmm...first of all, i would suggest you to check all the permissions of
} >your minivend files _and_ minivend directory. Hmmm...can you see the
} >user and group name of your files and directories?
}
} Been there, did that, to the best of my ability, and according to you and
} others here is one suspect thing - the group name - , but I don't know how
} to change it: the ISP doesn't have chown available(to me) on this server:
}
} -rwxr-xr-x   1 visprox  bsdi    40 Mar 23 23:20 _db_storable
} -rwxr-xr-x   1 visprox  bsdi    40 Mar 23 23:20 _session_storable
} -rwxr-xr-x   1 visprox  bsdi     7 Mar 23 23:20 _uid
} drwxr-xr-x   3 visprox  bsdi  4096 Mar 23 23:20 auto
} drwxr-xr-x  12 visprox  bsdi  4096 Mar 23 23:20 basic
} drwxr-xr-x   2 visprox  bsdi  4096 Mar 23 23:20 bin
} drwxr-xr-x   2 visprox  bsdi  4096 Mar 23 23:20 build
} drwxr-xr-x   2 visprox  bsdi  4096 Mar 23 23:20 compat
} drwxr-xr-x   2 visprox  bsdi  4096 Mar 23 23:20 doc
} -rwxr-xr-x   1 visprox  bsdi  5877 Mar 25 01:16 error.log
} drwxr-xr-x   2 visprox  bsdi  4096 Mar 24 17:15 etc
} drwxr-xr-x   6 visprox  bsdi  4096 Mar 23 23:20 lib
} -rwxr-xr-x   1 visprox  bsdi  3792 Mar 23 23:20 locale.error
} -rwxr-xr-x   1 visprox  bsdi  1379 Mar 25 01:15 minivend.cfg
} -rwxr-xr-x   1 visprox  bsdi  1319 Mar 23 23:20 minivend.cfg.dist
} -rwxr-xr-x   1 visprox  bsdi   412 Mar 23 23:20 perllocal.pod
} drwxr-xr-x  16 visprox  bsdi  4096 Mar 23 23:20 simple
} drwxr-xr-x   2 visprox  bsdi  4096 Mar 23 23:20 src
} drwxr-xr-x   2 visprox  bsdi  4096 Mar 23 23:20 usertag
}
} I messed with the file permissions, so if they seem odd, it is because of
} me, but note the group membership of the files.  Should this be set to the
} username?  Does that mean I need a new entry in the group list?
}
} >Maybe this can solve your problem. I would suggest you to ask your ISP
} >about the permission trouble. As a newbie in FreeBSD, i donīt know about
} >the cause of the installation failure. Hmmm...i remembered about my
} >former trouble of installation of minivend 3.10. Formerly, i was able to
} >install minivend as root and after that, i have to use the chown
} >command, to set all minivend files to the right minivend user and group.
} >
} >I believe, the best way to install minivend is to install it as root and
} >use the chown command. If there are something missing perl modules for
} >minivend. This is the problem of your ISP only. I hope, your ISP will do
} >this for you.
} >
} >Good lucks!
} >
} >Regards,
} >
} >         Joachim
}
} Thank you, Joachim.  Your English is better than that of many Americans I
} know.  The ISP is trying to work with me on this - I am going to forward
} this message to them for their reference.  If you have any other comments,
} please send them along.
}
} Incidentally, I also tried version 3.14-5.  Make test did not fail, as it
} did for 4.02, but when the server started, I had exactly the same error:
} "Cannot lock file: Permission denied."  There is definitely something amiss
} on the server side.
}
} Regards,
}
} Ed L.
}
}
} >BTW:
} >Can someone of this list explain me, why the above trouble can happen
} >with FreeBSD?
} >Why is the installation of minivend successfull, if you install minivend
} >as the user root and use the chown command to set the right user and
} >group name?
} >
} >--
} >-------------Hans-Joachim Leidinger---------------------
} >
} >
} >-
} >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
}
} -
} 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
}-- End of excerpt from Ed LaFrance


-
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: