Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

track_process: PROC_EVENT* undeclared on CentOS 6 #1119

Closed
chiak597 opened this issue Jan 30, 2019 · 5 comments
Closed

track_process: PROC_EVENT* undeclared on CentOS 6 #1119

chiak597 opened this issue Jan 30, 2019 · 5 comments

Comments

@chiak597
Copy link

I'm trying to compile keepalived-2.0.12 on CentOS 6.10.

Configure command passed without any errors:
./configure --with-init=SYSV --disable-nftables

However, make fails on track_process.c:

CC     track_process.o
track_process.c: In function ‘handle_proc_ev’:
track_process.c:657: error: ‘PROC_EVENT_PTRACE’ undeclared (first use in this function)
track_process.c:657: error: (Each undeclared identifier is reported only once
track_process.c:657: error: for each function it appears in.)
track_process.c:666: error: ‘PROC_EVENT_COMM’ undeclared (first use in this function)
track_process.c:673: error: ‘union <anonymous>’ has no member named ‘comm’
track_process.c:673: error: ‘union <anonymous>’ has no member named ‘comm’
track_process.c:675: error: ‘PROC_EVENT_COREDUMP’ undeclared (first use in this function)
make[2]: *** [track_process.o] Error 1 

My first thought was that CONFIG_PROC_EVENTS is not set (#1099), but it is there.

[root@centos ~] grep PROC_EVENTS /boot/config-2.6.32-754.10.1.el6.x86_64
CONFIG_PROC_EVENTS=y

On CentOS 7, package is compiled without any issue, so there might be an issue with kernel version.

@pqarmitage
Copy link
Collaborator

As a temporary workaround, you could specify --disable-track-process.

I am currently working on a patch that will detect if the various PROC_EVENT_*s are declared. Unfortunately track_process will not work prior to Linux v3.2 due to it using PROC_EVENT_COMM.

I will also produce a patch so that it properly detects if nftables can be used.

pqarmitage added a commit to pqarmitage/keepalived that referenced this issue Jan 30, 2019
Issue acassen#1119 reported that keepalived wouldn't build on CentOS 6.

Various PROC_EVENT_* declarations were assumed to exist, some of which
were not introduced until Linux v3.10. Most of them are not needed, but
PROC_EVENT_COMM is used by the track_process code.

This commit now checks for the existence of the PROC_EVENT_* declarations,
but since keepalived uses PROC_EVENT_COMM, track_process is not supported
prior to Linux v3.2.

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
@pqarmitage
Copy link
Collaborator

Commit 1637032 resolves the compilation failure
Commit 975315b allow track_process to work on pre 3.2 kernel but with the limitation that changes to a process name (/proc/PID/comm) aren't detected
Commit 2d48f81 means that you will no longer have to specify --disable-nftables

I'm not sure how to reliably detect the init type. /sbin/init --version reports that it is upstart, which is why configure is selecting the wrong type.

@chiak597
Copy link
Author

chiak597 commented Feb 1, 2019

Thanks.

Regarding init: CentOS 6 uses upstart, but many people (including me) still prefer to use sysvinit scripts on it.
It is OK to specify init manually, but when I run ./configure --with-init=SYSV to generate .spec file, init option is missing from resulting file and I need to patch it manually (otherwise upstart is autoselected during rpmbuild). Is that an expected behavior?

@pqarmitage
Copy link
Collaborator

Commit 9c94b40 should resolve setting the init option in the spec file.

@feckert
Copy link
Contributor

feckert commented Nov 4, 2019

@pqarmitage I have update in OpenWrt recently to the newest version 2.0.19. An user reported problems in some arch wich does not have defined in the kernel config CONFIG_PROC_EVENTS.
The system compiles but complains on runtime the follwoing error.

Mon Nov 4 11:58:19 2019 daemon.info Keepalived[3254]: Starting Keepalived v2.0.19 (10/24,2019), git commit reboot-10737-g37f853f341
Mon Nov 4 11:58:19 2019 daemon.info Keepalived[3254]: Running on Linux 4.14.149 #0 SMP Thu Oct 24 14:18:26 2019 (built for Linux 4.14)
Mon Nov 4 11:58:19 2019 daemon.info Keepalived[3254]: Command line: '/usr/sbin/keepalived' '-n' '-f' '/tmp/keepalived.conf'
Mon Nov 4 11:58:19 2019 daemon.info Keepalived[3254]: Opening file '/tmp/keepalived.conf'.
Mon Nov 4 11:58:19 2019 daemon.info Keepalived[3254]: track_process not available - is CONFIG_PROC_EVENTS enabled in kernel config?
Mon Nov 4 11:58:19 2019 daemon.info Keepalived[3254]: pidfile_write : Cannot open /run/keepalived.pid pidfile

I think its not enough to check if the c kernel definitions are valid but we need also check if the kernel params are enbabled. So could we check this?

feckert added a commit to TDT-AG/packages that referenced this issue Nov 4, 2019
…not enabled

This fixes a runtime startup error for system, which does not have enabled the
kernel config option CONFIG_PROC_EVENTS.

This workaround was published on github under the following URL.
acassen/keepalived#1119

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants