Measure thread execution (in C, unix)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Measure thread execution (in C, unix)
# 22  
Old 03-24-2011
so is there a reason why script wont run in cron but runs normally in cmd line (even with its dodgy code!)???
# 23  
Old 03-24-2011
Note: two threads on identical topic merged. Please do not post twice on the same topic - this kind of hodge-podge results from doing that.

We also have a rule against this, for that very reason. However it is too late to close the extra thread.

---------- Post updated at 09:54 ---------- Previous update was at 09:51 ----------

It appears I have really hosed things up by merging the wrong threads My apologies.
There is no way available to me to remedy the problem.
# 24  
Old 03-24-2011
Environment (exported variables) is #1. When you log in, all sorts of scripts run before your shell prompt arrives, setting your environment so the shell is useful. The cron and rsh/ssh waste no time on this, so you have to explicitly add the missing environment.

Lack of a tty is usually less of a problem, so it is #2.

Some programs get upset when the default stdin cannot be read or gets EOF immediately. Since there is no tty, there is no keyboard, there can be no input but that supplied in the scripting.
# 25  
Old 03-24-2011
Hi DGPickett

See results of diff as you suggetsed above in Post #21
Code:
alps$ diff mycronenv mytermenv
0a1
> EDITOR=vi
3a5
> LD_LIBRARY_PATH=/usr/local/lib:/usr/local/ssl/lib:/usr/local/mysql/lib:/usr/local/mrtg-2/lib:/usr/local/mrtg-2/lib:/usr/share/lib:/usr/openwin/lib:/usr/openwin/platform/sun4u/server/lib:/usr/sadm/lib/smc/lib:/usr/local/lib:/etc/lib:/etc/security/lib:/lib:/opt/SUNWits/Graphics-sw/xil/lib:/usr/sadm/smc/lib:/usr/sadm/lib:/usr/ccs/lib:/usr/openwin/platform/sun4u/server/lib:/oracle_install/product/10.2.0/lib32:/usr/sfw/lib
4a7
> MAIL=/var/mail//capopt
5a9
> OLDPWD=/home/it/capopt
7,8c11,22
< PATH=/usr/bin:
< SHELL=/usr/bin/sh
---
> ORACLE_BASE=/oracle_install
> ORACLE_HOME=/oracle_install/product/10.2.0
> ORACLE_TERM=vt100
> PATH=/usr/bin:/oracle_install/product/10.2.0/bin:/bin:/usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/usr/local/bin:/usr/sfw/bin
> PS1=alps$
> PWD=/home/it/capopt/APNRD/S30
> SHELL=/bin/sh
> SHLVL=1
> SSH_CLIENT=172.27.102.22 64452 22
> SSH_CONNECTION=172.27.102.22 64452 192.168.198.110 22
> SSH_TTY=/dev/pts/4
> TERM=xterm
9a24,26
> USER=capopt
> VISUAL=vi
> _=./condenseS30.sh


Last edited by vbe; 03-24-2011 at 03:09 PM.. Reason: code tags...
# 26  
Old 03-24-2011
Both ld_library_path and path are critical to everything, and if you want Oracle, you have to get those, too. You can 'source' your .profile or make a special env file for cron to source. If .profile works but complains in an ugly way, just redirect it away (. $HOME/.profile >/dev/null 2>&1).

Don't forget to export EACH_VAR_NAME, which can be the same line if not sh (export THIS_VAR_NAME=THIS_VAR_VALUE) ! You really want to move to ksh or bash, sh is pretty retro!
# 27  
Old 03-24-2011
im changing script from

#!/usr/bin/sh

to

#!/bin/sh

and praying hard!
# 28  
Old 03-24-2011
Sorry but you're problem has no link with first problem (measuring thread execution) and I will never have answer if this topic speaks about another problem.
Could moderator splits this message to have separate discussions please ?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Python Thread Execution Issue . . .

Greetings! I set up a basic threading specimen which does the job:#!/usr/bin/python import threading class a(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self): print("thread a finished") class b(threading.Thread): ... (0 Replies)
Discussion started by: LinQ
0 Replies

2. Solaris

How to measure IOPS?

Hi I have a system running solaris 10, and I intend to use a NetApp as its storage system. The application requires a throughput between the server and the storage 7000 disk IOPS (random IO sustained throughput with response time of 20 mili second and 16k block size). How to make sure that I... (6 Replies)
Discussion started by: fretagi
6 Replies

3. AIX

How to measure waiting time in run queue?

Hello guys, I am doing a performance analysis on one of our psystem. Most of time I am using Nmon analyser to do my trend graph. But I can't find any help with it. We are interesting in the time spend by tasks in Aix run queue. After looking the Aix documentation, I am pessimist to find any... (3 Replies)
Discussion started by: GiiGii
3 Replies

4. UNIX for Advanced & Expert Users

Implementing thread in UNIX

Hi For our load testing , we are using stubs (unix shell script) which send the response to the request coming from the application. As the unix stub is single threaded , it is responding to only one request whereas multiple requests come in parallely. I haven't worked on thread concepts... (5 Replies)
Discussion started by: jenanee
5 Replies

5. Solaris

What exactly does 'zpool iostat' measure?

hi there, i'd like to know what exactly zpool's iostat (-v) output measure, especially the writes. Is it only the writes to the ZIL or all writes (including commmits) to the disks? if anyone knows, that'd be helpful roti (1 Reply)
Discussion started by: rotunda
1 Replies

6. UNIX for Advanced & Expert Users

How to measure g++ performance?

I am working on an application with some rather interesting build performance issues. If we build on Solaris/Linux x86/AMD64 the build is rather fast, but it takes more than five times as long on our Solaris Sparc servers (single-threaded builds on the workstations, but multi-threaded on the... (5 Replies)
Discussion started by: Elric of Grans
5 Replies

7. Shell Programming and Scripting

Is there a command to measure compile speed?

Hello Ive written 2 programs in shell and I need to compare their speed (Compile) against one another. what methods could I go about doing this? Is there a feature in shell do accommodate this? (2 Replies)
Discussion started by: Darklight
2 Replies

8. Forum Support Area for Unregistered Users & Account Problems

How to post a new thread (Regarding Unix related doubts) in Unix Forums

How to post a new thread (Regarding Unix related doubts) in Unix Forums. I registered my id but I am unable to post my Questions to Forum. Thanks & Regards, indusri (1 Reply)
Discussion started by: indusri
1 Replies

9. UNIX for Dummies Questions & Answers

CPU load unit of measure?

If unix says my cpu load is 2.15 exactly what does that mean? --Jason (1 Reply)
Discussion started by: Mac J
1 Replies
Login or Register to Ask a Question