Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50745

RHEL7's vncserver script is not compatible with the free list

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • vncviewer-plugin
    • None
    • RHEL7, Jenkins 2.30 and 2.66, latest version of the plugin

    Description

      The behavior of the /bin/vncserver script has changed in RHEL7: When it checks for a display to start VNC on, the code has changed:

       

      • On RHEL6, when it finds that the first display in the free list is used, it dies
      • On RHEL7, when it finds that the first display in the free list is used, it starts looking at display :1, bypassing the free list.

      Here's the original code on RHEL7:

      Find display number.
      if ((@ARGV > 0) && ($ARGV[0] =~ /^:(\d+)$/)) {
       $displayNumber = $1;
       shift(@ARGV);
       if (!&CheckDisplayNumber($displayNumber)) {
       warn "A VNC server is already running as :$displayNumber\n";
       $displayNumber = &GetDisplayNumber();
       }
      } elsif ((@ARGV > 0) && ($ARGV[0] !~ /^-/) && ($ARGV[0] !~ /^\+/)) {
       &Usage();
      } else {
       $displayNumber = &GetDisplayNumber();
      }

       

      Here is what we did to get it to work correctly:

      Find display number.
      if ((@ARGV > 0) && ($ARGV[0] =~ /^:(\d+)$/)) {
       $displayNumber = $1;
       shift(@ARGV);
       if (!&CheckDisplayNumber($displayNumber)) {
       die "A VNC server is already running as :$displayNumber\n";
      # warn "A VNC server is already running as :$displayNumber\n";
      # $displayNumber = &GetDisplayNumber();
       }
      } elsif ((@ARGV > 0) && ($ARGV[0] !~ /^-/) && ($ARGV[0] !~ /^\+/)) {
       &Usage();
      } else {
       $displayNumber = &GetDisplayNumber();
      }

       

      Here's the equivalent code for RHEL6:

      if ((@ARGV > 0) && ($ARGV[0] =~ /^:(\d+)$/)) {
       $displayNumber = $1;
       shift(@ARGV);
       if (!&CheckDisplayNumber($displayNumber)) {
       die "A VNC server is already running as :$displayNumber\n";
       }
      } elsif ((@ARGV > 0) && ($ARGV[0] !~ /^-/) && ($ARGV[0] !~ /^\+/)) {
       &Usage();
      } else {
       $displayNumber = &GetDisplayNumber();
      }

       

      Attachments

        Activity

          There are no comments yet on this issue.

          People

            tbaum Dimitri Tenenbaum
            ubellavance Ugo Bellavance
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: