diff --git a/xCAT-probe/debian/xcat-probe.links b/xCAT-probe/debian/xcat-probe.links deleted file mode 100644 index 8737b5e45..000000000 --- a/xCAT-probe/debian/xcat-probe.links +++ /dev/null @@ -1 +0,0 @@ -/opt/xcat/bin/xcatclient /opt/xcat/probe/subcmds/bin/switchprobe diff --git a/xCAT-probe/xCAT-probe.spec b/xCAT-probe/xCAT-probe.spec index 432c78213..847f8a4ab 100644 --- a/xCAT-probe/xCAT-probe.spec +++ b/xCAT-probe/xCAT-probe.spec @@ -71,10 +71,6 @@ if [ -e %{prefix}/probe/subcmds/bin/switchprobe ]; then else mkdir -p %{prefix}/probe/subcmds/bin/ fi -cd %{prefix}/probe/subcmds/bin/ -if [ -e %{prefix}/bin/xcatclient ]; then - ln -s %{prefix}/bin/xcatclient switchprobe -fi %preun #remove the bin directory if not on upgrade diff --git a/xCAT-probe/xcatprobe b/xCAT-probe/xcatprobe index 4116164a4..5a732c783 100755 --- a/xCAT-probe/xcatprobe +++ b/xCAT-probe/xcatprobe @@ -259,6 +259,19 @@ foreach my $attr (@tmpargv) { } } +# Create symlink /opt/xcat/probe/subcmds/bin/switchprobe -> /opt/xcat/bin/xcatclient if not already there +my $switchprobe_link = $plugin_dir."/bin/switchprobe"; +unless (-l $switchprobe_link) { + my $xcatclient = `which xcatclient`; + chomp($xcatclient); + if ($xcatclient) { + symlink($xcatclient, $switchprobe_link); + } + else { + print "Can not create symbolic link $switchprobe_link to xcatclient. xCAT-client package not installed.\n"; + exit 1; + } +} &loadsubcmds; if (defined($pluginname)) {