Bug 836102 - SELinux is preventing /usr/bin/sge_execd from read access on the directory /var/spool/gridengine/pc0x/jobs.
Summary: SELinux is preventing /usr/bin/sge_execd from read access on the directory /v...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 17
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-28 06:38 UTC by Bernd Gloss
Modified: 2012-09-12 00:25 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-12 00:25:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
SELinux message (2.62 KB, text/plain)
2012-06-28 06:40 UTC, Bernd Gloss
no flags Details

Description Bernd Gloss 2012-06-28 06:38:14 UTC
See the SELinux error message attached. I am not a 100% sure whether this is a bug or specific to my installation, however, I don't know how to verify it. 

The installation is a new gridengine installation from F17 on a notebook with the qmaster and the execd at the same machine. I use the system mainly to execute jobs in a row. Since there is an issue with running a gridengine on a machine with no fixed network interface (localhost is not allowed), I setup manually a dummy0 interface and then start the gridengine services via

#> systemctl start sgemaster.service
#> systemctl start sge_execd.service

The SELinux message appears when starting the execd. However, the gridengine seems to be operational and accepts and executes jobs.

Comment 1 Bernd Gloss 2012-06-28 06:40:14 UTC
Created attachment 594947 [details]
SELinux message

Comment 2 Orion Poplawski 2012-07-02 16:32:28 UTC
I think most sge denials are just informative at this point.  I'm reassigning to selinux-policy to get their comments.

You do want to run:

/sbin/restorecon -v /var/spool/gridengine/pc0x/jobs

as suggested by the message.

Dan - I suppose the sge_execd daemon should do this automatically when creating this directory.  I'm still pretty green on the C api for doing this, hint please?

Comment 3 Bernd Gloss 2012-07-03 06:34:56 UTC
running restorecon had no effect. these are the SELinux properties of the files and directories below the node-specific folder pc0x. Seems inconsistend since all are var_spool_t except of jobs, which is sge_spool_t.

[root@pc0x ~]# ls -aZ /var/spool/gridengine/pc0x
drwxr-xr-x. sgeadmin sgeadmin system_u:object_r:var_spool_t:s0 .
drwxr-xr-x. sgeadmin sgeadmin unconfined_u:object_r:var_spool_t:s0 ..
drwxr-xr-x. sgeadmin sgeadmin system_u:object_r:var_spool_t:s0 active_jobs
-rw-r--r--. sgeadmin sgeadmin system_u:object_r:var_spool_t:s0 execd.pid
drwxr-xr-x. sgeadmin sgeadmin system_u:object_r:sge_spool_t:s0 jobs
drwxr-xr-x. sgeadmin sgeadmin system_u:object_r:var_spool_t:s0 job_scripts
-rw-r--r--. sgeadmin sgeadmin system_u:object_r:var_spool_t:s0 messages

Comment 4 Miroslav Grepl 2012-07-03 09:38:42 UTC
You need to run

# restorecon -R -v /var/spool/gridengine



Orion,

so the /var/spool/gridengine is created by sge_execd?

Comment 5 Orion Poplawski 2012-07-03 15:19:01 UTC
/var/spool/gridengine is created by the package, but the <hostname> sub-directory and everything under that is created by sge_execd.

Comment 6 Miroslav Grepl 2012-07-04 08:48:32 UTC
Hmm, the /var/spool/gridengine get the proper labeling on install due to rpm magic and all files should be labeled correctly then.

Any chance the directory is re-created?

Comment 7 Bernd Gloss 2012-07-04 09:49:53 UTC
Indeed, the directory might have been re-created. The gridengine setup process (after installing the packets) is very tricky and error prone. The smallest mistake breaks the installation and you have to re-start at the beginning. Examples for such mistakes are when the interface to which hostname points to is not up or when ssh cannot connect to the qmaster server without a password. Then (according to tool instructions) you have to manually delete /var/spool/gridengine and /usr/share/gridengine/default folders. I guess, I did this at least once.

Comment 8 Fedora Update System 2012-07-10 02:15:15 UTC
gridengine-2011.11p1-2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/gridengine-2011.11p1-2.fc17

Comment 9 Orion Poplawski 2012-07-10 02:27:36 UTC
In this update I removed the one place in the install/uninstall scripts that I found the removes /var/spool/gridengine.  If there are any other comments, etc. that instruct you to do so, please point them out and I'll remove those too.

Comment 10 Fedora Update System 2012-07-10 20:55:01 UTC
Package gridengine-2011.11p1-2.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gridengine-2011.11p1-2.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-10479/gridengine-2011.11p1-2.fc17
then log in and leave karma (feedback).

Comment 11 Orion Poplawski 2012-07-13 22:26:27 UTC
Miroslav - can you confirm for me that all sge denials are just informative at this point, that nothing is actually blocked.  This appears to have to be the case otherwise nothing would work.

Comment 12 Bernd Gloss 2012-07-13 22:27:02 UTC
Okay... I ran the update. Then, when starting the execd, I still got SELinux notifications. 

Next, I removed my whole gridengine installation including manually deleting all gridengine folders and files in /etc/sysconfig, /var/spool/gridengine and /usr/share/gridengine). After that, I did a new installation from the testing repository ran the gridengine setup procedure (without mistakes or any further manual interactions). Now, when starting the sge_execd via sysctl, I get four new SELinux notifications about sge_execd accessing name_bind, name_connect, read cpuset.cpus, and getattr cpuset.cpus


aside of the SELinux messages, the setup seems to be okay (right number of queues and cpus). Also, a quick test with one job going through the queue was successful.

Comment 13 Miroslav Grepl 2012-07-24 12:50:30 UTC
(In reply to comment #12)
> Okay... I ran the update. Then, when starting the execd, I still got SELinux
> notifications. 
> 
> Next, I removed my whole gridengine installation including manually deleting
> all gridengine folders and files in /etc/sysconfig, /var/spool/gridengine
> and /usr/share/gridengine). After that, I did a new installation from the
> testing repository ran the gridengine setup procedure (without mistakes or
> any further manual interactions). Now, when starting the sge_execd via
> sysctl, I get four new SELinux notifications about sge_execd accessing
> name_bind, name_connect, read cpuset.cpus, and getattr cpuset.cpus
> 

Could you add raw AVC msgs?

Comment 14 Fedora Update System 2012-09-12 00:25:14 UTC
gridengine-2011.11p1-2.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.