Announcement

Collapse
No announcement yet.

obtaining license fails if running vrayslave as service but works if started manually

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • obtaining license fails if running vrayslave as service but works if started manually

    Hi there

    I want to run vrayslave on an ubuntu server 16.04, preferentially as a service (I installed vray_adv_36003_maya2017_linux_x64).

    If I start the vrayslave manually (sudo /usr/ChaosGroup/V-Ray/Maya2017-x64/bin/vrayslave) everything works (i.e., I can render on the machine and I see what's happening).

    However, if I run the vrayslave as a service (sudo service vraymayaslave2017 start), it doesn't. That's how the log looks after I try to render on the machine if the slave is running as a service (cat /tmp/vraymayaslave2017/stdout.txt):

    [2017/Dec/13|16:45:08] Reading configuration from "/usr/ChaosGroup/V-Ray/Maya2017-x64/bin//vrayconfig.xml"
    [2017/Dec/13|16:45:08] ===============================================
    [2017/Dec/13|16:45:08] V-Ray Standalone, version 3.60.04 for x64
    [2017/Dec/13|16:45:08] Copyright (C) 2000-2017 Chaos Group Ltd. All rights reserved.
    [2017/Dec/13|16:45:08] Use -credits option for additional third-party copyright notices.
    [2017/Dec/13|16:45:08]
    [2017/Dec/13|16:45:08] Build dd112739 from Dec 2 2017, 16:49:17
    [2017/Dec/13|16:45:08] Compiled with GCC-compatible compiler, version 4.4
    [2017/Dec/13|16:45:08] Operating system is Linux
    [2017/Dec/13|16:45:08]
    [2017/Dec/13|16:45:08] V-Ray core version is 3.60.04
    [2017/Dec/13|16:45:08] ===============================================
    [2017/Dec/13|16:45:08]
    [2017/Dec/13|16:45:21] Loading plugins from "/usr/ChaosGroup/V-Ray/Maya2017-x64/vrayplugins/libvray_*.so"
    [2017/Dec/13|16:45:21] 76 plugin(s) loaded successfully
    [2017/Dec/13|16:45:21] Finished loading plugins.
    [2017/Dec/13|16:45:21] Using folder "/tmp/vray_assets_cache" for caching assets for DR.
    [2017/Dec/13|16:45:21] Using file "/tmp/vray_assets_cache/cache_info_20207.txt" for storing assets cache information.
    [2017/Dec/13|16:45:21] Entering server mode - waiting for render requests on port 20207. Press Ctrl+C to exit.
    [2017/Dec/13|16:59:58]
    [2017/Dec/13|16:59:58] Starting DR session from 192.168.158.132
    [2017/Dec/13|16:59:58] Receiving DR scene from 192.168.158.132
    [2017/Dec/13|16:59:58] Reading scene file "/tmp/vrscene_20207_2085.txt"
    [2017/Dec/13|16:59:58] /tmp/vrscene_20207_2085.txt: done [ 0h 0m 0.0s]
    [2017/Dec/13|16:59:58] Scene file parsed successfully in 0.0 s.
    [2017/Dec/13|16:59:58] Scene created successfully.
    [2017/Dec/13|16:59:58] Objects in scene: 52
    [2017/Dec/13|16:59:58] Starting render sequence.
    [2017/Dec/13|16:59:58] Preparing renderer...
    [2017/Dec/13|16:59:58] error: Could not obtain a license (0): Unknown error: Please contact ChaosGroup support.
    [2017/Dec/13|16:59:58] Closing DR session from 192.168.158.132

    So it couln't obtain a license. What's awkward is that it does obtain it if I start the slave manually. Does anyone have an idea how to fix this? What's the difference between running it as a service or manually?


  • #2
    When setting the license settings are set in Unix based OS, they are set per user. If the service is running with another user - it will search for license settings in another location. By default, the license settings are stored in Linux in /home/"user name"/.ChaosGroup/vrlclient.xml - you can check if that file exists for the user and what are the file permissions - can it be read by the user running vraymayaslave2017.

    Also - TCP port 30304 should be allowed for incoming and outgoing communication both on the license server machine and the render slave since it's used by the license server to redistribute licenses.
    Attached Files
    Last edited by ivan.slavchev; 14-12-2017, 01:28 AM.
    Ivan Slavchev

    SysOps

    Chaos Group

    Comment


    • #3
      Thanks for the hint.

      I think the problem is because the user running vrayslave as service is different compared to running it manually (for the service it's root or alike). I'm not sure if this was caused by the first installation being made with "sudo vray_adv_36003_maya2017_linux_x64". The installation at that time worked, but registering as a service didn't (permissions). The second time I used first "sudo -s" and then "vray_adv_36003_maya2017_linux_x64". In this case it could register it as a service, but didn't work due to the license issue mentioned previously.

      Anyway - a workaround:

      In /etc/rc.local, add the following lines before the exit statement:

      EXPORTCOMMAND="export LD_LIBRARY_PATH='/usr/ChaosGroup/V-Ray/Maya2017-x64/lib/linux_x64/gcc-4.4':$LD_LIBRARY_PATH"
      USETHISUSER=myUserName
      PIDDIR=/home/${USETHISUSER}/vraylog
      DAEMON=/usr/ChaosGroup/V-Ray/Maya2017-x64/bin/vray.bin
      DAEMON_OPTS="-daemon -server -portNumber=20207 -logDir="$PIDDIR" -display=0"
      echo <password> | sudo -S -H -u ${USETHISUSER} bash -c "${EXPORTCOMMAND}; ${DAEMON} ${DAEMON_OPTS}"

      Like this, vrayslave runs as a daemon in the background just after startup (and before any user logs in). The downside is that one has to terminate it manually by finding the process id and killing it.

      Comment


      • #4
        It's OK if the workaround is working for you, but I'd still prefer just to set the license settings for the user running the service.
        You can also use VRAY_AUTH_CLIENT_FILE_PATH=full path of vrlclient.xml location (without the file name) if you want to have 1 file with license settings for all users, or just to store the license file on a custom location.
        Ivan Slavchev

        SysOps

        Chaos Group

        Comment

        Working...
        X