Skip to contentSkip to conversation

More on selinux-default policy install probs

DISCUSSION Dale Amon 1 participant 2 messages Dec 9, 2003 SELinux security module

lore
Share & tools
lore

Dale Amon

author
#0 lore raw

Russ, I've a few minutes free this evening to dig into the package problems and as a starter I suggest you experiment with a way around this:

Attempt to install any old package after selinux-default-policy fails:

# dpkg -i dpkg-dev_1.10.18_all.deb 
(Reading database ... 15591 files and directories currently installed.)
Preparing to replace dpkg-dev 1.10.18 (using dpkg-dev_1.10.18_all.deb) ...
Unpacking replacement dpkg-dev ...
Setting up dpkg-dev (1.10.18) ...
/etc/selinux does not exist, aborting!
run-parts: /etc/dpkg/postinst.d/selinux exited with return code 1
"/bin/run-parts --arg=dpkg-dev /etc/dpkg/postinst.d" failed: 256
dpkg: error processing dpkg-dev (--install):
 1Error running trigger postinst: No such file or directory
Errors were encountered while processing:
 dpkg-dev

This happens because for some reason because /etc/selinux doesn't exist... in fact there is only a /usr/share/selinux/policy/default and no current left behind. Your postint.d script explicitely forces a fail on every package install because of it.

Removing just the post install hook:

# mv /etc/dpkg/postinst.d/selinux /root/selinux

Allows normal dpkg installing to work again:

# dpkg -i dpkg-dev_1.10.18_all.deb 
(Reading database ... 15591 files and directories currently installed.)
Preparing to replace dpkg-dev 1.10.18 (using dpkg-dev_1.10.18_all.deb) ...
Unpacking replacement dpkg-dev ...
Setting up dpkg-dev (1.10.18) ...

-------------------------------

I'll try to dig deeper... for one I'd like to figure out why the policy package install didn't create the link. As you can probably guess I was installing dpkg-dev on the loopback image so I can figure out what you've done to me ;-)

If this is something that could happen to anyone who "just tries" installing selinux-default-policy for the hell of it on a normal debian machine, it could cause a bit of a problem for them.

Signature · 12 lines
------------------------------------------------------
   Dale Amon     [email protected]    +44-7802-188325
       International linux systems consultancy
     Hardware & software system design, security
    and networking, systems programming and Admin
	      "Have Laptop, Will Travel"
------------------------------------------------------

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author
#1 lore raw

Just so you can see what I'm seeing... first to make sure all is virgin, I purge the files:

# dpkg --purge selinux-policy-default                         
(Reading database ... 15591 files and directories currently installed.)
Removing selinux-policy-default ...
Purging configuration files for selinux-policy-default ...

Okay, now we are in a clean state. I attempt to install the policy package:

# dpkg -i selinux-policy-default_1%3a1.2.real-13_all.deb 
Selecting previously deselected package selinux-policy-default.
(Reading database ... 15228 files and directories currently installed.)
Unpacking selinux-policy-default (from selinux-policy-default_1%3a1.2.real-13_all.deb) ...
Setting up selinux-policy-default (1.2.real-13) ...
/etc/selinux does not exist, aborting!
run-parts: /etc/dpkg/postinst.d/selinux exited with return code 1
"/bin/run-parts --arg=selinux-policy-default /etc/dpkg/postinst.d" failed: 256
dpkg: error processing selinux-policy-default (--install):
 1Error running trigger postinst: No such file or directory
Errors were encountered while processing:
 selinux-policy-default

And it fails... and leaves the postinit.d hook
behind just to make sure all other package
installs will fail too!

It looks to me like the postinst.d hook might run before selinux-policy-default.postinst creates the link. But that doesn't make sense because that would happen on any system and always fail the first time around.

Next I guess I'll have to try debugging these
scripts to see why this happens...

Signature · 12 lines
------------------------------------------------------
   Dale Amon     [email protected]    +44-7802-188325
       International linux systems consultancy
     Hardware & software system design, security
    and networking, systems programming and Admin
	      "Have Laptop, Will Travel"
------------------------------------------------------

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.