CentOS

CentOS - how to rebuild a source RPM. (from the CentOS wiki, accessed July 2019)

Link to instructions on how to set up the environment. (Also from the CentOS wiki, accessed July 2019)

Building an RPM for emacs

16 Sep 2018

I wrote about creating an emacs rpm before. I was trying to copy it over to a rhel7 system and crashed screen (gnu screen) spectacularly.

It seems that screen is buggy after all. I found a reference to a bug report that shows the state of screen during a crash [1].

The bug report was very interesting, because it mentions that the user attaches to the running screen session with gdb to obtain a stack trace. This is very useful, because the screen process was showing 100% cpu usage and I could list it among the processes.

So I enquired how to attach to the running process and found [2] that gdb allows the call with the process ID, e.g.

gdp -p <process-id>

Except that it did not work. The error was “ptrace: operation not permitted” This works okay on my fedora system. A search on the subject revealed [3] that it has to do with a kernel “yama” security option. An answer by “jesup” further links to a fedora 22 article [4] that suggests two solutions.

The temporary solution is to execute (as root):

echo 0 > /proc/sys/kernel/yama/ptracescope

Also, the author says,

To enable that permanently, do:

echo kernel.yama.ptracescope = 0 > /etc/sysctl.d/10-ptrace.conf

The etc/sysctl.d does not exist in fedora 28 anymore and there is a note pointing to other locations: /usr/lib/sysctl.d, run/sysctl.d, and etc/sysctl.d.

The first folder does include a 10-default-yama-scope.conf file setting the ptrace_scope value to zero.

Back to the rpm

There are clashes with other files, detected by the rpm database.

gctags.1.gz and info.gz

It turns out that info.gz is a solution to bugzilla bug 927996 [5] but it does not solve the problem in my case. I don’t know why and I’m not worried about erasing info.gz, so I have done that.

dnf diversion

It turns out that dnf can query packages in a repository without downloading the package. The method is to use ‘dnf repoquery -l’.

Conclusion

I created a packaged version of emacs 25.3 on a rhel7 system.

Footnotes