Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
31f38b17
Commit
31f38b17
authored
Nov 18, 2013
by
Dwight Engen
Committed by
Serge Hallyn
Nov 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oracle template: further disable selinux in ol5 container
Signed-off-by:
Dwight Engen
<
dwight.engen@oracle.com
>
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
7be677a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
lxc-oracle.in
templates/lxc-oracle.in
+13
-2
No files found.
templates/lxc-oracle.in
View file @
31f38b17
...
...
@@ -51,11 +51,17 @@ container_rootfs_configure()
{
echo
"Configuring container for Oracle Linux
$container_release_major
.
$container_release_minor
"
# "disable" selinux. init in OL 5 honors /etc/selinux/config. note that
# "disable" selinux in the guest. The policy in the container isn't
# likely to match the hosts (unless host == guest exactly) and the
# kernel can only be enforcing one policy.
#
# The OL 5 init honors /etc/selinux/config, but note that
# this doesnt actually disable it if it's enabled in the host, since
# libselinux::is_selinux_enabled() in the guest will check
# /proc/filesystems and see selinuxfs, thus reporting that it is on
# (ie. check the output of sestatus in the guest)
# (ie. check the output of sestatus in the guest). We also replace
# /usr/sbin/selinuxenabled with a symlink to /bin/false so that init
# scripts (ie. mcstransd) that call that think selinux is disabled.
mkdir
-p
$container_rootfs
/selinux
echo
0
>
$container_rootfs
/selinux/enforce
if
[
-e
$container_rootfs
/etc/selinux/config
]
;
then
...
...
@@ -68,6 +74,11 @@ container_rootfs_configure()
sed
-i
's|session[ \t]*required[ \t]*pam_selinux.so[ \t]*open|#session required pam_selinux.so open|'
$container_rootfs
/etc/pam.d/login
sed
-i
's|session[ \t]*required[ \t]*pam_loginuid.so|#session required pam_loginuid.so|'
$container_rootfs
/etc/pam.d/login
if
[
-f
$container_rootfs
/usr/sbin/selinuxenabled
]
;
then
mv
$container_rootfs
/usr/sbin/selinuxenabled
$container_rootfs
/usr/sbin/selinuxenabled.lxcorig
ln
-s
/bin/false
$container_rootfs
/usr/sbin/selinuxenabled
fi
# silence error in checking for selinux
sed
-i
's|cat /proc/self/attr/current|cat /proc/self/attr/current 2>/dev/null|'
$container_rootfs
/etc/rc.sysinit
sed
-i
's|cat /proc/self/attr/current|cat /proc/self/attr/current 2>/dev/null|'
$container_rootfs
/etc/rc.d/rc.sysinit
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment