Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[p2-dev] Install software fails in rcp installed as root

Hi all,

I'm facing a disturbing issue with a product installed as root (deb pkg). The issue is fully described in Eclipse Forum (https://www.eclipse.org/forums/index.php/t/1098346/), with screenshots, and snippet to reproduce.

To summarize, some of our plugins have p2.inf aiming to restore symlinks resources replaced by their targets during package phase because of jar format:

instructions.install.import=\
  org.eclipse.equinox.p2.touchpoint.eclipse.chmod,\
  org.eclipse.equinox.p2.touchpoint.natives.remove,\
  org.eclipse.equinox.p2.touchpoint.natives.ln
instructions.install=\
  chmod(targetDir:@artifact,targetFile:lib/lib.so.0.0.0,permissions:755);\
  remove(path:${artifact.location}/lib/lib.so);\
  ln(targetDir:${artifact.location},linkTarget:lib.so.0.0.0,linkName:/lib/lib.so);\
  chmod(targetDir:@artifact,targetFile:lib/lib.so,permissions:755);

Result of Tycho materialize-product goal looks correct, symlinks are created as expected. Product is used as is from archive-product goal and packaged in Debian package, meaning without intermediates steps. Package is then installed in /opt, as root, and execution as standard user looks correct too (shared configuration area in use).

However things become complicated when trying to install 3rd party software as non-root user into the "product" (rather in the shared cfg area), getting the following error during installation:

    An error occurred while installing the items
    session context was:(profile=profile, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]org.eclipse.ui.tutorials.rcp.part3 1.0.0,    action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.RemoveAction).
    Backup of file /opt/eclipse-rcp-root/eclipse/plugins/org.eclipse.ui.tutorials.rcp.part3_1.0.0/lib/lib.so failed.
    File that was copied to backup could not be deleted: /opt/eclipse-rcp-root/eclipse/plugins/org.eclipse.ui.tutorials.rcp.part3_1.0.0/lib/lib.so

Error which is directly caused by instruction done above in p2.inf. If I remove the ln() and remove() instructions everything is ok.
Anyway I can't understand why such instructions are executed again, although the software being installed is clearly not related to this plugin.

So either I'm missing important steps between product materialize and installation (initialize?) or there is an issue in P2 (or Tycho). Things I can't imagine :-)

Any help will be really appreciated, again :-)

Cheers,
Julien


Back to the top