Could not obtain semaphore

Post Reply
pzig
Posts: 7
Joined: Thu Sep 11, 2003 4:51 pm

Could not obtain semaphore

Post by pzig »

After several months of running webinator. Now I am getting this error every day when an auto rewalk occours.

Last complete walk: 2003-09-11 06:00:01
002 /usr/home/santel.net/we/wei/public_html/webinator/dowalk(dispatch) 2998: Could not obtain semaphore: No space left on device

000 /usr/home/santel.net/we/wei/public_html/webinator/dowalk(dispatch) 2998: Could not open locking mechanism in the function ddopen

000 /usr/home/santel.net/we/wei/public_html/webinator/dowalk(dispatch) 2998: Could not connect to /home/santel.net/we/wei/webinator/texis/dealer/db1 in the function openntexis
(took seconds)
Failure.

I have done some research on this board and contacted my system administrator and asked him to use IPCS and IPCRM to resolve the problem. Here is his response.

This does not tell me what I need to tweak in the kernel. Here
are the current semaphore params:

> ipcs -S
seminfo:
semmap: 30 (# of entries in semaphore map)
semmni: 10 (# of semaphore identifiers)
semmns: 60 (# of semaphores in system)
semmnu: 30 (# of undo structures in system)
semmsl: 60 (max # of semaphores per id)
semopm: 100 (max # of operations per semop call)
semume: 10 (max # of undo entries per process)
semusz: 92 (size in bytes of undo structure)
semvmx: 32767 (semaphore maximum value)
semaem: 16384 (adjust on exit max value)

What parameter needs to be changed?

I am also concerned that if we increase this it could have
dramatic consequences. If your coding is not right, it could
bring the system down. Please verify these parameters with your
software provider.

What is my next step?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Could not obtain semaphore

Post by mark »

See http://thunderstone.master.com/texis/ma ... 3cfd208810 for the changes to make to the system to increase semaphores.

If you only have a couple of walks and nothing else on the system that is hogging semaphores you should not be running out, even with the low default numbers. It will only use 1 semaphore per database under normal circumstances. If webinator is making new semaphores and not releasing old ones you may have an installation problem where webinator has not been made setuid to the desired database manager account (or otherwise ensured that it always runs as the same user).

Check your installation. In INSTALLDIR/bin you should find monitor with perms something like "-rwsr-xr-x dba xx" (the s in rws indicates setuid). In your CGI directory you should find texis as a softlink to the installed monitor or as a copy of it with the same permissions and ownerships.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Could not obtain semaphore

Post by mark »

Oh, one other thing. Make sure the database(s) are not being access from multiple machines via nfs or such.
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

Could not obtain semaphore

Post by Kai »

One semaphore per database is needed. You might have orphaned semaphores left over from some old deleted databases, which are taking up space. Before setting anything in the kernel, try listing all semaphores with:

ipcs -s

If you see significantly more (over 5) listed than the number of databases you use, plus 2, plus any in use by other software packages on the system, you can delete old ones to free up some space with:

ipcrm -s ID

where ID is a value from the ID column. You shouldn't need to be root/administrator to do this, as Webinator should not be running as root. Do this when no walks are running, in case a live database's semaphore is deleted (it will automatically be re-created though).

If you regularly use many databases *concurrently*, then you might need to actually increase the kernel limits, but check this first.
Post Reply