Jump to content
StickyChopstix

Restarting multiple processes

Recommended Posts

StickyChopstix

I'm using a server and basically I want to kill all processes named X for every user that has it open and then start the process again at a later time in my script but only for users that had it open in the first place.

Share this post


Link to post
Share on other sites
aa2zz6

Maybe this link answers ur question: 

 

Share this post


Link to post
Share on other sites
JLogan3o13

You would have to use administrative credentials to kill said processes, then you would have to have the users' credentials in order to restart it for their session. Why on earth would you want to do this?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
StickyChopstix
Posted (edited)
43 minutes ago, JLogan3o13 said:

You would have to use administrative credentials to kill said processes, then you would have to have the users' credentials in order to restart it for their session. Why on earth would you want to do this?

When X program has issues, I may have to run a db file (that X will be using) through a cleaner program, but I can't modify the db while it's in use. Naturally, I have to close X in order to clean up the db and then restart it after I'm done.

Edited by StickyChopstix

Share this post


Link to post
Share on other sites
JLogan3o13

And I understand (and agree) with everything right up until the point where you restart the process under the users' session. You aren't going to be able to do that programmatically, regardless of the language, without having their credentials - which as an admin you should realize is a huge security risk.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
aa2zz6
5 minutes ago, JLogan3o13 said:

And I understand (and agree) with everything right up until the point where you restart the process under the users' session. You aren't going to be able to do that programmatically, regardless of the language, without having their credentials - which as an admin you should realize is a huge security risk.

If he has admin access couldn't he stop the service in Services and start the service at a later time?

Share this post


Link to post
Share on other sites
StickyChopstix
Posted (edited)

In that case, I suppose I can work around it by having scripts on each user check for X every 10 minutes (usually how long it takes to finish cleaning up the db), and restart it if process doesn't exist. That just leaves the problem of killing all processes named X for every user.

EDIT: I suppose I don't need AutoIt to do these do I? Would a .bat file be able to do the job?

Edited by StickyChopstix

Share this post


Link to post
Share on other sites
Danp2

I would suggest creating a file on the server that would indicate the server has been place in maintenance mode. You could have a script running on the remote PC that monitors for this file and then does the following steps --

  • Notifies the user and allows them to save their work
  • After a designated period of time, closes the app
  • Continues to display a status window so that the user won't relaunch the app prematurely
  • Reloads the app once the file has been removed

Share this post


Link to post
Share on other sites
JLogan3o13
9 hours ago, aa2zz6 said:

If he has admin access couldn't he stop the service in Services and start the service at a later time?

You miss the point of his original question; he wanted to restart the service for the users, which would mean launching the process under their sessions (which in turn means having access to their session credentials).


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×