i write one program,which can dynamiclly be configure by user,using signal SIGHUP.if i start the program in console,it can works well.i.e,i send HUP signal to the process,it can be catched and load the configure file.but,if the program is started from init shell script,in this way,the ppid of the program is 1,the process can not catch the HUP signal but other signal ,such as USR1,can be catched.i don't know if i express clearly.i am not family with shell script.i don't know if it dues to starting from shell script
I have a Socket library, written in C++, in which the method used to send data never has the opportunity to handle an errno of SIGPIPE. Thus I thought perhaps I should setup a signal handler to receive the signal, but this too is not being called.Is there something that I am missing or doing that is completely wrong? Below is the relevant code. Note that a SIGPIPE signal is generated when the Server is unable to send data to the Client (e.g. the client has terminated).Server code:
But unable to catch the SIGTERM signal if I do shutdown, as man pages says shutdown genrates the SIGTERM and SIGKILL signals, but we cant handle the SIGKILL signal. My code is working fine if I genrate the SIGTERM signal by Kill command, and also for SIGINT signgal genrated from the CTRL+c key.
Here is my code:
/* Example of using sigaction() to setup a signal handler with 3 arguments * including siginfo_t. */ #include <stdio.h> #include <unistd.h> #include <signal.h> #include <string.h>
Description of what the code does or what i intended to do:
1. Created a child process from parent process using 'fork()'
2. Sent a signal 'SIGALRM' from child process to parent process using 'sigqueue' function.
(The Third parameter of 'siqueue' function contains the message (message msg) which the child process wants to send to the parent process.'msg' is a stucture instance containing a) pid of child and b) string) 5. Print the 'msg' sent by child process inside the signal handler function 'sig_action_function' of the parent process I am getting some junk value when this line is executed
Code:
printf("%d ",msg->cpid);
I expected to get the pid of child process, which the child process sent to parent process through the signal.
I tried googling but didn't get any answer for this.I have a process called "abc" and it is running with PID "123".I have a putty session opened with PID "999".I am giving kill -TERM 123 from putty session.My process "abc" before dying it should catch the PID of the terminal which provided TERM signal to it.Is there any way to find this out
I just installed Ubuntu on a Cr-48 netbook, which has an odd custom bios which can't boot regular bootloaders/kernelsI'm therefore using the existing kernel on the machine rather than the Ubuntu one, with no initrd/initramfs, just booting directly to the Ubuntu root filesystem.t's just a minimal text mode install right now, from the alternate installerAt boot time, plymouth crashes. It doesn't seem to actually affect the system, everything still boots just fine, but it doesn't seem like it should be doing that I get:
Code: mountall: Disconnected from Plymouth init: plymouth main process (70) killed by SEGV signal
Somehow zypper is running at 100% cpu and won't die with command line kill, the system monitor kill, terminate or anything. I set it's priority to the lowest it will go, tried to stop it then kill it, nothing works as it simply is not responding to anything and it has been running now for 47 hours.
Is there a way to simply dump a process out of memory without requiring it to respond to a signal? because signals are doing nothing.
I upgraded from Ubuntu 10.0.4 to 11.0.4 on a Dell Optiplex. Now, when I boot, I am given the option to boot into different kernels. I select "ubuntu, with Linux 2.6.38-8-generic", which results in a black screen that reads
Code:
init: plymouth main process (58) killed by SEGV signal and that's where it hangs. Pressing ENTER or hitting Esc does nothing. What steps can I take to recover my machine and all the files I used to have on it?
I was transferring data from one computer to my laptop and crash error came up on my laptop...
Error 1:
Nautilus-2.32.0-1.fc14 Reason: Process/usr/bin/nautilus was killed by signal 11 (SIGSEGV)
Error 2:
Openoffice.Org-Brand Crash
Reason: Process/usr/lib/openoffice.org3/program/soffice.bin was killed by signal (SIGABRT)
What could be the problem? Is it serious issue? I have been having security issues with Windows and are those issues begun once again? I have been under targeted attack since 2005.
I have a doubt about signals in C programming. I have done this little program to explain it. It creates a child process with fork and, when the child ends, receives the SIGCHLD signal and wait for its termination.Ok, quite easy, BUT when I execute this code the SIGCHLD signal is received twice, first as an error (returns -1) and the second one to finish the child process.I don't understand the meaning of the first received signal. Why is it generated? Is the code wrong? (if you add the SIGINT and press Ctrl+C during the execution it also receives two signals instead of one)
I would like to make a shell script that will do the following :- have a web-page using curl- download a picture from the web-page- have a line in the source code of the web page - catch a string (a link patch) from the line- go to another page of the website from the result of the previous step- repeat all this until there is no match for step 3I know how to :- have the web-page source code using curl (simple, we just have to make "curl- download the picture (as simple as the first step)- have a line in the source code (grep is made for that, isn't it ?)- go to another website from the result of the previous step (it's the same as the first step)But I really don't know how I can do the fourth step of my script.
In facts, I don't know regular expressions and even the shell command that can help me to do this.To be more clear, I would like to store in a variable the string represented by the star (*) in this : <a href="*">Next ></a>
right now i am writing bash script for simple everyday todo tasks.script consisit of two files, fisrt is just script (which can delete/append /clear) and second one is todolist.txt which stores my notes.I am litlebit confused about sed!!for example, If my todolist.txt have these lines:
- Writing my Homework - take my girlfriend to launch - Take a break
How can sed take my input $@ and delete all line with name "Homework"..i trayed with many sed combination like:
Code: sed s/$@//g sed 'd/$@/' and many more combination with ""/'' or bracket but nothing helped
How can I catch/supress errors from psql? I've got a simple program that will query psql, if a table is there it returns a 1 else returns a 0. The problem is I get the error message as well. How can I trap the error and just get the 1 or 0 to return?
I start playing with Slackware and I am amazed about its endless possibilities. There is a security advisory for Firefox and 4.0.1 must be installed. Do I need to compile my own FF 4.0.1 build? Or, instead of inventing the wheel, could Slackware's Firefox 4.0.1 package be pulled from somewhere? if my question sounds naive, just trying to get to the point and catch up with security issues.
I have 2 PCs, one of them is updated with latest updates. For sure the 2 PCs have the same OS Fedora 14. How to install or catch those updates in order for me to install them offline on the other PC ?
Whether it is vi or gvim, you can view the current non-default settings by writing ":set" and pressing <ENTER>. However, in FC15, vim clears the settings screen really quickly, not allowing me enough time to catch it. Normally it should pause at the settings screen, and clear it only when I press any key. If others see the same problem, I will file a bug.
I have a flaky internet connection. So it's important for me to be able to resume partially downloaded files. I would like the YAST software manager to resume downloads of packages where I left off in case of any error. Is this possible?
Is there a way to catch or stop a Linux shut down after a reboot, halt or shutdown command has been entered?sudo shutdown -r +10 I should now have 10 minutes before the computer shuts down. If I change my mind and decide that I still want to continue running, how could I stop the shut down?
I can't seem to find a multimedia player that works well for me. With VLC, the screen with freeze up and then update itself later to the correct time but it changes to lots of strange colors. With Mplayer, the video will freeze and then catch up later, like VLC does. With Totem, I can't seem to get the subtitles to work correctly. It replaces the subtitles with a font of it's own. I always used Media Player Classic on Windows and it worked really well. When I say "freeze up and catch up later" I mean that the video and subtitles will freeze, but the sound will keep going. The video and subtitles correct themselves a few seconds later.
1. Is there a way to make it so VLC doesn't freeze up and catch up later with strange colors?
2. A way to make VLC and Mplayer not freeze and catch up later?
3. Get Totem to display the correct subtitle font?
We have a number of servers at work, some production and some non-production. We run some java applications on these servers. At present these java applications send emails via an SMTP connection to our live email servers.
In production all is well, the java apps send emails to customers. However, in the non-production environments all emails must not be sent out. Instead they must end up in some kind of generic inbox.
We don't want to mess with the production setup at all and it isn't an option to lose the non-prod emails altogether. So on non-prod we can reference another SMTP server and send all emails there. So far I've set up a postfix, dovecot, squirrelmail email server which appears to work.
how do I config my new email server so that any emails sent from our non-prod server to fred@hotmail.com, bill@yahoo.com, jenny@gmail.com etc all end up in one inbox?
I just decided to go with Compiz rather than Kwin for my window manager. I have everything working beautifully aside from one little problem... The plasma dock won't pick up clicks any more. The mouse focuses on whatever is underneath the dock, rather than the dock itself. I'm sure there is a setting I can alter to override this behavior, I just can't figure it out to save my life.
Upon further investigation I found that it only behaves this way if I set the dock to auto-hide.
I'm sure this has been covered before but how does one go about setting up a dial-up Internet connection without wvdial or gnome ppp?
My brother lives in a remote area with only dial-up Internet service. I got him set up with an external serial modem plus a disc with Ubuntu 9.04 and WUBI. Apparently wvdial is not included in the basic install. I will be visiting him in a few days and I would like get him going with his dial up. He currently has Windows XP and WUBI installed. I tried sending him a disc with wvdial but it didn't include the dependencies. Is there any way I can download a package on a disc?
How do you catch user input while the script is running? Or, how would you make two scripts run at the same time, but use input from one script to the other? The program I'm trying to make, echos text on the screen continuously, but while thats happening, I want the user to be able to input something, so the program can detect the input and display something else. So I thought maybe I could make two scripts run to do each task.
I have been running Ubuntu with no problems for a while now. Earlier today, I began to download some updates. When I came back to the computer, there was a prompt to restart, but also an error message. I didn't catch the error message until I had clicked the restart button. Now, when I try to access Ubuntu from the dual-boot menu (I run Vista as well), I keep getting the following error message.
[3.190034] Kernel panic - not syncing: VFS: Unable to mount root fs on unkown-block (8,2).I tried safe mode, and I got the same error message. Vista runs normally.
I have the following working script. It checks the directory for txt files, if files are there, it copies to another directory or gives error. I would like to exclude "file not found" errors and send them to /dev/null. All other errors should go to the email address as usual.
I've some file with .sh extensions that runs some softwares.Now,how do I stop running that filesI know we run the command ./start_tomcat.sh to start the apache.Is there any command to stop that file/process or is it just kill the process to stop the process