03-08-2010
Simple thing would be,
1. At the start of the process, check whether a lock file is there, else create the lock file. Do the process A. At the end delete the lock file.
2. Do the same for process B, check whether a lock file exist, if it is there, dont start process B, else start and do as similar as step 1.
10 More Discussions You Might Find Interesting
1. Solaris
Hi,
Thanks in advance.
i need to kill a unix background running job after that job process completes.
i can kill a job by giving the following unix command
kill -9 processid
how to kill the job after the current process run gets completed ?
Appreciate your valuable help.
Thanks... (7 Replies)
Discussion started by: dtazv
7 Replies
2. Shell Programming and Scripting
Hi,
I have a situation... I have a script it checks for a file in a folder which comes to the folder every day at specified time...2am to 4 am, once the file is in the polder my process starts...but the problem is the files being placed are huge and it is even taking half an hour for the file... (3 Replies)
Discussion started by: mgirinath
3 Replies
3. UNIX for Advanced & Expert Users
Hi,
can you please help me with one problem?
There is some server, there are a lot of AIX applications which run on this server under different UserIDs.
These applications starts via crontab.
From time to time some application doesn't start.
What can this "not-action" be dependent on?
At... (5 Replies)
Discussion started by: Anta
5 Replies
4. AIX
Hi ,
I am trying to execute one script residing on server B from server A and in automated way but with a trigger.
My main quetion are
1) How I will login to the remote server automatically with user name and password. ( rsh or any other way ?)
2) Once logged in I need to execute... (2 Replies)
Discussion started by: agent47
2 Replies
5. UNIX for Advanced & Expert Users
Hello - I submitted one background job last night and it completed today morning.I want to know exact time the job completed.
I submitted backgroung job like this
nohup cp -Rp /opt/apps/prod/proddb/proddata . &
I want to know when above job completed on UNIX server.Above command... (9 Replies)
Discussion started by: Mansoor8810
9 Replies
6. Shell Programming and Scripting
Hi,
The HPCs I used earlier used PBS (Portable Batch System) to schedule when I was running various jobs and it had an option to send me an email once a job is completed.
I'm wondering whether this is possible for any other process (without the use of PBS). For example, I'm running some codes... (2 Replies)
Discussion started by: lost.identity
2 Replies
7. Shell Programming and Scripting
I'm running diff at the command prompt against two very large text files (>1GB) and system kills the process and replys back "Terminated" after 15 seconds.
I believe a system parameter needs to be adjusted but can't figure it out.
I'm running Red Hat 4.1.2-46, 2.6.18-028stab089.1
Thanks... (4 Replies)
Discussion started by: azpetef
4 Replies
8. UNIX for Dummies Questions & Answers
Hi,
There are 2000 jobs in the list and i need to draw their status. I put all the jobs in the list and trying to read one by one from the list and to find out the status.
Help me out in correcting the script.
#!/bin/csh
for a in $(cat Jobs_List.txt);
do
source <<path>>
autorep -j $a... (1 Reply)
Discussion started by: venkatesht
1 Replies
9. UNIX for Advanced & Expert Users
I have submitted an autosys job and force start it. Autosys hit the job 4 times to restart but it did not start and finally I terminate the job. Any idea why the job did not start. Below is the code I executed.
1214 missun0ap /export/home/bzn97r/develop/dswi/jil$ sendevent -E FORCE_STARTJOB... (0 Replies)
Discussion started by: jnrohit2k
0 Replies
10. Shell Programming and Scripting
Unix box: solaris 5.8
Server: IP
Need to to set trap for cron job failures by writing a shell script (5 Replies)
Discussion started by: ChandruBala73
5 Replies
LEARN ABOUT OPENSOLARIS
plock
plock(3C) Standard C Library Functions plock(3C)
NAME
plock - lock or unlock into memory process, text, or data
SYNOPSIS
#include <sys/lock.h>
int plock(int op);
DESCRIPTION
The plock() function allows the calling process to lock or unlock into memory its text segment (text lock), its data segment (data lock),
or both its text and data segments (process lock). Locked segments are immune to all routine swapping. The effective user ID of the calling
process must be super-user to use this call.
The plock() function performs the function specified by op:
PROCLOCK Lock text and data segments into memory (process lock).
TXTLOCK Lock text segment into memory (text lock).
DATLOCK Lock data segment into memory (data lock).
UNLOCK Remove locks.
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.
ERRORS
The plock() function fails and does not perform the requested operation if:
EAGAIN Not enough memory.
EINVAL The op argument is equal to PROCLOCK and a process lock, a text lock, or a data lock already exists on the calling process; the
op argument is equal to TXTLOCK and a text lock or a process lock already exists on the calling process; the op argument is equal
to DATLOCK and a data lock or a process lock already exists on the calling process; or the op argument is equal to UNLOCK and no
lock exists on the calling process.
EPERM The {PRIV_PROC_LOCK_MEMORY} privilege is not asserted in the effective set of the calling process.
USAGE
The mlock(3C) and mlockall(3C) functions are the preferred interfaces for process locking.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
exec(2), exit(2), fork(2), memcntl(2), mlock(3C), mlockall(3C), attributes(5)
SunOS 5.11 22 Mar 2004 plock(3C)