Win 2k8 Server 64bit - Named (System Wide) Semaphores - SQL Server 2k8

  • Hello,

    We have, for years, been running software in which a standalone Windows executable ('management program') creates a system semaphore and waits. In SQL Server, we use xp_cmdshell to execute another Windows executable ('work program') that will open this semaphore, do some work, and release it. However, once we upgraded to Windows 2008 Server 64bit, this functionality was broken. When a named system semaphore is created OUTSIDE of SQL Server's xp_cmdshell by the 'MANAGEMENT' program, we cannot access this semaphore when we invoke an instance of our 'WORK' program via xp_cmdshell. The documentation at http://msdn.microsoft.com/en-us/library/z6zx288a.aspx clearly states that "once the named semaphore is created, it is visible to all threads in all processes" and it has worked perfectly up until our Windows 2008 Server 64bit upgrade from 2003 Server 32bit.

    A named system semaphore, which is SUPPOSED to be available to the entire system, is not. I cannot access these semaphores from xp_cmdshell from SQL Server 2008 unless they are created in SQL Server 2008. The purpose of them is to be accessible from ANYWHERE in the system, by name, as clearly stated at http://msdn.microsoft.com/en-us/library/z6zx288a.aspx.

    Does anyone know any reasons/fixes/workarounds/etc for this problem?

  • How do you have the execution context of the xp_cmdshell set up? Are you using a proxy or is it running in the context of the SQLServer service user (generally a domain user but could be a local user) The default is system or network and that may not have permissions to see semaphores.

    The probability of survival is inversely proportional to the angle of arrival.

  • You posted this same question on both the General and the T-SQL forms.

    Please DO NOT cross-post.

    Thanks . . .

    +--------------------------------------------------------------------------------------+
    Check out my blog at https://pianorayk.wordpress.com/

  • Ray K (12/22/2009)


    You posted this same question on both the General and the T-SQL forms.

    I know.

    Please DO NOT cross-post.

    SORRY. I wasn't sure where it belonged, whether it was a general sql issue or a t-sql issue.

    Thanks . . .

    You're welcome.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply