Bug 825725

Summary: run_init always ends up with "execvp: No such file or directory" message
Product: Red Hat Enterprise Linux 7 Reporter: Milos Malik <mmalik>
Component: policycoreutilsAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Michal Trunecka <mtruneck>
Severity: medium Docs Contact:
Priority: high    
Version: 7.0CC: dwalsh, ebenes, mgrepl, mtruneck
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: policycoreutils-2.2.5-6.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 12:56:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Milos Malik 2012-05-28 09:45:59 UTC
Description of problem:
No matter what service I tried to start/stop/status, run_init always ended up with the same error message.

Version-Release number of selected component (if applicable):
policycoreutils-python-2.1.11-15.el7.x86_64
policycoreutils-2.1.11-15.el7.x86_64
policycoreutils-newrole-2.1.11-15.el7.x86_64

How reproducible:
always

Steps to Reproduce:
# run_init service memcached status
Authenticating root.
Password: 
execvp: No such file or directory
#

Actual results:
* run_init is not able to execute supplied command line

Expected results:
* run_init works as usual

Comment 1 Milos Malik 2012-05-28 09:48:58 UTC
This bug blocks a lot of automated selinux-policy tests, which heavily use run_init.

Comment 2 Michal Trunecka 2012-05-28 09:57:58 UTC
The bug is probably caused by this code in run_init.c:

    417     if (execvp("/usr/sbin/open_init_pty", argv)) {
    418         perror("execvp");
    419         exit(-1);
    420     }
    421     return 0;

Because it calls open_init_pty, which was removed according to this line in changelog of policycoreutils:

 * Wed Dec 21 2011 Dan Walsh <dwalsh> - 2.1.10-2
   Remove open_init_pty

Comment 3 Daniel Walsh 2012-05-29 15:37:59 UTC
rpm -q policycoreutils
policycoreutils-2.1.11-18.fc18.x86_64

has

	if (! access("/usr/sbin/open_init_pty", X_OK)) {
		if (execvp(argv[1], argv + 1)) {
			perror("execvp");
			exit(-1);
		}
		return 0;
	}

Comment 6 Daniel Walsh 2012-11-05 16:47:07 UTC
run_init requires full paths.


run_init /sbin/service memcached status

Although for this command it does blow up.

with unconfined module disabled.

run_init should die a painful death and is not really as needed in a systemd world.

Comment 7 Daniel Walsh 2012-11-05 16:50:17 UTC
I think run_init should be dropped from the distribution, since systemd eliminates the need.

Comment 8 Milos Malik 2012-11-06 07:53:54 UTC
That sound good.

Comment 9 Daniel Walsh 2012-11-06 20:01:44 UTC
Removed in policycoreutils-2.1.13-26.el7

Comment 10 Michal Trunecka 2013-03-19 07:46:20 UTC
What was the fix, then? Seems the run_init is still there:

# rpm -q policycoreutils
policycoreutils-2.1.14-22.el7.x86_64

# rpm -ql policycoreutils | grep run_init
/etc/pam.d/run_init
/usr/sbin/run_init
/usr/share/man/man8/run_init.8.gz
/usr/share/man/ru/man8/run_init.8.gz

Comment 11 Michal Trunecka 2014-01-28 13:48:24 UTC
I see that run_init is in policycoreutils-newrole now. Is there a reason to keep it in RHEL7 then or is it still going to be removed?

policycoreutils-newrole-2.2.5-2.el7.x86_64

Comment 12 Miroslav Grepl 2014-02-03 09:11:43 UTC
Ok, I am testing a fix.

# rpm -ql policycoreutils-newrole
/etc/pam.d/newrole
/usr/bin/newrole
/usr/share/man/man1/newrole.1.gz

Easy fix (Makefile+specfile) but we will need to add an announcement about this change (a doc note).

Comment 16 Ludek Smid 2014-06-13 12:56:42 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Comment 18 Red Hat Bugzilla 2023-09-14 01:29:27 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days