Solved

How can one system process stop and start another process?

Posted on 2004-08-23
18
142 Views
Last Modified: 2012-05-05
I have several System Processes running that communicate via the MSMQ. For some reason one of them “goes bad” once in a while. Have not been able to figure out exactly why yet. Do know if I stop and start that process (“cycle power”), it starts working again and things are fine.
So I thought I could have a “Monitor” process, which would not only email me if things went bad, but also stop and start or “cycle power” on a process which seemed to be the problem.
Well, this is not working because the “Monitor” process does not have the authority to stop and start another process. I do not know how to give it such authority. Is this possible? Could this be a big problem? Help!
Thanks,
0
Comment
Question by:wsfindlater
  • 7
  • 7
  • 4
18 Comments
 
LVL 17

Expert Comment

by:Eagle6990
Comment Utility
Why not just go to the properties of the particular process and on the Recovery tab, select it so that on the first failure it restarts the service?  You could also have it start a program that could launch a batch file that restarts the service and/or e-mail/net send you a message.

Something like
net start "The particular service"
0
 

Author Comment

by:wsfindlater
Comment Utility
Eagle-
The problem with your suggestion is that "the particular process" does not know it failed. This is only known by the Monitor process which reads a data table (log).
You did give me an idea, however. Maybe I could have each process monitor itself, and it it was not "working", kill itself, which could trigger a batch file.
This would be more complicated for me, but if no one can help me with the permissions, you get the points.
0
 
LVL 17

Expert Comment

by:Eagle6990
Comment Utility
I don't know how you are going to write your own monitoring service to detect if a particular service isn't working properly, but you can use a batch file to do your sopping and restarting for you. Just have your monitor service fire up a batch file with something like this in it.

net stop "The process that needs stopping"
net start "The same process name

That will stop and restart the service that needs repair.  Past that, I'm out of my field, since I'm not a programmer since college.
0
 
LVL 9

Expert Comment

by:jdeclue
Comment Utility
IF the monitor process is running as a service, than you can set the process to login with a local account that has administrative rights. Additionally, you may need to goto local security policy and grant the account log on as a batch job, etc. This should give the monitor the ability to stop and start services.

J
0
 

Author Comment

by:wsfindlater
Comment Utility
jdeclue-
Tried your suggestion of setting the Monitor process to login with a local account that has administrative right. This did not seem to be enough.
Do not understand "grant the account log on as a batch job". How do I do that?
Thanks,
0
 
LVL 9

Expert Comment

by:jdeclue
Comment Utility
If you go toAdministrative Tools, you will see a local security policy. In the local security policy there are additional privileges that you can give to an account. Usually services require more than default Administrator. I will go look at them and recommend which onesto add, just a sec.
0
 
LVL 9

Expert Comment

by:jdeclue
Comment Utility
In Local Security Policy, open Local Policies andthen User Rghts Asignments

Add the new user to
Log on as a service
Log on as a batch job

See if that does it.
0
 

Author Comment

by:wsfindlater
Comment Utility
The "effective policy setting" seems to be blocked

"If domain-level policy settings are defined, they override local policy settings."

Does this mean I am out of luck?
0
 
LVL 9

Expert Comment

by:jdeclue
Comment Utility
This means that the Domain GPO is setting te policy, and overriding the local policy. Do you have access to the AD Goup Policy?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 17

Expert Comment

by:Eagle6990
Comment Utility
No luck with my batch file idea?
0
 

Author Comment

by:wsfindlater
Comment Utility
jdeclue,
No, at present I do not have that access. Might be able to get it.
Eagle,
No, have not tryed your "batch file idea" yet.
Did try having the process stop itself, but guess that was not a "failure", because it did not restart on failure.
Your bach idea looks mighty good right now, so I will try it.
Thanks,
0
 
LVL 9

Expert Comment

by:jdeclue
Comment Utility
Wiat a minute... effectve policy shows you what it is. Just add it to the local policy, if it is not defined in the Global Policy than the effective will be what you put in local.
0
 
LVL 9

Expert Comment

by:jdeclue
Comment Utility
Sorry, I keep working on the credentials issue. The batch file is worth a try, as Eagle says. Just log in to the machine as the user you created, open a cmd prompt and try typing the Net Stop and Net Start, see if it works. It might be a service issue.

In reality it should fail, because the service is running with the same credentials. so when the btach file gets kicked off by the service, it will run under the credentials of the service which started the process. But the test is easy, and if it works, then it may not be a credentials issue, just a bad error message.

J
0
 

Author Comment

by:wsfindlater
Comment Utility
jdeclue,
You are right. The Batch job got the same error message.

Not sure I understand what you mean by "Just add it to the local policy".
Can not see the Global Policy, since the check boxes are filled in.

Did set the local policy to:
Add the new user to
Log on as a service
Log on as a batch job

Thanks,
0
 
LVL 9

Assisted Solution

by:jdeclue
jdeclue earned 200 total points
Comment Utility
Ok then as a last test add the user to the Act as part of the Operating System in local policy.

After yu change the local policy, does the effective settings change as well.

J
P.S. I dont have windows 2000 in front of me today, so I could be wrong about the exact settings and where, this is from memory.

0
 

Author Comment

by:wsfindlater
Comment Utility
I can not see what the effective setting are. They do not change, just remain filled in boxes.
The user is my own account, and it was already set for "Act as part of Operating System".

Been looking at simply scheduling a reboot every night, but even for that I need a "Shutdown.exe" program from the resource kit that I do not have.

Thanks,
0
 
LVL 17

Accepted Solution

by:
Eagle6990 earned 300 total points
Comment Utility
0
 

Author Comment

by:wsfindlater
Comment Utility
Thanks a lot to both of you.
Learned quite a bit.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
A procedure for exporting installed hotfix details of remote computers using powershell
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now