signal interview questions
Top signal frequently asked interview questions
I know that inside a terminal, Ctrl+C keyboard shortcut will send a SIGINT signal to the current foreground process. Is there a way to setup a keyboard shortcut for sending SIGTERM or even SIGKILL to the current process? I think it could save me some time.
I'm running Ubuntu 11.04
Source: (StackOverflow)
I have a Windows 7 laptop, and 2 wifi connections.
Windows 7 allows me to specify a strict preference list of networks in the "Manage Wireless Networks" under the Network and Sharing Center. However, of these 2, I'd always like to just connect to the strongest of the two networks, which varies depending on exactly where I am.
Is there a way I can configure Windows to do this? Using Windows or third-party software. I tried unchecking "Connect to a more preferred network if available" for both networks, but it still seems to default to the higher one on the list.
Source: (StackOverflow)
I'm new with linux. I've searched about how to safely log out other user and found few solution but I want to know how they work internally. I have few questions:
1. pkill -KILL -u {username}
Does it just send SIGKILL to every child of init --user? and does it ensure that every child process is safely killed?
2. Can It be done using sending only signals?
P.S
I have program which creates init --user for other user, I'm killing using SIGTERM but sometimes compiz crashes. Thats why I'm interesting how should it work properly.
Source: (StackOverflow)
I suddenly got a 'Check Signal Cable' after turning on my monitor. It was working this morning I checked the vga cable. Inserted it to another monitor and it worked I have a
Samsung S19A300B
Radeon HD 4670
asus mobo
and a pentium dual core e5300
i tried using other cables but it just displays "check signal cable" and 3 boxes with red green blue colors and a "Digital" just below it :|
Source: (StackOverflow)
Let's say I have a long (> 30m) LAN cable, that connect two (very close) devices.
Could some of the unused wire, disposed as a huge coil, cause any issue ? I'm thinking about the special wire layout that would create a magnetic field (like in an inductance) and cause problems for transmitting the signal.

Source: (StackOverflow)
We're developing software for bluetooth devices. We'd like to test the case when the device gets out of range, but don't want to carry the device to the other end of the office for each test.
What is the easiest solution to block/shield bluetooth signals? Are there any containers that can be purchased off the shelf which bluetooth will not penetrate?
Source: (StackOverflow)
When I press Ctrl-C in any pseudoterminal (xterm, gnome-terminal, rxvt, text console and SSH) in Karmic Koala, the string ^C
gets echoed to the terminal in Ubuntu Karmic Koala. This hasn't happened in Ubuntu Jaunty Jackalope. I'd like to get rid of the extra ^C
. Example:
$ cat
foo
foo
^C
$ _
I got the above by typing C, A, T, Enter, F, O, O, Enter, Ctrl-C. I want to get rid of the ^C
, and get this for the same keypresses:
$ cat
foo
foo
$ _
I tried setting stty -echoctl
, which solved the problem for rxvt and xterm outside SSH, but it created a single-character HT
when SSHing from an Ubuntu Hardy system, and it created a box with Unicode 0003
in it instead of the ^C
in gnome-terminal. I want to see absolutely nothing when I press Ctrl-C. I'm using
Linux linux 2.6.31-20-generic-pae #57-Ubuntu SMP Mon Feb 8 10:23:59 UTC 2010 i686 GNU/Linux
I have these terminal settings in all systems and all terminal emulators:
ioctl(0, TCGETS, {c_iflags=0x2502, c_oflags=0x5, c_cflags=0xbf, c_lflags=0x8a3b, c_line=0, c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x00"})
Source: (StackOverflow)
Very confused. I'm using inSSiDer, WiFi Overview 360 and Wifi Analyzer apps to try to determine the best wifi channel to use. Assuming all channels are in use and there are about 20 different users in close proximity...
Q1: Signal Strength
If all channels are in equal use, do you select a channel where others that use it have the lowest signal strength? I'm guessing that a higher signal strength means that it's from a router from your closest neighbour and you want to avoid that. Is that the case? Does lower signal strength mean the person using it is further away and therefore less likely to interfere with your signal? If 2 people are on channel 1 and have high signal strength and 2 people are on channel 11 and have low signal strength, do you choose channel 11? Assume 6 cannot be used.
Q2: Signal Strength Weighted Against Number of People
What is the impact of signal strength compared to number of people using channel? If 1 person is on channel 1 with very high signal strength and 2 people are on channel 11 with low signal strength, do you choose channel 11 over 1? Assume 6 cannot be used?
Q3: Channel Overlap
If, for example, I had 11 routers sitting on top of each other, each set to a different channel, I'm guessing channel 1 and 11 would be the least interferred. Is that right? People go on about the fact that only channel 1, 6 or 11 should be used (in US) as they don't overlap but surely that statement is wrong. Yes, if only 3 people were using Wifi, the best channels to use would be 1, 6 and 11 as they don't overlap but in practice, there are about 20 people using the channels in the same area. What do you do in that scenerio. Do you go for the shoulder channels if all channels are being used equally with equal strength?
Q4: Auto Channel Select
Do routers set to auto channel select only choose between 1, 6 and 11? How do they make the choice? Do they select by choosing channel with lowest other routers and do they factor in signal strengths. My router auto chooses channel 1 but my closest neighbour is on that channel. Is that correct.
Q5: Baby Monitors and Wireless Phones
What channels do 2.4 GHz baby monitors and wireless phones use? No useful info on the internet for them. Do inSSiDer, etc. pick them up?
Q6: I have access to channel 13. All other things being equal, am I better to use this over channel 11 as it is further away from the other channels?
Those questions have puzzled me for a number of years and Google is not helping!! Would really be grateful if someone could give sensible answers to one or all of them. Thanks, Mike.
Source: (StackOverflow)
I stumbled upon something very surprising which I cannot understand on a Red Hat EL 5.6 box : the user hri (which is in the group dba) is able to kill processes owned by user oracle (which is also in group dba).
Is anybody able to explain what could allow an unprivileged user to kill another user's processes? Even if Oracle process was written to handle signals, I though processes could not trap SIGKILL(9).
Below is a session log which shows that.
OracleServer:/home/hri> export ORACLE_SID=HRIXXXDW
OracleServer:/home/hri> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Dec 12 17:30:56 2013
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 13: Permission denied
Additional information: 9925
SQL> Disconnected
OracleServer:/home/hri> ps auxf | grep HRIXXX
hri 28295 0.0 0.0 61164 676 pts/9 S+ 17:31 0:00 \_ grep HRIXXX
oracle 28263 0.0 0.0 759668 17384 ? Ss 17:31 0:00 ora_pmon_HRIXXXDW
oracle 28265 0.0 0.0 758488 16576 ? Ss 17:31 0:00 ora_psp0_HRIXXXDW
oracle 28267 0.1 0.0 758488 23948 ? Ss 17:31 0:00 ora_mman_HRIXXXDW
oracle 28269 0.0 0.0 760968 19308 ? Ss 17:31 0:00 ora_dbw0_HRIXXXDW
oracle 28271 0.0 0.0 760960 19284 ? Ss 17:31 0:00 ora_dbw1_HRIXXXDW
oracle 28273 0.0 0.0 758488 16656 ? Ss 17:31 0:00 ora_lgwr_HRIXXXDW
oracle 28275 0.0 0.0 758492 19092 ? Ss 17:31 0:00 ora_ckpt_HRIXXXDW
oracle 28277 0.0 0.0 758488 16596 ? Ss 17:31 0:00 ora_smon_HRIXXXDW
oracle 28279 0.0 0.0 758488 16588 ? Ss 17:31 0:00 ora_reco_HRIXXXDW
oracle 28281 0.0 0.0 758488 16772 ? Ss 17:31 0:00 ora_mmon_HRIXXXDW
oracle 28283 0.0 0.0 758488 16612 ? Ss 17:31 0:00 ora_mmnl_HRIXXXDW
OracleServer:/home/hri> /bin/kill -9 28263
OracleServer:/home/hri> ps auxf | grep HRIXXX
hri 28309 0.0 0.0 61164 676 pts/9 S+ 17:31 0:00 \_ grep HRIXXX
oracle 28265 0.0 0.0 758488 16584 ? Ss 17:31 0:00 ora_psp0_HRIXXXDW
oracle 28267 0.0 0.0 758488 23948 ? Ss 17:31 0:00 ora_mman_HRIXXXDW
oracle 28269 0.0 0.0 760968 19316 ? Ss 17:31 0:00 ora_dbw0_HRIXXXDW
oracle 28271 0.0 0.0 760960 19284 ? Ss 17:31 0:00 ora_dbw1_HRIXXXDW
oracle 28273 0.0 0.0 758488 16656 ? Ss 17:31 0:00 ora_lgwr_HRIXXXDW
oracle 28275 0.0 0.0 758492 19096 ? Ss 17:31 0:00 ora_ckpt_HRIXXXDW
oracle 28277 0.0 0.0 758488 16596 ? Ss 17:31 0:00 ora_smon_HRIXXXDW
oracle 28279 0.0 0.0 758488 16588 ? Ss 17:31 0:00 ora_reco_HRIXXXDW
oracle 28281 0.0 0.0 758488 16772 ? Ss 17:31 0:00 ora_mmon_HRIXXXDW
oracle 28283 0.0 0.0 758488 16620 ? Ss 17:31 0:00 ora_mmnl_HRIXXXDW
OracleServer:/home/hri> ps auxf | grep HRIXXX
hri 28435 0.0 0.0 61164 676 pts/9 S+ 17:32 0:00 \_ grep HRIXXX
Below are a kill -15
then a kill -9
, with strace :
OracleServer:/home/hri> ps auxf | grep HRIXXX
hri 26278 0.0 0.0 61164 676 pts/9 S+ 17:16 0:00 \_ grep HRIXXX
oracle 12412 0.0 0.0 759660 19724 ? Ss 16:10 0:00 ora_pmon_HRIXXXDW
oracle 12414 0.0 0.0 758484 16608 ? Ss 16:10 0:00 ora_psp0_HRIXXXDW
oracle 12416 0.0 0.0 758484 23992 ? Ss 16:10 0:00 ora_mman_HRIXXXDW
oracle 12418 0.0 0.0 760980 19352 ? Ss 16:10 0:00 ora_dbw0_HRIXXXDW
oracle 12420 0.0 0.0 760968 19316 ? Ss 16:10 0:00 ora_dbw1_HRIXXXDW
oracle 12422 0.0 0.0 758484 16700 ? Ss 16:10 0:00 ora_lgwr_HRIXXXDW
oracle 12424 0.0 0.0 758504 19152 ? Ss 16:10 0:00 ora_ckpt_HRIXXXDW
oracle 12426 0.0 0.0 758484 16708 ? Ss 16:10 0:00 ora_smon_HRIXXXDW
oracle 12428 0.0 0.0 758484 16616 ? Ss 16:10 0:00 ora_reco_HRIXXXDW
oracle 12430 0.0 0.0 758484 16812 ? Ss 16:10 0:00 ora_mmon_HRIXXXDW
oracle 12432 0.0 0.0 758484 16644 ? Ss 16:10 0:00 ora_mmnl_HRIXXXDW
OracleServer:/home/hri> strace kill 12414
execve("/bin/kill", ["kill", "12414"], [/* 32 vars */]) = 0
brk(0) = 0xe36e000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b25c7756000
uname({sys="Linux", node="
OracleServer", ...}) = 0
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=101954, ...}) = 0
mmap(NULL, 101954, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2b25c7757000
close(3) = 0
open("/lib64/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\332\301\302;\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1722304, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b25c7770000
mmap(0x3bc2c00000, 3502424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3bc2c00000
mprotect(0x3bc2d4e000, 2097152, PROT_NONE) = 0
mmap(0x3bc2f4e000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14e000) = 0x3bc2f4e000
mmap(0x3bc2f53000, 16728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3bc2f53000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b25c7771000
arch_prctl(ARCH_SET_FS, 0x2b25c7771260) = 0
mprotect(0x3bc2f4e000, 16384, PROT_READ) = 0
mprotect(0x3bc2a1b000, 4096, PROT_READ) = 0
munmap(0x2b25c7757000, 101954) = 0
brk(0) = 0xe36e000
brk(0xe38f000) = 0xe38f000
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=56450560, ...}) = 0
mmap(NULL, 56450560, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2b25c7772000
close(3) = 0
kill(12414, SIGTERM) = 0
exit_group(0) = ?
OracleServer:/home/hri> ps auxf | grep HRIXXX
hri 26328 0.0 0.0 61164 676 pts/9 S+ 17:16 0:00 \_ grep HRIXXX
oracle 12412 0.0 0.0 759660 19724 ? Ss 16:10 0:00 ora_pmon_HRIXXXDW
oracle 12414 0.0 0.0 758484 16608 ? Ss 16:10 0:00 ora_psp0_HRIXXXDW
oracle 12416 0.0 0.0 758484 23992 ? Ss 16:10 0:00 ora_mman_HRIXXXDW
oracle 12418 0.0 0.0 760980 19352 ? Ss 16:10 0:00 ora_dbw0_HRIXXXDW
oracle 12420 0.0 0.0 760968 19316 ? Ss 16:10 0:00 ora_dbw1_HRIXXXDW
oracle 12422 0.0 0.0 758484 16700 ? Ss 16:10 0:00 ora_lgwr_HRIXXXDW
oracle 12424 0.0 0.0 758504 19152 ? Ss 16:10 0:00 ora_ckpt_HRIXXXDW
oracle 12426 0.0 0.0 758484 16708 ? Ss 16:10 0:00 ora_smon_HRIXXXDW
oracle 12428 0.0 0.0 758484 16616 ? Ss 16:10 0:00 ora_reco_HRIXXXDW
oracle 12430 0.0 0.0 758484 16812 ? Ss 16:10 0:00 ora_mmon_HRIXXXDW
oracle 12432 0.0 0.0 758484 16644 ? Ss 16:10 0:00 ora_mmnl_HRIXXXDW
OracleServer:/home/hri> strace kill -9 12414
execve("/bin/kill", ["kill", "-9", "12414"], [/* 32 vars */]) = 0
brk(0) = 0x1b155000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac77c2e4000
uname({sys="Linux", node="
OracleServer", ...}) = 0
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=101954, ...}) = 0
mmap(NULL, 101954, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2ac77c2e5000
close(3) = 0
open("/lib64/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\332\301\302;\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1722304, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac77c2fe000
mmap(0x3bc2c00000, 3502424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3bc2c00000
mprotect(0x3bc2d4e000, 2097152, PROT_NONE) = 0
mmap(0x3bc2f4e000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14e000) = 0x3bc2f4e000
mmap(0x3bc2f53000, 16728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3bc2f53000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac77c2ff000
arch_prctl(ARCH_SET_FS, 0x2ac77c2ff260) = 0
mprotect(0x3bc2f4e000, 16384, PROT_READ) = 0
mprotect(0x3bc2a1b000, 4096, PROT_READ) = 0
munmap(0x2ac77c2e5000, 101954) = 0
brk(0) = 0x1b155000
brk(0x1b176000) = 0x1b176000
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=56450560, ...}) = 0
mmap(NULL, 56450560, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2ac77c300000
close(3) = 0
kill(12414, SIGKILL) = 0
exit_group(0) = ?
OracleServer:/home/hri> ps auxf | grep HRIXXX
hri 26380 0.0 0.0 61164 676 pts/9 S+ 17:17 0:00 \_ grep HRIXXX
Now some information on the users and the OS:
OracleServer:/home/hri> uname -a
Linux OracleServer 2.6.18-186.el5 #1 SMP Wed Jan 27 18:11:22 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
OracleServer:/home/hri> cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.6 (Tikanga)
OracleServer:/home/hri> id
uid=20314(hri) gid=20175(hri) groups=20001(dba),20175(hri)
OracleServer:/home/hri> id oracle
uid=20001(oracle) gid=20001(dba) groups=20001(dba),20000(xxxxx),20768(xxxxx),20329(xxxxx),20767(xxxxx),20930(xxxxx),20271(xxxxx),20316(xxxxx)
OracleServer:/home/hri> alias kill
bash: alias: kill: not found
OracleServer:/home/hri> type kill
kill is a shell builtin
OracleServer:/home/hri> which kill
/bin/kill
OracleServer:/home/hri> l /bin/kill
-rwxr-xr-x 1 root root 14864 Sep 22 2010 /bin/kill
OracleServer:/home/hri> file /bin/kill
/bin/kill: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
Edit, thanks to jjlin comment:
It is hri user who started the $ORACLE_SID (this is what is shown on the first session log posted).
Permissions on oracle
binary shown a suid and sgid set.
OracleServer:/home/hri> l /oracle/product/10.2.0.5/bin/oracle
-rwsr-s--x 1 oracle dba 116208733 Jul 1 09:29 /oracle/product/10.2.0.5/bin/oracle
And indeed, the /proc/*/status
's Uid
line shows that Real UID is 20314
(which is the user id of hri) while Effective UID is 20001
(which is oracle).
OracleServer:/home/hri> ps auxf | grep HRIXXX | grep 9609
oracle 9609 0.0 0.0 759668 19692 ? Ss 08:41 0:00 ora_pmon_HRIXXXDW
OracleServer:/home/hri> grep [UG]id: /proc/9609/status
Uid: 20314 20001 20001 20001
Gid: 20175 20001 20001 20001
So it must be that: Oracle does run its System ID (SID) sub-processes as Real UID of database owner, while the Effective UID is Oracle's.
Thank you!
References:
Source: (StackOverflow)
I have the following processes.
ParentProcess
-- ChildProcess
-- ChildProcess
-- ChildProcess
How can I kill the parent process only? I want the children processes not to be killed. If I try to kill the parent process, the children will get SIGHUP and will get killed.
Source: (StackOverflow)
I'm using FC 14, but this is probably a fairly generic Linux question.
I want to be able to bind a key in the Linux terminal driver that will cause a signal other than SIGINT
or SIGQUIT
to be raised for the running application. I don't want to co-opt either of those. If it rings a bell for you, think along the lines of the old CTRL/T
capability, only with the signal being caught and handled by the app rather than the OS.
Since this is for status reporting for long-running activities, SIGUSR1
seems appropriate. However, if specifically raising that from the terminal keyboard isn't an option, I'll take what I can get. I don't want to attempt the impossible and catch SIGKILL
B-) but I would like to be able to raise signals other than SIGQUIT
and SIGINT
from the terminal keyboard.
Scenario:
- Set up the terminal to do the signal-raising thing
- Run application from shell in terminal window
- Wait until it gets into the complex long-running section
- Press
CTRL/whatzit
to raise the signal
- Application catches the signal, does some sort of status report, and resumes
I could do this with no problems on VMS/OpenVMS, and it kinda frosts my pumpkins to think it's more difficult on Linux.
Source: (StackOverflow)
This is a very strange question--I'd go so far as to say it's a stupid question.
I'm being told that it is possible to, to describe it briefly, use a cable to connect an access point and a receiver directly to one another. This means that I would unscrew the access point's antenna, and attach one end of a cable to the port. Then, on the wireless receiver, I would also unscrew the antenna and plug in the other side of the cable. I'm being told the connection would work after this, just as a normal Wifi connection would.
Bonus mini-question: if this works, would it still work if a splitter were attached to the access point and multiple receivers plugged in to the network?
What would happen if I do this? Based on my surprisingly deficient knowledge of radio transmission, I don't think it would work. I would like some help knowing why it won't (or will) though, if possible.
This is a somewhat hypothetical question--I realize that Ethernet does this exact job very handily, and I could just throw in a switch instead of the splitter. I simply feel that I should understand this scenario. Thanks for any help you can offer.
Source: (StackOverflow)
A friend of mine lives in an appartment building whose structure is such that the Wi-Fi signal is very weak. Even a USB key won't work.
I was thinking of buying an entry-level Wi-Fi router and reconfigure it as a bridge to act as repeater. Would that increase the chance of getting a good signal, or I shouldn't bother? If experience shows that it does improve things significantly, is their another router I should look at besides the Linux-based Linksys models?
Source: (StackOverflow)
As a way to improve reception to the occasional weak public wifi hotspot, I'm thinking of switching from the 802.b/g/n wifi connector embedded in my laptop to a USB connector with a big antenna like the TrendNet TEW-645UB or the Belkin N Wireless USB Adapter.
Before I go ahead, I'd like some feedback from users who have tried this type of external wifi connector, to check that it does improve wifi connections enough to make this purchase worthwhile.
Thank you.
Source: (StackOverflow)
What is Difference between shutdown (power off) and restart (reboot) ?
What type of signals passing at time of reboot and poweroff, to where ?
What is difference between these two signals ?
At the time of reboot,
Please correct it, if you find and mistakes in my questions
Source: (StackOverflow)