Solved

How can one system process stop and start another process?

Posted on 2004-08-23
18
147 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
  • 4
18 Comments
 
LVL 17

Expert Comment

by:Eagle6990
ID: 11876975
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
ID: 11877081
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
ID: 11877134
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
Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

 
LVL 9

Expert Comment

by:jdeclue
ID: 11882434
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
ID: 11885232
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
ID: 11885262
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
ID: 11885282
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
ID: 11885423
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
ID: 11885479
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
 
LVL 17

Expert Comment

by:Eagle6990
ID: 11885587
No luck with my batch file idea?
0
 

Author Comment

by:wsfindlater
ID: 11885676
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
ID: 11885693
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
ID: 11885821
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
ID: 11886615
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
ID: 11886882
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
ID: 11887085
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
ID: 11887193
0
 

Author Comment

by:wsfindlater
ID: 11887469
Thanks a lot to both of you.
Learned quite a bit.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 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