Tag Info

Hot answers tagged

31

Session: dbus-send --session \ --dest=org.freedesktop.DBus \ --type=method_call \ --print-reply \ /org/freedesktop/DBus \ org.freedesktop.DBus.ListNames System: dbus-send --system \ --dest=org.freedesktop.DBus \ --type=method_call \ --print-reply \ ...


19

This depends a lot on the communication mechanism. At the most transparent end of the spectrum, processes can communicate using internet sockets (i.e. IP). Then wireshark or tcpdump can show all traffic by pointing it at the loopback interface. At an intermediate level, traffic on pipes and unix sockets can be observed with truss/strace/trace/..., the ...


16

qdbusviewer is your best friend, allow your to send dbus messages as well:


15

UNIX domain sockets and FIFO may share some part of their implementation but they are conceptually very different. FIFO functions at a very low level. One process writes bytes into the pipe and another one reads from it. A UNIX domain socket has the same behaviour than a TCP/IP socket. A socket is bidirectionnal and can be used by a lot of processes ...


9

Historically, Unix had only these two signals, but modern systems have the real-time signals SIGRTMIN...SIGRTMAX. Due to the wacky and unportable semantics of the signal APIs, there is almost no use case where signals would be preferrable over other communication mechanisms like pipes. Therefore, allocating a new signal number has never been seen as ...


7

Finding the transport Try using netstat -ln | grep 'mysql' and you can see how it is connected by the output. if you have access to shell On Unix, MySQL programs treat the host name localhost specially, in a way that is likely different from what you expect compared to other network-based programs. For connections to localhost, MySQL programs attempt to ...


7

If you read the manpage for semget, in the Notes section you'll notice: System wide maximum number of semaphore sets: policy dependent (on Linux, this limit can be read and modified via the fourth field of /proc/sys/kernel/sem). On my system, cat /proc/sys/kernel/sem reports: 250 32000 32 128 So do that on your system, and then echo it back after ...


5

I have a solution that uses lsof. It is not installed on BSD by default so if anyone want to use it on BSD, it is required to install it. Make a shell script: #!/bin/sh lsof -p $1 | grep cwd | awk '{print $9}' Copy it to a directory in your path. It prints the working directory of PID given in the first argument, I.E. $ script 1987 /home/enedil


4

Yes, a pipe made with pipe() has two file descriptors. fd[0] for reading and fd[1] for writing. No, you do not have to close either end of the pipe, it can be used for bidirectional communication. Edit: in the comments you want to know how this relates to ls | less, so I'll explain that too: Your shell has three open file descriptors: 0 (stdin), 1 ...


4

This will show what a process reads and writes: strace -ewrite -p $PID It's not clean output (shows lines like: write(#,) ), but works! (and is single-line :D ) You might also dislike the fact, that arguments are abbreviated. To control that use -s parameter that sets the maxlength of strings displayed. It catches all streams, so You might want to filter ...


4

POSIX doesn't offer much in terms of getting information about unrelated processes. There's only ps, really, and it doesn't give any information about the current directory. The C-level APIs aren't any better (in fact most of the information retrieved by ps can only be retrieved by parsing its outputĀ¹). Funnily enough POSIX does offer a portable way to go ...


4

Signals only provide a primitive means of communication. In particular, there's no way to attach any information to them. The recipient only knows the signal number, not the identity of the sender. Multiple signals can be conflated into one. Given all these restrictions, there aren't that many useful purposes for signals. For more complex purposes, use more ...


4

By system clock I mean the clock that tells the time down right of the panel "System clock" generally refers to the clock maintained by the kernel; applications such as date and GUI clocks such as the one you refer to make calls to it like this. Why, out of all the processes that the system runs, does the clock need a shared memory segment? ...


4

You also use ipcs, but add extra options: wouter@gangtai:~$ ipcs ------ Message Queues -------- key msqid owner perms used-bytes messages ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x0052e2c1 32768 postgres 600 56 20 ...


3

There's quite a good discussion of this here: http://www.slideshare.net/divyekapoor/linux-kernel-implementation-of-pipes-and-fifos So far as I can see, both from the presentation slides, and the source @ http://lxr.free-electrons.com/source/fs/pipe.c - fifo's are implemented as a wrapper around pipe's, and pipe's themselves are implemented via the pipefs ...


3

I don't believe there are any commands that allow you to monitor POSIX message queues specifically. As you mentioned, all of the details are exposed via a pseudo filesystem, usually mounted under /dev/mqueue. Once you've done that, you can then use file management commands like ls, rm, cat, etc. to inspect and manage the queue details.


3

bash-4.3$ ps -j | cat PID PGID SID TTY TIME CMD 4586 4586 4586 pts/1 00:00:00 bash 4600 4600 4586 pts/1 00:00:00 ps 4601 4600 4586 pts/1 00:00:00 cat bash-4.3$ ps -j; ps -j PID PGID SID TTY TIME CMD 4586 4586 4586 pts/1 00:00:00 bash 4602 4602 4586 pts/1 00:00:00 ps PID PGID SID TTY TIME ...


2

Just some pointers on how to (possibly) talk with the power daemon. Have a look into the Chromium OS sources (no idea on how much this differs from Chrome OS), there you'll find the power_managers sources which might be helpful: README explains what one can find there, among others: powerd (powerd.cc) Upper power manager. Adjusts device status ...


2

The python way is the beautiful way. System services: import dbus for service in dbus.SystemBus().list_names(): print(service) Session services: import dbus for service in dbus.SessionBus().list_names(): print(service)


2

My parent process had died for some reason. This caused the issue. I took care of that and the problem got solved.


2

ls will output what it has to output on its standard output. To do that, it calls the write system call, something like: write(1, "file1 file2...\n", 16) (or more likely it calls libc functions like printf or fwrite that eventually do the write() system call) It assumes that the file descriptor 1 (stdout by convention) was already opened and points to ...


2

Typically the parent process waits until the child process ends by calling waitpid. The parent process gets the PID of the process from fork. This means the child never signals the parent process in any way that it exited or what happened. This is done by the system and not the child process. If you are talking about the output of the program, the parent ...


2

This is a summary of the chat conversation Dennis and I had, simplified so even other newbies can use it. When executing ls | less: The bash shell is the parent process that has fd[0], fd[1], and fd[2]. pipe() is called by the parent, and it creates a pipe which is nothing but a buffer to accommodate data, and it has a file descriptor at each end, one for ...


2

$ ipcs -q will provide message queue stats from the command line. $ ipcs -m will provide shared memory stats from the command line. $ ipcs will provide all ipc mechanism stats.


2

That's probably how pty device files get created, but you don't want to do that whenever you want a pty. Any given machine usually has a complement of pty device files already created. Pseudo TTYs are fairly OS specific and you don't mention what you want to do this on. For a modern linux, I'd take a look at openpty(3). You can find working example code in ...


2

If you need to save the intermediate file after the processing is done, then inter-process communication (such as through a pipe or socket) is not particularly valuable.Ā  Similarly, if you need to run the two programs at vastly different times, you should just do it the way you're doing it now. Back when Unix was created, disks were very small, and it was ...


2

As per the official docs (under standard interfaces): There are some standard interfaces that may be useful across various D-Bus applications. org.freedesktop.DBus.Introspectable This interface has one method: org.freedesktop.DBus.Introspectable.Introspect (out STRING xml_data) Objects instances may implement Introspect which returns ...


2

lsof(8) is probably your best option. Lesser options include ipcs(1), fuser(1), netstat(8), ps(1), and rummaging through /proc.


1

These appear to be files that Qt creates during the course of Inter-process communication. The file names indicate that shared memory and semaphores were used.


1

Not by convention but to facilitate high-level bindings. Native Objects and Object Paths Your programming framework probably defines what an "object" is like; usually with a base class. For example: java.lang.Object, GObject, QObject, python's base Object, or whatever. Let's call this a native object. The low-level D-Bus protocol, ..., ...



Only top voted, non community-wiki answers of a minimum length are eligible