linux

Health check for applictaion

Hi, I wish to know what are the methods exist to check the Health of a process. Considering that on a system 10000 process are running and you have to make sure that in case any of these process goes down we need to make the process UP. ...

Difference between sem_init and sema_init

What is the difference between sema_init and sem_init ? Are there any specific usage scenarios and other dependencies for the respective APIs ? ...

linking/version problem with libxerces-c

I am trying to make an example of a toolkit work, but after typing make, I got the following error: g++ -o taskintro taskintro.o `PKG_CONFIG_PATH=/usr/local/lib/pkgconfig pkg-config orocos-ocl-gnulinux orocos-rtt-gnulinux --libs` /usr/bin/ld: warning: libxerces-c-3.0.so, needed by /usr/local/lib/liborocos-rtt-gnulinux.so, not found (tr...

How can I compare two zip format(.tar,.gz,.Z) files in Unix

I have two gz files. I want to compare those files without extracting. for example: first file is number.txt.gz - inside that file: 1111,589,3698, 2222,598,4589, 3333,478,2695, 4444,258,3694, second file - xxx.txt.gz: 1111,589,3698, 2222,598,4589, I want to compare any column between those files. If column1 in first file is...

How To Create Vector of Vector In R

I have input data that contain lines like this: -0.438185 -0.766791 0.695282 0.759100 0.034400 0.524807 How can I create a data structure in R that looks like this: [[1]] [1] -0.438185 -0.766791 0.695282 [[2]] [1] 0.759100 0.034400 0.524807 ...

Starting an external process fails: cannot connect to X server

Hello, as part of my eclipse plugin I try to start an external program by using process.exec. This works with some tools (I tested it with gedit, for example), but with the one I need it does not work: isimgui: cannot connect to X server. This is part of the XILINX webpack, none of the included graphic tools can be started like this. ...

Stack Walk on linux using ptrace

hello all, Following is my requirement. while process A is running. attach Process A from B with PTRACE_ATTACH. Start a Loop Stop Process A read registers Resume Process A sleep(1) end loop detach A i am facing issue with Start and Resume Process A from the loop. i tried combination of kill(pid,SIGSTOP), kill(pid,SIGCONT), PTRACE...

Prevent fork() from copying sockets

I have the following situation (pseudocode): function f: pid = fork() if pid == 0: exec to another long-running executable (no communication needed to that process) else: return "something" f is exposed over a XmlRpc++ server. When the function is called over XML-RPC, the parent process prints "done closing...

process id ist different between getpid und Top command linux

programm write current process id in file with function getpid() exemple 1100, but wenn command top run, i becomme process id 1101!!!!! why ...

php compile oci8 and stuck only at checking dynamic linker characteristics?? Why stuck?

./configure -with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib/ checking for egrep... grep -E checking for a sed that does not truncate output... /bin/sed checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling......

Creating a multi-page TIFF with Python

This has already been asked here, but I was looking for a solution that would work on Linux.. Is tiffcp the only way? ...

What is an easy way to test whether any process of a given id is presently running on Linux?

In C++, I have a resource that is tied to a pid. Sometimes the process associated with that pid exits abnormally and leaks the resource. Therefore, I'm thinking of putting the pid in the file that records the resource as being in use. Then when I go to get a resource, if I see an item as registered as being in use, I would search to s...

ERROR with winexe

I try to connect to windows from a debian using winexe, but it give me this error ERROR: Cannot open control pipe - NT_STATUS_ACCESS_DENIED Why is that?? What can I do for fix it?? Somebody helpme please!! ...

How can I delete a file upon its close in C++ on Linux?

I wish for a file to be deleted from disk only when it is closed. Up until that point, other processes should be able to see the file on disk and read its contents, but eventually after the close of the file, it should be deleted from disk and no longer visible on disk to other processes. ...

How can a program on Linux introspect its pid?

How can a program on Linux discover the process id of itself? Is there something in /proc/self that will do the trick? ...

C++ objects serialization for Linux

I'm doing a program that needs send and receive data over the network. I never dealt with object serialization. I readed about some recommendations about Boost and Google Protocol Buffers. For use in Linux which is the best? If you know some other I will appreciate your help. Thanks. ...

stat() function doesnt seem to be working in test PAM module

I'm trying to write a PAM module. The PAM module creates a directory on first log in. Very similar to the pam_mkhomedir. Here is the code. PAM_EXTERN int pam_sm_open_session (pam_handle_t *pamh, int flags, int argc, const char **argv) { int retval; const char *user; const struct passwd *pwd; struct stat St; ...

how i can use windows vpn connection file in ubuntu?

i have a windows vpn. how i can use this vpn in Ubuntu 10.04. i don't what's this vpn gateway or other configuration items. my VPN file content is: [usa] Encoding=1 Type=2 AutoLogon=0 UseRasCredentials=1 DialParamsUID=14405859 Guid=0ED19D66025F914DAA2A030FDD4F0354 BaseProtocol=1 VpnStrategy=2 ExcludedProtocols=0 LcpExtensi...

Needed newline byte to send that data.

Hi, I am using C language and Linux as my programming platform. Right now I am learning some embedded programming. I am using a POS device for my practice session and my host is a Windows OS using a cygwin. I created a simple application that will run in the target device that will read the data in the serial port and in the host side ...

How to Plot With Different Marker ( 'x' and 'o') Based on Condition in R

I have a data that looks like this: for_y_axis <-c(0.49534,0.80796,0.93970,0.99998) for_x_axis <-c(1,2,3,4) count <-c(0,33,0,4) What I want to do is to plot the graph using for_x_axis and for_y_axis but will mark the point with "o" if the count value is equal to 0(zero) and with "x" if the count value is greater than zero. Is th...