Programming :: Make System Call From An Automatically Started Daemon?
Apr 2, 2011
i've written small tool in C which makes measurements on my router (OpenWrt White Russian).
It is working as a deamon. If the tool is started manually, everything works fine. If it is started per script on startup, the following system call doesn't work :
rc = system (command); the returned rc in this case is 256.
first i thought it is a problems with the user rights for the tool, so i have added +s to it. but that didn't help. as i said, when the daemon is started by hand, the system call works fine.
I am a newbie in linux n programming, I need to use ubuntu for my research at school about building an IMS server use openims.
The problem is I need an additional script in C/C++ for my openims server to make an extension call. I hope one number can represent 3 client as receiver/operator. So, when I call the number, the server can forward the call to those three receiver by hunt. 1st call will be forward to the 1st receiver. 2nd call will be forward to the 2nd receiver. 3rd call will be forward to the 3rd receiver. then, 4th call will be forward back to the 1st receiver, etc.
I have a process that forks, where the childs puts some data of random size and exits while the parent should get the data and does some manipulation.. here I have used a pipe for child to write the data and parent to read the data.. Child simply dumps the data, and the data is of any size even child and parent doesnt know. I have used select in the parent to see whether there is any data coming on the reading end of the pipe.. if there is a data.. I copy into a buffer.. Im reading the data continusly when the child exits after closing the writing end of pipe. Parent gets blocked on the read part But my question is how parent know the other of pipe is closed when using the select call. In otherwords.. while using select in readfds, how would i know the other end has closed the pipe..
I am trying to figure out how i would go about finding out where system call is made and error checking is not done. I have code below, if somebody can point me in the right direction where system call is made but error checking is not done.Quote:
how to create a new system call Linux? what is the process of creating ?my project is to create a system call for displaying owner of a file..where exactly we have to write the system call code? and where are the places need to change ?
I want to test my system call that be goint to add to kernel, But when i finish compiling kernel, i found my system call code not work. the code i want to return the system time "struct timespec":
/*----------Start of mycall.c----------*/ #include <linux/linkage.h> #include <linux/time.h> #include <linux/kernel.h>
[code]....
so i want a method to test the new system call before compiling kernel.
Anyone know the reason why a sleep( ) on a Redhat Linux OS would cause the system to indefinitely hang? It's doing this every 10 or so calls in my program and I have to press the reboot button on my computer. My program is reading from a UDP port that has messages sent to it 20 times per second. When I sleep I assume the internal UDP buffer is getting more and more filled.
After I login my desktop preferences are not loaded. If I try to change them (Control cneter-> apparence) I get a message that says: Unable to start the settings manager 'gnome-settings-daemon'.Without the GNOME settings manager running, some preferences may not take effect. This could indicate a problem with DBus, or a non-GNOME (e.g. KDE) settings manager may already be active and conflicting with the GNOME settings manager.The first lines of .xsession-errors show:
/etc/X11/xim: Checking whether an input method should be started. HOSTNAME: Undefined variable. XDG_DATA_DIRS: Undefined variable.
I installed MySQL on my Ubuntu 10.04 desktop. As I need it only once a month I removed it from all runlevels but mysql is still running after boot up. "lsof" shows that it is running and listening for connections.
I am making a library, but I am facing a strange problem while sending data over network using ethernet.
I am sending 39 bytes of the data from one server to slave application but some time slave receives 39 bytes and some time it receives 29 bytes. And when ever slave receives 29 bytes all the memories to which my pointers are pointing get changed. This problem is only when I am sending data from the server to slave, while sending data from slave to server I am facing no such issue.
I have a script for dd command and i am using it in an application using system() call. Now i want to have the output of the script file (i.e output of dd command) in the application file itself.
I'm trying desperately to get ipvs load balancing up and running using the RedHat Piranha utility.I'll post my config files later in the message.In order to simplify things, I've only got one LVS director running (no backup director), and I've only got one realserver running.I can ping the realserver static ip from the LVS director when the pulse daemon is NOT started.About one minute after I start the pulse daemon, I can no longer ping the realserver static ip.I can ping the realserver static ip from any other box on the subnetThe LVS app requires that the LVS director be able to ping (or CONNECT) the realserver as a sanity check to make sure the realserver(s) is/are still alive.
In practice I have a script that call a java program that call a linux system command. The script if I run it, from a shell functions well,so it is not a java problem. The problem come out when i put this script in a crontab schedulation. The result in this case is that java do not execute the system command. I think it depends on crontab
we have a multi threaded program on Linux where one thread is waiting on poll() system call with event set to POLLIN, & another thread has closed the same socket fd (which is passed to poll) , but the poll() did not return, is this the expected behavior? From man page of poll we found that the poll should return POLLNVAL if the socket fd is closed, is my understanding correct or is there any bug in the poll()?In Solaris we observed that the poll system call is returning with POLLNVAL if the socket is closed.
I have the following code: Code: #include <stdio.h> #include <stdlib.h> int main() { system("ps -ef | grep myprocessname"); return 0; }
When I run this program it outputs the following list of running processes: Code: root 10279 10275 0 13:02 ? 00:00:00 myprocessname myvar1=value1 myvar2=value2 root 10341 10337 1 13:02 ? 00:00:00 myprocessname myvar1=value1 myvar2=value2
What I want to really do is instead of writing the output to screen I want to read the output and parse the various values value1, value2 etc. What is the best way to do this?
I recently bought a IOgear USB bluetooth adapter and a Sony DRBT101/BLK bluetooth headphones to use with my computer.Whenever I try to make a call using these headphones with skype, I can speak for say 10 seconds and then the headset disconnects completely from the system. I then have to reconnect the headset by switching it off and on. I do not have this problem listening to music using A2DP. It works fine with my mobile phone.When I change the profile to Telephony Duplex (HSP/HFP), it shows up as hands free, I thought it should be headset in blueman manager. My friend uses Plantronics headset with is Dell laptop with built in bluetooth and he says his comes up as headset not hands free. Could this be causing the problem?
I have a set of bash scripts that I'm running that automatically build a set of packages for me and redirect their output into logs. Basically, I have a bunch of lines that are something like this: ${CONFIGURE_DIR}/configure &> ${LOG_DIR}/log or cd ${CONFIGURE_DIR} && make &> ${LOG_DIR}/log, etc.
This is supposed to make the entire process silent. However, sometimes with some packages some output leaks to my console (either stdout or stderr). I'm thinking that maybe the configure scripts/make are executing commands within new shell instances that don't inherit my redirect, or something to that effect.
Another reason for thinking this is that in another part of my script I detect errors when running make by testing with "if [ $? -ne 0 ]", and if the redirect leaks to my console and also the leaked output indicates that the build failed ("make: Error" and so on), then my $? test fails (i.e., it thinks that $? == 0, whereas a failed make should return a non-zero value). It's as if my original script can't "see" the results from child commands executed from later scripts.
I just updated both my KDE 3.5.10 and KDE 4.5 today (OpenSuse 1.11). The problem that I have now is that the Plasma Desktop is loaded automatically after KDE 3.5 has started. So, depending on where I click or what I do, plasma and kdesktop fight for the control of my desktop.
I searched in every corners of my KDE 3.5 --and a bit in KDE 4 since somebody forced kdm4 on me-- but I haven't found who or what starts "plasma-desktop". Definitively not me! I can kill it safely but that's very irritating.
Recently I have had a run of random errors on boot up. Finally, the quit button, top right of the screen disappeared permanently. I am convinced it is because I added Evolution to the programs that start automatically when I login to Ubuntu (auto login). Evolution uses the Internet connection which hasn't been successfully established by the time it starts. In the past, this would crash Ubuntu. It seemed to be fixed by this stage, but maybe not. Is there some way of delaying the startup of a program in the automatic startup list - to give the rest of everything time to settle in - before it starts trying to use other startup resources?
I'm using gmake (v3.81) to build some c executables. As the first step in the process I run the files through a preprocessor (for embedded SQL). The preprocessor completes successfully, but the gmake reports an error and discontinues buiding the remaining dependencies...
make *** [myfile.c] Error 4
which (according to /usr/include/asm-generic/errno-base.h) means "interrupted System Call". My preprocessor doesn't raise any signals, so I'm not sure what's causing this error.
Since I've updated to 9.10 my avahi-daemon sometimes won't start at boot.I've to "restart" it manually.I reinstalled it without success.Has anyone here the same problem? Or a useful solution?
i am succesfully installed TeamSpeak 3 server and now i want to startup it automatically without screen daemon and on every startup on linux ubuntu 9.10 i am using this command for start the TS3 server:./ts3server_linux_amd64 dbplugin=ts3db_mysqlin home/user/Desktop/ts3server_linux_amd64
I have installed Oracle 11g on 5.3. Now, I am trying to START and STOP oracle automatically on system startup and shutdown. I am following this link To have this effect, I have created /etc/init.d/dbora
My problem now is that lsyncd does not automatically start if the server reboots. I need lsyncd to start automatically also using the --delay 5 option.
I've had trouble finding any info on this other that some Japanese sites (I cant read japanese) using chkconfig, although it didn't work as I think chkconfig is depreciated anyway.