Sponsored Content
Full Discussion: SIGINT issue
Top Forums UNIX for Dummies Questions & Answers SIGINT issue Post 302603200 by methyl on Wednesday 29th of February 2012 09:53:20 AM
Old 02-29-2012
@pandeesh
Please post your Operating System and version and what Shell you are using.

Please post a sample "nohup" line and make it clear whether you want to run the script in foreground or background.

Are you trying to stop somebody who types ctrl/c at the keyboard? If so, just disable the function in their profile.
Code:
stty intr ""

 

10 More Discussions You Might Find Interesting

1. Programming

Cannot catch SIGINT while serial break condition occurs

I setup termios structure with IGNBRK is not set and BRKINT is set. To allow the process to receive signals I call: fcntl(fd, F_SETOWN, getpid()); I have made a signal handler to catch all signals. I can catch SIGINT when pressing ctrl+c but when I send break signal over serial then it cannot... (13 Replies)
Discussion started by: gzz
13 Replies

2. Shell Programming and Scripting

Unix Arithmatic operation issue , datatype issue

Hi, I have a shell scripting. This will take 7 digit number in each line and add 7 digit number with next subsequent lines ( normal addition ). Eg: 0000001 0000220 0001235 0000022 0000023 ........... ......... ........ Like this i am having around 1500000 records. After adding... (23 Replies)
Discussion started by: thambi
23 Replies

3. Programming

Problem with handling SIGINT

For a program I am designing, which involves handling the keyboard input Ctrl^c (SIGINT), it is taking ages for the program to actually recognise and perform the corresponding action whenever I run it and hit Ctrl^C at the CL. I have to do at least 3 Ctrl^Cs before the program will actually... (3 Replies)
Discussion started by: JamesGoh
3 Replies

4. Programming

[C] fgets problem with SIGINT singlal!!!

Hi all, I have this method to read a string from a STDIN: void readLine(char* inputBuffer){ fgets (inputBuffer, MAX_LINE, stdin); fflush(stdin); /* remove '\n' char from string */ if(strlen(inputBuffer) != 0) inputBuffer = '\0'; } All work fine but if i... (1 Reply)
Discussion started by: hurricane86
1 Replies

5. Shell Programming and Scripting

Intercepting SIGINT in a bash script

I've written a bash script which captures video with DVgrab. Because of the nature of the tapes that I am digitizing, sometimes I want to quit capturing before the time that I set for DVgrab. When this is the case I press Ctrl-c and DVgrab exits cleanly, my problem is that there is additional... (5 Replies)
Discussion started by: Starcast
5 Replies

6. Programming

why multiple SIGINT raises when i hit C-c

hi, in my application, i have set up to capture SIGINT and execute a handler.the problem is whenever i hit C-c, multiple SIGINT are sent to the application.I have blocked the SIGINT right after catching the first one but it is unsuccessful.Here is what i do : jmp_buf main_loop; int... (1 Reply)
Discussion started by: Sedighzadeh
1 Replies

7. Shell Programming and Scripting

Strange SIGINT propagation between Parent/Child sh scripts

Good day, I am trying to add signal handling capabilities to some of my scripts. Unfortunately, I am having some difficulty with the manner in which signals are propagated between parent/child processes. Consider the following example: I have the following "parent" script: #!/usr/bin/sh... (5 Replies)
Discussion started by: danie.ludick
5 Replies

8. Shell Programming and Scripting

Sh script sends SIGINT to a process

Hello, What I want to accomplish is this: I have made a very simple script that runs 2 commands, polipo proxy and tor. The script runs successfully and the output of tor is visible to the screen. I am using the trap command in order to catch the ctrl+c button combo in order to stop polipo... (5 Replies)
Discussion started by: redsolja
5 Replies

9. Shell Programming and Scripting

Trapping SIGINT after restarting program.

Tried to add a function to my control_c interrupt here. It works but has one little bug. If the user selects to run the function instead of exiting, the program restarts itself without forking as it should. However, after that control_c no longer works again. I wanted to allow the user to run... (1 Reply)
Discussion started by: Azrael
1 Replies

10. Shell Programming and Scripting

Always pass SIGINT in ksh

The following command will run and wait for input from the user. /usr/sap/SAP/webdisp/wdispmon pf=/usr/sap/SAP/webdisp/profile What I would like to do is (in one command): - Add the above line to a ksh script - Receive the output - and send a SIGINT I have seen many posts on how to... (3 Replies)
Discussion started by: sapsid
3 Replies
OPERF(1)						      General Commands Manual							  OPERF(1)

NAME
operf - Performance profiler tool for Linux SYNOPSIS
operf [ options ] [ --system-wide | --pid <pid> | [ command [ args ] ] ] DESCRIPTION
Operf is an OProfile tool that can be used in place of opcontrol for profiling. Operf uses the Linux Performance Events Subsystem, and hence, does not require the use of the opcontrol daemon -- in fact, operf and opcontrol usage are mutually exclusive. By default, operf uses <current_dir>/oprofile_data as the session-dir and stores profiling data there. You can change this by way of the --session-dir option. The usual post-profiling analysis tools such as opreport(1) and opannotate(1) can be used to generate profile reports. The post-processing analysis tools will search for samples in <current_dir>/oprofile_data first. If that directory does not exist, the post-processing tools use the standard session-dir of /var/lib/oprofile. Statistics, such as total samples received and lost samples, are written to the operf.log file that can be found in the <session_dir>/sam- ples directory. OPTIONS
command[args] The command or application to be profiled. args are the input arguments that the command or application requires. One (and only one) of either command , --pid or --system-wide is required. --pid / -p PID This option enables operf to profile a running application. PID should be the process ID of the process you wish to profile. When finished profiling (e.g., when the profiled process ends), press Ctrl-c to stop operf. If you run operf --pid as a background job (i.e., with the &), you must stop it in a controlled manner in order for it to process the profile data it has collected. Use kill -SIGINT <operf-PID> for this purpose. --system-wide / -s This option is for performing a system-wide profile. You must have root authority to run operf in this mode. When finished profil- ing, Ctrl-c to stop operf. If you run operf --system-wide as a background job (i.e., with the &), you must stop it in a controlled manner in order for it to process the profile data it has collected. Use kill -SIGINT <operf-PID> for this purpose. It is recom- mended that when running operf with this option, the user's current working directory should be /root or a subdirectory of /root to avoid storing sample data files in locations accessible by regular users. --vmlinux / k vmlinux_path A vmlinux file that matches the running kernel that has symbol and/or debuginfo. Kernel samples will be attributed to this binary, allowing post-processing tools (like opreport) to attribute samples to the appropriate kernel symbols. --events / -e event1[,event2[,...]] This option is for passing a comma-separated list of event specifications for profiling. Each event spec is of the form: name:count[:unitmask[:kernel[:user]]] You can specify unit mask values using either a numerical value (hex values must begin with "0x") or a symbolic name (if the name=<um_name> field is shown in the ophelp output). For some named unit masks, the hex value is not unique; thus, OProfile tools enforce specifying such unit masks value by name. Event names for some IBM PowerPC systems include a _GRP<n> (group number) suffix. You can pass either the full event name or the base event name (i.e., without the suffix) to operf. If the base event name is passed, operf will automatically choose an appropri- ate group number suffix for the event; thus, OProfile post-processing tools will always show real event names that include the group number suffix. When no event specification is given, the default event for the running processor type will be used for profiling. Use ophelp to list the available events for your processor type. --callgraph / -g This option enables the callgraph to be saved during profiling. NOTE: The full callchain is recorded, so there is no depth limit. --separate-thread / -t This option categorizes samples by thread group ID (tgid) and thread ID (tid). The '--separate-thread' option is useful for seeing per-thread samples in multi-threaded applications. When used in conjunction with the '--system-wide' option, the '--separate- thread' option is also useful for seeing per-process (i.e., per-thread group) samples for the case where multiple processes are exe- cuting the same program during a profiling run. --separate-cpu / -c This option categorizes samples by cpu. --session-dir / -d path This option specifies the session path to hold the sample data. If not specified, the data is saved in the oprofile_data directory on the current path. --lazy-conversion / -l Use this option to reduce the overhead of operf during profiling. Normally, profile data received from the kernel is converted to OProfile format during profiling time. This is typically not an issue when profiling a single application. But when using the --sys- tem-wide option, this on-the-fly conversion process can cause noticeable overhead, particularly on busy multi-processor systems. The --lazy-conversion option directs operf to wait until profiling is completed to do the conversion of profile data. --append / -a By default, operf moves old profile data from <session_dir>/samples/current to <session_dir>/samples/previous. If a 'previous' pro- file already existed, it will be replaced. If the --append option is passed, old profile data is left in place and new profile data will be added to it, and the 'previous' profile (if one existed) will remain untouched. To access the 'previous' profile, simply add a session specification to the normal invocation of oprofile post-processing tools. For example: opreport session:previous --verbose / -V level A comma-separated list of debugging control values, used to increase the verbosity of the output. Valid values are: debug, record, convert, misc, sfile, arcs, or the special value, 'all'. --version / -v Show operf version. --help / -h Display brief usage message. --usage / -u Display brief usage message. EXAMPLE
$ operf make VERSION
This man page is current for oprofile-0.9.9. SEE ALSO
opreport(1), opannotate(1). oprofile 0.9.9 Tue 10 June 2014 OPERF(1)
All times are GMT -4. The time now is 06:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy