Best way to implement this is to use a lock file. When the process starts up, have it look for a lock file (which should be a unique file name). If the file exists, the process can just exit. Otherwise, the process can touch the file and proceed to do its job. Just before exiting the process will remove the file.
I am sorry, this is really trivial, yet I am not able to understand what the problem is!
I am using korn shell and running this script
#!/bin/ksh
keep=3
while ; do
echo $keep
keep=$(($keep-1))
done
I am getting this error: `keep=$' unexpected
I am not able to understand it because ... (1 Reply)
I am starting to code a few ideas of customization and tasks improvements on the office UNIX machine. My first script (see below) only contains ALIAS commands. But for some reason, when I execute it, the alias are not executed. I suspect it is because of the "#!/bin/ksh" not being recognized or... (4 Replies)
Hi All,
I am new to perl and have been trying to write a short script to check a process.Though i havent reached to the stage where i can match the output.
I am trying to pass a variable x with value /opt/RGw/csbp-base/CSBP_BAT.01.00.05/csbp_BAT.01.00.05.jar
and then pass another variable... (2 Replies)
Hi Experts,
Is there any command by which i can chk that the cron process is running fine? Say i have scheduled the cron to run at 10 o clock every monday,Do i need to wait for the time it runs and then chk using ps -ef?
Please shed some light.
Thanks
Ashok. (2 Replies)
Hi
Please can someone explain to me how they would go about monitoring the performance of a process in Unix. Lets say that a user is running a process in Unix but it seems to be taking a long time, whereas it completed a lot quicker yesterday. How would you go about investigating what is causing... (1 Reply)
Hi, i was looking for an answer for some trouble im having runing a script in the cron, thing is, that when i run it manually it works just fine. But when cron runs it, it just doenst work. I saw a reply on a similar subject, suggesting that the . .profile worked for you, but im kind of... (9 Replies)
Hi ,
I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility )
I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Experts,
Not sure whether the problem described here is related with Unix or is it with Oracle Installation. Here is the description of the issue:
A new Unix server is setup as a part of Unix and Oracle upgradation activity for one of the Application, I work on.
One strange thing is... (2 Replies)
Suppose i have 3 different servers say x,y and z.
Im running some process say ABC and 40 instances for the same is being created.
In load sharing suppose on
server x, 20 instances are running
server y, 10 instances are running
server z, 10 instances are running.
While checking the... (1 Reply)
Discussion started by: ankitknit
1 Replies
LEARN ABOUT DEBIAN
rlock
RLOCK(1) General Commands Manual RLOCK(1)NAME
rlock - run program with a lockfile
SYNOPSIS
rlock [options] lockfile program [args]
rlock [options] lockfile -- program options [args]
DESCRIPTION
rlock creates NFS safe lockfiles. it can optionally run a program while holding the lock, ensuring lockfile removal on program exit. if a
program is specified to be run rlock will spawn a background thread to kept the lockfile 'fresh' by touching it at a regular interval. in
this way a lease is maintained on the lockfile and other processes attempting to obtain the lock can determine that it is in use. see the
'--refresh' option for how to control the touch interval. any other process trying to obtain a lock will automatically remove a stale
lockfile; a stale lockfile is one that is older than a certain age. this age be controled via the '--max_age' option.
ENVIRONMENT
LOCKFILE_DEBUG=1
causes internal actions of the library to be shown on STDERR.
DIAGNOSTICS
rlock attempts to exit with the status of 'program' except where it cannot due to exceptional conditions. in addition the message
'RLOCK SUBCOMMAND FAILURE'
will be printed on STDERR if 'program' exits with non-zero status.
AUTHOR
lockfile was written by Ara T. Howard <ara.t.howard@noaa.gov>.
This manual page was converted by Decklin Foster <decklin@red-bean.com> for the Debian project (but may be used by others).
2008-10-11 RLOCK(1)