0

Edited: Since the initial question was too general I will focus on only one program.

I am running the command libinput-gestures-setup start, which comes bundled with libinput-gestures and it seems to work but ps shows no record of the process started and libinput-gestures-setup status says that program hasn't been started. journalctl doesn't log anything on it. I would like to see everything that happens when I run the command so I can debug it and get it running.

I'm running Arch Linux on kernel 5.9.2, systemd 246.6, util-linux 2.35.2, xorg-server 1.20.9, herbstluftwm 0.8.3

4
  • 1
    I think that your question should be more focused, what are defined as "programs"? And what do you want specifically to log for that program, "config files read, temp files written to, other files written to or read from, services accessed etc" is not well-defined, at least the "etc" could have many different meanings. Commented Nov 3, 2020 at 18:09
  • I realize that it's not the most specific question, that is because I feel lost trying to debug this. By programs I am referring to anything that is compiled code installed on my machine and run with a specific command ( e.g. firefox, picom, nitrogen) and I want to track what they do. I.E. redshift reads configurations from redshift.conf, calls geoclue2 to get location and time and adjusts the color temperature. I want to be able to track this behavior for all programs so that I can see where they stop running. Commented Nov 3, 2020 at 18:21
  • 1
    Short answer no. But it may be possible. Edit the question, to focus on what you are trying to achieve. What is your goal? Commented Nov 3, 2020 at 18:25
  • 3
    Many of these programs have a verbose/debug mode which is targeting themselves for debugging. Also the basic shell command to trace the calls of a program is strace <program>. This will tell you for example all files that program is opening, and more. (man strace) I guess you will get more advise on your query. Commented Nov 3, 2020 at 19:04

2 Answers 2

3

I would like to see everything that happens when I run the command so I can debug it and get it running.

libinput-gestures-setup is a simple Bash script. You can just look at it and see what it is doing. To "debug" it, you could add the set -x option in the begining of it, and it will run the entire script in debug mode -- i.e., traces of each command, plus its arguments are printed to standard output. Or, instead of editing it to add the option, you could just run it like this:

bash -x libinput-gestures-setup start
1

I make an answer because I haven't enough reputation to comment. Anyway as @thanasisp has said there the strace command line. But there is an other interesting framework to trace software. It's lttng and its gui babeltrace. You can trace the kernel, c binary, python and java software. And here is a quick-start tutorial.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.