Identifying Participants in a Mediation
Use the pkg mediator
command to display the preferred versions of all mediated links in the image.
In the following output, MEDIATOR
is the name of the set of links that share the same preferred link path. VER. SRC.
and IMPL. SRC.
show whether the preferred version was selected by the system, was selected according to an assigned priority (vendor
or site
) or was set by an administrator (local
). VERSION
is the version of the selected mediation participant, which should be similar to the version of the software that the link represents. The VERSION
is set by the package developer. IMPLEMENTATION
is a string that can be set by the package developer in addition to or instead of the version string. Your list will be different, depending on what you have installed.
$ pkg mediator
MEDIATOR VER. SRC. VERSION IMPL. SRC. IMPLEMENTATION
apache system 2.4 system
apr-1-config system 1.5 system
apu-1-config system 1.5 system
csh vendor vendor suncsh
gcc system 5 system
java system 1.8 system
openssl vendor vendor default
perl vendor 5.22 vendor
python local 2.7 vendor
ruby vendor 2.1 vendor
sendmail vendor vendor sendmail
which vendor vendor gnu
The -a
option shows all mediation participants. Use this option to show your choices if you want to select a different preferred version. The following example shows all participants in the java
mediation. The system
keywords indicate that the preferred version in this mediation is not specified with a priority setting in the package and was not set by an administrator: The packaging system selected the version with the higher VERSION
value as the preferred version.
$ pkg mediator -a java
MEDIATOR VER. SRC. VERSION IMPL. SRC. IMPLEMENTATION
java system 1.8 system
java system 1.7 system
The following output shows all packages that deliver the java
mediation:
$ pkg search -lo pkg.name,mediator-version link:mediator:java
PKG.NAME MEDIATOR-VERSION
runtime/java/jre-7 1.7
runtime/java/jre-8 1.8
The following output confirms that two different versions of the Java Runtime Environment are installed in this image and version 1.8.0_112
is the currently selected preferred version:
$ pkg list -s '*jre*' NAME (PUBLISHER) SUMMARY runtime/java/jre-7 Java Platform Standard Edition Runtime Environment (1.7.0_131-b12) runtime/java/jre-8 Java Platform Standard Edition Runtime Environment (1.8.0_121-b13) $ java -version java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
The following output shows the mediated links (PATH
) and where they link (TARGET
):
$ pkg contents -o mediator-version,path,target -t link -a mediator=java jre-8 jre-7 MEDIATOR-VERSION PATH TARGET 1.7 usr/java jdk/jdk1.7.0_131 1.8 usr/java jdk/jdk1.8.0_121 1.7 usr/jdk/jdk1.7.0_131 instances/jdk1.7.0 1.8 usr/jdk/jdk1.8.0_121 instances/jdk1.8.0 1.7 usr/jdk/latest jdk1.7.0_131 1.8 usr/jdk/latest jdk1.8.0_121 $ ls -l /usr/java lrwxrwxrwx 1 root root 16 Mar 23 16:11 /usr/java -> jdk/jdk1.8.0_121/
Both the jre-8
and jre-7
packages define a symbolic link whose path is /usr/bin/java
. In the jre-7
package, the target of the link is jdk1.6.0
. In the jre-8
package, the target of the link is jdk1.7.0
. The pkg mediator
and java -version
commands above show that version 1.8 is currently the preferred version, the target of the /usr/bin/java
link.