I have a problem with database access that I would like to sort out.
1. I gave a Windows 2003 server with SQL 2000 (SP3)
2. I decided to create different Windows Groups and add Windows accounts to
them to access different databases
3. This is where it starts giving me problem
4. I noticed that user belonging to one group (ie. database1 access) also
had access to database2
4. To test this I created a group called Test and addedd this to
Security/logins in Enterprise Manager and assigned this group access to
database1
5. I placed my own account into this group and that gave me access to all
other databases as well, even though the group Test is only set to
database1.
What is problem here'
OweTry running xp_logininfo to report the permission path(s) for the account.
For example
EXEC master..xp_logininfo 'MyDomain\Test', 'all'
For a Windows authenticated user to gain access to a database, one of the
following must be true:
- the account was granted database access
- the account is member of a Windows group than was granted database access
- the account is the database owner
- the account is a member of a sysadmin fixed server role
- the guest account is enabled in the database
Hope this helps.
Dan Guzman
SQL Server MVP
"Owe Armandt" <owe.armandt@.visma.se> wrote in message
news:ugQDkVnyFHA.2696@.TK2MSFTNGP10.phx.gbl...
>I have a problem with database access that I would like to sort out.
> 1. I gave a Windows 2003 server with SQL 2000 (SP3)
> 2. I decided to create different Windows Groups and add Windows accounts
> to them to access different databases
> 3. This is where it starts giving me problem
> 4. I noticed that user belonging to one group (ie. database1 access) also
> had access to database2
> 4. To test this I created a group called Test and addedd this to
> Security/logins in Enterprise Manager and assigned this group access to
> database1
> 5. I placed my own account into this group and that gave me access to all
> other databases as well, even though the group Test is only set to
> database1.
> What is problem here'
>
> Owe
>|||I helped a bit, I will test further tomorrow.
I found out that I (my windows account) happend to be owner of the database.
I have now changed the owner to 'sa' and then I get access only if the group
I belong to is set to have DB access.
One thing bothers me though, my college do not belong to any group that has
access to any database and still he could access the database that I was the
owner of.
I don't think he is part of admin ro anything, we try to kep our avccounts
clear in order to be as alike the users account as possible.
This is what I will try to check out tomorrow - I will be back tomorrow with
some info
Owe
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> skrev i meddelandet
news:OzfN9jnyFHA.464@.TK2MSFTNGP15.phx.gbl...
> Try running xp_logininfo to report the permission path(s) for the account.
> For example
> EXEC master..xp_logininfo 'MyDomain\Test', 'all'
> For a Windows authenticated user to gain access to a database, one of the
> following must be true:
> - the account was granted database access
> - the account is member of a Windows group than was granted database
> access
> - the account is the database owner
> - the account is a member of a sysadmin fixed server role
> - the guest account is enabled in the database
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Owe Armandt" <owe.armandt@.visma.se> wrote in message
> news:ugQDkVnyFHA.2696@.TK2MSFTNGP10.phx.gbl...
>
Showing posts with label sort. Show all posts
Showing posts with label sort. Show all posts
Friday, February 24, 2012
Friday, February 17, 2012
Does xp_cmdshell kill commands?
Is there some sort of timeout code in xp_cmdshell to kill commands?
I have certain commands executing through xp_cmdshell that get killed after
exactly 2 minutes. It's not every command, just certain commands.
Here is one example using rsh, although I've reproduce it with other
programs.
If I open a command prompt and type:
rsh servername sleep 180
This executes the command "sleep 180" on servername, where servername is
running a remote shell daemon. The rsh command sits there for 3 minutes and
then ends.
But if I open Query Analyzer and type:
exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
the rsh command ends in exactly 2 minutes with a "connection reset" error.
It's not a problem with the rsh command - I've tried the native Windows rsh
command, the rsh command from Cygwin, and a third party rsh command - all do
the same thing - they get killed after exactly 2 minutes when run through
xp_cmdshell, and run for the full 3 minutes from a command prompt. And it's
not a problem with the remote shell server - I've tried it against AIX,
Linux, VMS, and a Windows system running a Windows rshd. And I can
reproduce it with some other programs - I just used rsh as an example
because it is on every Windows system.
But it's not every program - I wrote a "sleep" command in C, which simply
calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell does
not kill it.
Any ideas?JJ,
I have never heard of xp_cmdshell killing a command. (Have I been asleep
and missed this?) There are server and connection settings, of course, such
as setting the "remote query timeout" server option, the "query timeout"
connection option, and so forth.
I would suggest that there is an interaction with one of these settings that
affects you. Then why does your code work? Perhaps the C Sleep command is
implemented with some activity, while the rsh command is truly silent.
FWIW - Russell Fields
"JJ" <jjj@.nospam.com> wrote in message
news:ec5tseDYEHA.3112@.tk2msftngp13.phx.gbl...
> Is there some sort of timeout code in xp_cmdshell to kill commands?
> I have certain commands executing through xp_cmdshell that get killed
after
> exactly 2 minutes. It's not every command, just certain commands.
> Here is one example using rsh, although I've reproduce it with other
> programs.
> If I open a command prompt and type:
> rsh servername sleep 180
> This executes the command "sleep 180" on servername, where servername is
> running a remote shell daemon. The rsh command sits there for 3 minutes
and
> then ends.
> But if I open Query Analyzer and type:
> exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
> the rsh command ends in exactly 2 minutes with a "connection reset" error.
> It's not a problem with the rsh command - I've tried the native Windows
rsh
> command, the rsh command from Cygwin, and a third party rsh command - all
do
> the same thing - they get killed after exactly 2 minutes when run through
> xp_cmdshell, and run for the full 3 minutes from a command prompt. And
it's
> not a problem with the remote shell server - I've tried it against AIX,
> Linux, VMS, and a Windows system running a Windows rshd. And I can
> reproduce it with some other programs - I just used rsh as an example
> because it is on every Windows system.
> But it's not every program - I wrote a "sleep" command in C, which simply
> calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell does
> not kill it.
> Any ideas?
>|||I'm at a loss to explain it too. "remote query timeout" is set at the
default of 600 (ten minutes) and "query timeout" is set at the default
of -1.
It was first reported to me by an end user of one of my programs. I then
was able to reproduce it here and even at home.
When run "normally" (from a command prompt or batch file) it worked
perfectly.
When my program is run from xp_cmdshell, after exactly two minutes, a call
to the Winsock API call recv() aborts with an error 10054 (connection
reset). I thought it was my program, until I was able to reproduce it with
other things, including the native Windows rsh command and Cygwin's rsh
command.
But it's not a hard timeout - some things run to completion and others do
not. But it is odd that when they die, they stop after exactly 2 minutes.
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
news:%23FoPxEEYEHA.716@.TK2MSFTNGP11.phx.gbl...
> JJ,
> I have never heard of xp_cmdshell killing a command. (Have I been asleep
> and missed this?) There are server and connection settings, of course,
such
> as setting the "remote query timeout" server option, the "query timeout"
> connection option, and so forth.
> I would suggest that there is an interaction with one of these settings
that
> affects you. Then why does your code work? Perhaps the C Sleep command
is
> implemented with some activity, while the rsh command is truly silent.
> FWIW - Russell Fields
> "JJ" <jjj@.nospam.com> wrote in message
> news:ec5tseDYEHA.3112@.tk2msftngp13.phx.gbl...
> > Is there some sort of timeout code in xp_cmdshell to kill commands?
> >
> > I have certain commands executing through xp_cmdshell that get killed
> after
> > exactly 2 minutes. It's not every command, just certain commands.
> >
> > Here is one example using rsh, although I've reproduce it with other
> > programs.
> >
> > If I open a command prompt and type:
> >
> > rsh servername sleep 180
> >
> > This executes the command "sleep 180" on servername, where servername is
> > running a remote shell daemon. The rsh command sits there for 3 minutes
> and
> > then ends.
> >
> > But if I open Query Analyzer and type:
> >
> > exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
> >
> > the rsh command ends in exactly 2 minutes with a "connection reset"
error.
> >
> > It's not a problem with the rsh command - I've tried the native Windows
> rsh
> > command, the rsh command from Cygwin, and a third party rsh command -
all
> do
> > the same thing - they get killed after exactly 2 minutes when run
through
> > xp_cmdshell, and run for the full 3 minutes from a command prompt. And
> it's
> > not a problem with the remote shell server - I've tried it against AIX,
> > Linux, VMS, and a Windows system running a Windows rshd. And I can
> > reproduce it with some other programs - I just used rsh as an example
> > because it is on every Windows system.
> >
> > But it's not every program - I wrote a "sleep" command in C, which
simply
> > calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell
does
> > not kill it.
> >
> > Any ideas?
> >
> >
>
I have certain commands executing through xp_cmdshell that get killed after
exactly 2 minutes. It's not every command, just certain commands.
Here is one example using rsh, although I've reproduce it with other
programs.
If I open a command prompt and type:
rsh servername sleep 180
This executes the command "sleep 180" on servername, where servername is
running a remote shell daemon. The rsh command sits there for 3 minutes and
then ends.
But if I open Query Analyzer and type:
exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
the rsh command ends in exactly 2 minutes with a "connection reset" error.
It's not a problem with the rsh command - I've tried the native Windows rsh
command, the rsh command from Cygwin, and a third party rsh command - all do
the same thing - they get killed after exactly 2 minutes when run through
xp_cmdshell, and run for the full 3 minutes from a command prompt. And it's
not a problem with the remote shell server - I've tried it against AIX,
Linux, VMS, and a Windows system running a Windows rshd. And I can
reproduce it with some other programs - I just used rsh as an example
because it is on every Windows system.
But it's not every program - I wrote a "sleep" command in C, which simply
calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell does
not kill it.
Any ideas?JJ,
I have never heard of xp_cmdshell killing a command. (Have I been asleep
and missed this?) There are server and connection settings, of course, such
as setting the "remote query timeout" server option, the "query timeout"
connection option, and so forth.
I would suggest that there is an interaction with one of these settings that
affects you. Then why does your code work? Perhaps the C Sleep command is
implemented with some activity, while the rsh command is truly silent.
FWIW - Russell Fields
"JJ" <jjj@.nospam.com> wrote in message
news:ec5tseDYEHA.3112@.tk2msftngp13.phx.gbl...
> Is there some sort of timeout code in xp_cmdshell to kill commands?
> I have certain commands executing through xp_cmdshell that get killed
after
> exactly 2 minutes. It's not every command, just certain commands.
> Here is one example using rsh, although I've reproduce it with other
> programs.
> If I open a command prompt and type:
> rsh servername sleep 180
> This executes the command "sleep 180" on servername, where servername is
> running a remote shell daemon. The rsh command sits there for 3 minutes
and
> then ends.
> But if I open Query Analyzer and type:
> exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
> the rsh command ends in exactly 2 minutes with a "connection reset" error.
> It's not a problem with the rsh command - I've tried the native Windows
rsh
> command, the rsh command from Cygwin, and a third party rsh command - all
do
> the same thing - they get killed after exactly 2 minutes when run through
> xp_cmdshell, and run for the full 3 minutes from a command prompt. And
it's
> not a problem with the remote shell server - I've tried it against AIX,
> Linux, VMS, and a Windows system running a Windows rshd. And I can
> reproduce it with some other programs - I just used rsh as an example
> because it is on every Windows system.
> But it's not every program - I wrote a "sleep" command in C, which simply
> calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell does
> not kill it.
> Any ideas?
>|||I'm at a loss to explain it too. "remote query timeout" is set at the
default of 600 (ten minutes) and "query timeout" is set at the default
of -1.
It was first reported to me by an end user of one of my programs. I then
was able to reproduce it here and even at home.
When run "normally" (from a command prompt or batch file) it worked
perfectly.
When my program is run from xp_cmdshell, after exactly two minutes, a call
to the Winsock API call recv() aborts with an error 10054 (connection
reset). I thought it was my program, until I was able to reproduce it with
other things, including the native Windows rsh command and Cygwin's rsh
command.
But it's not a hard timeout - some things run to completion and others do
not. But it is odd that when they die, they stop after exactly 2 minutes.
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
news:%23FoPxEEYEHA.716@.TK2MSFTNGP11.phx.gbl...
> JJ,
> I have never heard of xp_cmdshell killing a command. (Have I been asleep
> and missed this?) There are server and connection settings, of course,
such
> as setting the "remote query timeout" server option, the "query timeout"
> connection option, and so forth.
> I would suggest that there is an interaction with one of these settings
that
> affects you. Then why does your code work? Perhaps the C Sleep command
is
> implemented with some activity, while the rsh command is truly silent.
> FWIW - Russell Fields
> "JJ" <jjj@.nospam.com> wrote in message
> news:ec5tseDYEHA.3112@.tk2msftngp13.phx.gbl...
> > Is there some sort of timeout code in xp_cmdshell to kill commands?
> >
> > I have certain commands executing through xp_cmdshell that get killed
> after
> > exactly 2 minutes. It's not every command, just certain commands.
> >
> > Here is one example using rsh, although I've reproduce it with other
> > programs.
> >
> > If I open a command prompt and type:
> >
> > rsh servername sleep 180
> >
> > This executes the command "sleep 180" on servername, where servername is
> > running a remote shell daemon. The rsh command sits there for 3 minutes
> and
> > then ends.
> >
> > But if I open Query Analyzer and type:
> >
> > exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
> >
> > the rsh command ends in exactly 2 minutes with a "connection reset"
error.
> >
> > It's not a problem with the rsh command - I've tried the native Windows
> rsh
> > command, the rsh command from Cygwin, and a third party rsh command -
all
> do
> > the same thing - they get killed after exactly 2 minutes when run
through
> > xp_cmdshell, and run for the full 3 minutes from a command prompt. And
> it's
> > not a problem with the remote shell server - I've tried it against AIX,
> > Linux, VMS, and a Windows system running a Windows rshd. And I can
> > reproduce it with some other programs - I just used rsh as an example
> > because it is on every Windows system.
> >
> > But it's not every program - I wrote a "sleep" command in C, which
simply
> > calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell
does
> > not kill it.
> >
> > Any ideas?
> >
> >
>
Does xp_cmdshell kill commands?
Is there some sort of timeout code in xp_cmdshell to kill commands?
I have certain commands executing through xp_cmdshell that get killed after
exactly 2 minutes. It's not every command, just certain commands.
Here is one example using rsh, although I've reproduce it with other
programs.
If I open a command prompt and type:
rsh servername sleep 180
This executes the command "sleep 180" on servername, where servername is
running a remote shell daemon. The rsh command sits there for 3 minutes and
then ends.
But if I open Query Analyzer and type:
exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
the rsh command ends in exactly 2 minutes with a "connection reset" error.
It's not a problem with the rsh command - I've tried the native Windows rsh
command, the rsh command from Cygwin, and a third party rsh command - all do
the same thing - they get killed after exactly 2 minutes when run through
xp_cmdshell, and run for the full 3 minutes from a command prompt. And it's
not a problem with the remote shell server - I've tried it against AIX,
Linux, VMS, and a Windows system running a Windows rshd. And I can
reproduce it with some other programs - I just used rsh as an example
because it is on every Windows system.
But it's not every program - I wrote a "sleep" command in C, which simply
calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell does
not kill it.
Any ideas?
JJ,
I have never heard of xp_cmdshell killing a command. (Have I been asleep
and missed this?) There are server and connection settings, of course, such
as setting the "remote query timeout" server option, the "query timeout"
connection option, and so forth.
I would suggest that there is an interaction with one of these settings that
affects you. Then why does your code work? Perhaps the C Sleep command is
implemented with some activity, while the rsh command is truly silent.
FWIW - Russell Fields
"JJ" <jjj@.nospam.com> wrote in message
news:ec5tseDYEHA.3112@.tk2msftngp13.phx.gbl...
> Is there some sort of timeout code in xp_cmdshell to kill commands?
> I have certain commands executing through xp_cmdshell that get killed
after
> exactly 2 minutes. It's not every command, just certain commands.
> Here is one example using rsh, although I've reproduce it with other
> programs.
> If I open a command prompt and type:
> rsh servername sleep 180
> This executes the command "sleep 180" on servername, where servername is
> running a remote shell daemon. The rsh command sits there for 3 minutes
and
> then ends.
> But if I open Query Analyzer and type:
> exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
> the rsh command ends in exactly 2 minutes with a "connection reset" error.
> It's not a problem with the rsh command - I've tried the native Windows
rsh
> command, the rsh command from Cygwin, and a third party rsh command - all
do
> the same thing - they get killed after exactly 2 minutes when run through
> xp_cmdshell, and run for the full 3 minutes from a command prompt. And
it's
> not a problem with the remote shell server - I've tried it against AIX,
> Linux, VMS, and a Windows system running a Windows rshd. And I can
> reproduce it with some other programs - I just used rsh as an example
> because it is on every Windows system.
> But it's not every program - I wrote a "sleep" command in C, which simply
> calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell does
> not kill it.
> Any ideas?
>
|||I'm at a loss to explain it too. "remote query timeout" is set at the
default of 600 (ten minutes) and "query timeout" is set at the default
of -1.
It was first reported to me by an end user of one of my programs. I then
was able to reproduce it here and even at home.
When run "normally" (from a command prompt or batch file) it worked
perfectly.
When my program is run from xp_cmdshell, after exactly two minutes, a call
to the Winsock API call recv() aborts with an error 10054 (connection
reset). I thought it was my program, until I was able to reproduce it with
other things, including the native Windows rsh command and Cygwin's rsh
command.
But it's not a hard timeout - some things run to completion and others do
not. But it is odd that when they die, they stop after exactly 2 minutes.
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
news:%23FoPxEEYEHA.716@.TK2MSFTNGP11.phx.gbl...
> JJ,
> I have never heard of xp_cmdshell killing a command. (Have I been asleep
> and missed this?) There are server and connection settings, of course,
such
> as setting the "remote query timeout" server option, the "query timeout"
> connection option, and so forth.
> I would suggest that there is an interaction with one of these settings
that
> affects you. Then why does your code work? Perhaps the C Sleep command
is[vbcol=seagreen]
> implemented with some activity, while the rsh command is truly silent.
> FWIW - Russell Fields
> "JJ" <jjj@.nospam.com> wrote in message
> news:ec5tseDYEHA.3112@.tk2msftngp13.phx.gbl...
> after
> and
error.[vbcol=seagreen]
> rsh
all[vbcol=seagreen]
> do
through[vbcol=seagreen]
> it's
simply[vbcol=seagreen]
does
>
I have certain commands executing through xp_cmdshell that get killed after
exactly 2 minutes. It's not every command, just certain commands.
Here is one example using rsh, although I've reproduce it with other
programs.
If I open a command prompt and type:
rsh servername sleep 180
This executes the command "sleep 180" on servername, where servername is
running a remote shell daemon. The rsh command sits there for 3 minutes and
then ends.
But if I open Query Analyzer and type:
exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
the rsh command ends in exactly 2 minutes with a "connection reset" error.
It's not a problem with the rsh command - I've tried the native Windows rsh
command, the rsh command from Cygwin, and a third party rsh command - all do
the same thing - they get killed after exactly 2 minutes when run through
xp_cmdshell, and run for the full 3 minutes from a command prompt. And it's
not a problem with the remote shell server - I've tried it against AIX,
Linux, VMS, and a Windows system running a Windows rshd. And I can
reproduce it with some other programs - I just used rsh as an example
because it is on every Windows system.
But it's not every program - I wrote a "sleep" command in C, which simply
calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell does
not kill it.
Any ideas?
JJ,
I have never heard of xp_cmdshell killing a command. (Have I been asleep
and missed this?) There are server and connection settings, of course, such
as setting the "remote query timeout" server option, the "query timeout"
connection option, and so forth.
I would suggest that there is an interaction with one of these settings that
affects you. Then why does your code work? Perhaps the C Sleep command is
implemented with some activity, while the rsh command is truly silent.
FWIW - Russell Fields
"JJ" <jjj@.nospam.com> wrote in message
news:ec5tseDYEHA.3112@.tk2msftngp13.phx.gbl...
> Is there some sort of timeout code in xp_cmdshell to kill commands?
> I have certain commands executing through xp_cmdshell that get killed
after
> exactly 2 minutes. It's not every command, just certain commands.
> Here is one example using rsh, although I've reproduce it with other
> programs.
> If I open a command prompt and type:
> rsh servername sleep 180
> This executes the command "sleep 180" on servername, where servername is
> running a remote shell daemon. The rsh command sits there for 3 minutes
and
> then ends.
> But if I open Query Analyzer and type:
> exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
> the rsh command ends in exactly 2 minutes with a "connection reset" error.
> It's not a problem with the rsh command - I've tried the native Windows
rsh
> command, the rsh command from Cygwin, and a third party rsh command - all
do
> the same thing - they get killed after exactly 2 minutes when run through
> xp_cmdshell, and run for the full 3 minutes from a command prompt. And
it's
> not a problem with the remote shell server - I've tried it against AIX,
> Linux, VMS, and a Windows system running a Windows rshd. And I can
> reproduce it with some other programs - I just used rsh as an example
> because it is on every Windows system.
> But it's not every program - I wrote a "sleep" command in C, which simply
> calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell does
> not kill it.
> Any ideas?
>
|||I'm at a loss to explain it too. "remote query timeout" is set at the
default of 600 (ten minutes) and "query timeout" is set at the default
of -1.
It was first reported to me by an end user of one of my programs. I then
was able to reproduce it here and even at home.
When run "normally" (from a command prompt or batch file) it worked
perfectly.
When my program is run from xp_cmdshell, after exactly two minutes, a call
to the Winsock API call recv() aborts with an error 10054 (connection
reset). I thought it was my program, until I was able to reproduce it with
other things, including the native Windows rsh command and Cygwin's rsh
command.
But it's not a hard timeout - some things run to completion and others do
not. But it is odd that when they die, they stop after exactly 2 minutes.
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
news:%23FoPxEEYEHA.716@.TK2MSFTNGP11.phx.gbl...
> JJ,
> I have never heard of xp_cmdshell killing a command. (Have I been asleep
> and missed this?) There are server and connection settings, of course,
such
> as setting the "remote query timeout" server option, the "query timeout"
> connection option, and so forth.
> I would suggest that there is an interaction with one of these settings
that
> affects you. Then why does your code work? Perhaps the C Sleep command
is[vbcol=seagreen]
> implemented with some activity, while the rsh command is truly silent.
> FWIW - Russell Fields
> "JJ" <jjj@.nospam.com> wrote in message
> news:ec5tseDYEHA.3112@.tk2msftngp13.phx.gbl...
> after
> and
error.[vbcol=seagreen]
> rsh
all[vbcol=seagreen]
> do
through[vbcol=seagreen]
> it's
simply[vbcol=seagreen]
does
>
Does xp_cmdshell kill commands?
Is there some sort of timeout code in xp_cmdshell to kill commands?
I have certain commands executing through xp_cmdshell that get killed after
exactly 2 minutes. It's not every command, just certain commands.
Here is one example using rsh, although I've reproduce it with other
programs.
If I open a command prompt and type:
rsh servername sleep 180
This executes the command "sleep 180" on servername, where servername is
running a remote shell daemon. The rsh command sits there for 3 minutes and
then ends.
But if I open Query Analyzer and type:
exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
the rsh command ends in exactly 2 minutes with a "connection reset" error.
It's not a problem with the rsh command - I've tried the native Windows rsh
command, the rsh command from Cygwin, and a third party rsh command - all do
the same thing - they get killed after exactly 2 minutes when run through
xp_cmdshell, and run for the full 3 minutes from a command prompt. And it's
not a problem with the remote shell server - I've tried it against AIX,
Linux, VMS, and a Windows system running a Windows rshd. And I can
reproduce it with some other programs - I just used rsh as an example
because it is on every Windows system.
But it's not every program - I wrote a "sleep" command in C, which simply
calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell does
not kill it.
Any ideas?JJ,
I have never heard of xp_cmdshell killing a command. (Have I been asleep
and missed this?) There are server and connection settings, of course, such
as setting the "remote query timeout" server option, the "query timeout"
connection option, and so forth.
I would suggest that there is an interaction with one of these settings that
affects you. Then why does your code work? Perhaps the C Sleep command is
implemented with some activity, while the rsh command is truly silent.
FWIW - Russell Fields
"JJ" <jjj@.nospam.com> wrote in message
news:ec5tseDYEHA.3112@.tk2msftngp13.phx.gbl...
> Is there some sort of timeout code in xp_cmdshell to kill commands?
> I have certain commands executing through xp_cmdshell that get killed
after
> exactly 2 minutes. It's not every command, just certain commands.
> Here is one example using rsh, although I've reproduce it with other
> programs.
> If I open a command prompt and type:
> rsh servername sleep 180
> This executes the command "sleep 180" on servername, where servername is
> running a remote shell daemon. The rsh command sits there for 3 minutes
and
> then ends.
> But if I open Query Analyzer and type:
> exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
> the rsh command ends in exactly 2 minutes with a "connection reset" error.
> It's not a problem with the rsh command - I've tried the native Windows
rsh
> command, the rsh command from Cygwin, and a third party rsh command - all
do
> the same thing - they get killed after exactly 2 minutes when run through
> xp_cmdshell, and run for the full 3 minutes from a command prompt. And
it's
> not a problem with the remote shell server - I've tried it against AIX,
> Linux, VMS, and a Windows system running a Windows rshd. And I can
> reproduce it with some other programs - I just used rsh as an example
> because it is on every Windows system.
> But it's not every program - I wrote a "sleep" command in C, which simply
> calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell does
> not kill it.
> Any ideas?
>|||I'm at a loss to explain it too. "remote query timeout" is set at the
default of 600 (ten minutes) and "query timeout" is set at the default
of -1.
It was first reported to me by an end user of one of my programs. I then
was able to reproduce it here and even at home.
When run "normally" (from a command prompt or batch file) it worked
perfectly.
When my program is run from xp_cmdshell, after exactly two minutes, a call
to the Winsock API call recv() aborts with an error 10054 (connection
reset). I thought it was my program, until I was able to reproduce it with
other things, including the native Windows rsh command and Cygwin's rsh
command.
But it's not a hard timeout - some things run to completion and others do
not. But it is odd that when they die, they stop after exactly 2 minutes.
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
news:%23FoPxEEYEHA.716@.TK2MSFTNGP11.phx.gbl...
> JJ,
> I have never heard of xp_cmdshell killing a command. (Have I been asleep
> and missed this?) There are server and connection settings, of course,
such
> as setting the "remote query timeout" server option, the "query timeout"
> connection option, and so forth.
> I would suggest that there is an interaction with one of these settings
that
> affects you. Then why does your code work? Perhaps the C Sleep command
is
> implemented with some activity, while the rsh command is truly silent.
> FWIW - Russell Fields
> "JJ" <jjj@.nospam.com> wrote in message
> news:ec5tseDYEHA.3112@.tk2msftngp13.phx.gbl...
> after
> and
error.[vbcol=seagreen]
> rsh
all[vbcol=seagreen]
> do
through[vbcol=seagreen]
> it's
simply[vbcol=seagreen]
does[vbcol=seagreen]
>
I have certain commands executing through xp_cmdshell that get killed after
exactly 2 minutes. It's not every command, just certain commands.
Here is one example using rsh, although I've reproduce it with other
programs.
If I open a command prompt and type:
rsh servername sleep 180
This executes the command "sleep 180" on servername, where servername is
running a remote shell daemon. The rsh command sits there for 3 minutes and
then ends.
But if I open Query Analyzer and type:
exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
the rsh command ends in exactly 2 minutes with a "connection reset" error.
It's not a problem with the rsh command - I've tried the native Windows rsh
command, the rsh command from Cygwin, and a third party rsh command - all do
the same thing - they get killed after exactly 2 minutes when run through
xp_cmdshell, and run for the full 3 minutes from a command prompt. And it's
not a problem with the remote shell server - I've tried it against AIX,
Linux, VMS, and a Windows system running a Windows rshd. And I can
reproduce it with some other programs - I just used rsh as an example
because it is on every Windows system.
But it's not every program - I wrote a "sleep" command in C, which simply
calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell does
not kill it.
Any ideas?JJ,
I have never heard of xp_cmdshell killing a command. (Have I been asleep
and missed this?) There are server and connection settings, of course, such
as setting the "remote query timeout" server option, the "query timeout"
connection option, and so forth.
I would suggest that there is an interaction with one of these settings that
affects you. Then why does your code work? Perhaps the C Sleep command is
implemented with some activity, while the rsh command is truly silent.
FWIW - Russell Fields
"JJ" <jjj@.nospam.com> wrote in message
news:ec5tseDYEHA.3112@.tk2msftngp13.phx.gbl...
> Is there some sort of timeout code in xp_cmdshell to kill commands?
> I have certain commands executing through xp_cmdshell that get killed
after
> exactly 2 minutes. It's not every command, just certain commands.
> Here is one example using rsh, although I've reproduce it with other
> programs.
> If I open a command prompt and type:
> rsh servername sleep 180
> This executes the command "sleep 180" on servername, where servername is
> running a remote shell daemon. The rsh command sits there for 3 minutes
and
> then ends.
> But if I open Query Analyzer and type:
> exec master.dbo.xp_cmdshell 'rsh servername sleep 180'
> the rsh command ends in exactly 2 minutes with a "connection reset" error.
> It's not a problem with the rsh command - I've tried the native Windows
rsh
> command, the rsh command from Cygwin, and a third party rsh command - all
do
> the same thing - they get killed after exactly 2 minutes when run through
> xp_cmdshell, and run for the full 3 minutes from a command prompt. And
it's
> not a problem with the remote shell server - I've tried it against AIX,
> Linux, VMS, and a Windows system running a Windows rshd. And I can
> reproduce it with some other programs - I just used rsh as an example
> because it is on every Windows system.
> But it's not every program - I wrote a "sleep" command in C, which simply
> calls Sleep(180000), which will sleep for 3 minutes, and xp_cmdshell does
> not kill it.
> Any ideas?
>|||I'm at a loss to explain it too. "remote query timeout" is set at the
default of 600 (ten minutes) and "query timeout" is set at the default
of -1.
It was first reported to me by an end user of one of my programs. I then
was able to reproduce it here and even at home.
When run "normally" (from a command prompt or batch file) it worked
perfectly.
When my program is run from xp_cmdshell, after exactly two minutes, a call
to the Winsock API call recv() aborts with an error 10054 (connection
reset). I thought it was my program, until I was able to reproduce it with
other things, including the native Windows rsh command and Cygwin's rsh
command.
But it's not a hard timeout - some things run to completion and others do
not. But it is odd that when they die, they stop after exactly 2 minutes.
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
news:%23FoPxEEYEHA.716@.TK2MSFTNGP11.phx.gbl...
> JJ,
> I have never heard of xp_cmdshell killing a command. (Have I been asleep
> and missed this?) There are server and connection settings, of course,
such
> as setting the "remote query timeout" server option, the "query timeout"
> connection option, and so forth.
> I would suggest that there is an interaction with one of these settings
that
> affects you. Then why does your code work? Perhaps the C Sleep command
is
> implemented with some activity, while the rsh command is truly silent.
> FWIW - Russell Fields
> "JJ" <jjj@.nospam.com> wrote in message
> news:ec5tseDYEHA.3112@.tk2msftngp13.phx.gbl...
> after
> and
error.[vbcol=seagreen]
> rsh
all[vbcol=seagreen]
> do
through[vbcol=seagreen]
> it's
simply[vbcol=seagreen]
does[vbcol=seagreen]
>
Subscribe to:
Posts (Atom)