Find Jobs
Hire Freelancers

BASH controlling processes

€30-250 EUR

Cancelled
Posted almost 8 years ago

€30-250 EUR

Paid on delivery
PROCCESS CONTROL I added the test file called [login to view URL] which the script should be passed through to complete the tests. I would like to write a script in BASH, which will ensure that certain server applications always run a certain number of instances. The script as an argument gets the interval in seconds meaning how often it will review the number of instances... and the pipeline, through which it will receive commands. Example call scripts: ./[login to view URL] 1 inputpipe In this case, the script is checking the number of instances inone-second intervals, and commands are received from the pipeline inputpipe. Through the pipeline will receive the script line commands proc, log, stop and exit. The syntax of individual commands: proc:number_of_target_processes:the_list_of_existing_processes log [last] stop:command_line exit Unknown commands or commands with the wrong arguments the script ignores. Exit command has no arguments, the command log can be without an argument or the argument "last". Command stop gets as an argument the command line with the canonical path to the program with arguments, with which the program is run. Command proc accepts (arguments are separated by ":") the target number of instances of a particular program and the PID for at least one existing program instance (if given more PIDs, separated by commas). For example, we have two xclock processes with PID 50 and 113, and we want to always have 3 active instance of the program xclock (we have 2 already), scripts gets the following command through the pipeline: Proc:3:50,113 In this case, the script checks if PIDs really belong to the same instance of the program and also check that both instance run with the same arguments. Eg. if the first PID belongs to the instance of the program, which was run as xclock and second PID instance, we run the xclock as -digial, these are the same instance of the program, but did not run with the same arguments. If any of the PIDs does not belong to the same program or not executed with the same arguments as the rest, on the standard error echo the "PID matching error:" with the PIDs of all the commands, which have been problematic. For example: "PID matching error: 50, 113". If you run the program xclock absolute or relative to a location (eg. Xclock -digital and / usr / bin / xclock -digital), these are the same instance of the program, run with the same arguments. The comparison is restricted to a canonical path to the program and the list of arguments, but we will not compare to environmental variables (eg. PWD, PATH), although these may vary. If the instance match, then it is necessary to achieve the target number of processes (in the above case 3). So that the system will not be overloaded due to an excessive number of starts in a short time, the programs are being started in the n-second intervals (the first new instance is started immediately after, the second n-seconds, the third n-seconds after the second, etc.). The length of the interval was specified as the first argument of the script. If the number of processes have already reached (or exceeded), nothing happens unless the number of processes falls below the desired limit, in this case, we begin to create new processes. If command proc sends the PID of the process which is an instance of the program with the arguments that is already running then echo to STDERR -> ( "Run configuration already exists.") and ignore the proc command.
Project ID: 10602021

About the project

6 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
6 freelancers are bidding on average €336 EUR for this job
User Avatar
hello i have seen the script and the bash script requirement with the various requirements that you have listed in your project description. kindly message me to discuss in detail and get started.
€250 EUR in 3 days
5.0 (18 reviews)
3.9
3.9
User Avatar
Hello Sir, We are a Indian development company here. we have checked your posted details here and want more clarification in it, so message us to discuss on it more then we will able to move on it. Thanks
€584 EUR in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Please check my reviews to know a bit about me
€250 EUR in 5 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of SLOVENIA
Slovenia
0.0
0
Member since May 25, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.