From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18796 invoked from network); 22 Jan 2021 08:01:26 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 22 Jan 2021 08:01:26 -0000 Received: (qmail 30541 invoked by uid 89); 22 Jan 2021 08:01:51 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 30534 invoked from network); 22 Jan 2021 08:01:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=mPF1jnL9m+/S6a07AOeP2Kqi3bh8/HyicQCXICj4XeE=; b=Ibn9c3iWNmQAolONcjH2/ZmfqIUR4t+nraOfYVcz9tGTeMrLjCC5lYm/JM57TzS+D2 +wPdcmj/3T83Utj+PEZ/W0dnikszAdaQwn8EYD+ewu1N+kjzKjmeHVFJGq6VL+xr8Syl 1cGrsvRn/XmOXtMRBo1hXgaam//04IphPZpcqUZw10Y4mN13d5Pojj0jWwH11ENbGh8r 0K8R67cnFC24GdhVlS4wMlDNpd8VkPCG16VXqpkOoPbHqWtVtvt+c+XJL0NnsVUkwnfE yaJ4nQMm3y1V/OcHfi/xJL5VJmGw5DGXgulgbwhZVCtTUpipOgrUOxAjJRpTS4Nanw9t 3WNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=mPF1jnL9m+/S6a07AOeP2Kqi3bh8/HyicQCXICj4XeE=; b=XCza575d7Poc9LRunIqQQW0bHf4LJgKpzdHbV+EDcXUr3dWe0GzvwrgDarEUhoBa6h rziMgFOZJDCf7Z+c2xjWhalTgWcuVxKnqHR6jCUBce18OzgPpocwlWWaiguNALudg2tL enlAqS94Ms0QhFHb9CVRxu7X2YBeNGGrUKH9tNitFyliv0xYZKX+Zrf345AizqiaHE+v 3Q1x427oZm/fXF/P62wJ8ZB3MEgGGb+chIC/5ILnQ/MTB9XfTsaVa4DRRAtA9erSt15E VqtsmlS1WAuYCyOrSs7xfjX6kE8sLTf8CzCcqafT1FWQz13y19hi5Mr5M2pbZ76QG2cA gXVw== X-Gm-Message-State: AOAM531i9O9unjwQiJxZ49bTxI24bVT+B8xFT9eOSSB+871lqhZywE3x FhhVVOQdLWhzmIdOZxvh/+FPR9b6VrieF6sh X-Google-Smtp-Source: ABdhPJw03B9PsXT48DoZNgsq02QFBO2GMig7IOnNuY3QT0ewHV7FYuB3SluPiWP5uugJ9fnWjCJEsQ== X-Received: by 2002:aa7:8d8b:0:b029:19e:1081:77af with SMTP id i11-20020aa78d8b0000b029019e108177afmr3625577pfr.78.1611302482756; Fri, 22 Jan 2021 00:01:22 -0800 (PST) To: supervision@list.skarnet.org From: Muhammad Mahendra Subrata Subject: The multisubstitute commands in the run script generated by s6-usertree-maker are in a wrong order Message-ID: <719f5399-2d05-d6d0-7377-e4014aab1ac1@gmail.com> Date: Fri, 22 Jan 2021 15:01:18 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Hello everyone, I'm using skalibs-2.10.0.0, execline-2.7.0.0, and s6-2.10.0.0 here in my system. I tried using the s6-usertree-maker with below invocation:     s6-usertree-maker -E /etc/user-env -e XDG_RUNTIME_DIR user /var/log/user-subtree /tmp/user-subtree Below is the generated run script:     #!/bin/execlineb -P     fdmove -c 2 1     emptyenv -p     export USER "user"     s6-envuidgid -i -- "user"     s6-applyuidgid -U --     backtick -in HOME { homeof "user" }     s6-envdir -i -- "/etc/user-env"     multisubstitute     {       importas -i USER USER       importas -i HOME HOME       importas -i UID UID       importas -i GID GID       importas -i GIDLIST GIDLIST     }     multisubstitute     {       importas -D "" -- "XDG_RUNTIME_DIR" "XDG_RUNTIME_DIR"     }     export "XDG_RUNTIME_DIR" ${"XDG_RUNTIME_DIR"}     export PATH "/usr/bin:/bin"     s6-svscan -d3 -- "${HOME}/service" As shown above, the multisubstitute command that contains XDG_RUNTIME_DIR is put after the one that contains USER, HOME, UID, GID, and GIDLIST. If for example XDG_RUNTIME_DIR=/run/user/$UID, the $UID here will not be substituted with the user's UID since by the time $UID is substituted, $XDG_RUNTIME_DIR hasn't been substituted yet. So perhaps the order of these two multisubstitute should be inverted. I was hit by this problem when trying to use it on my system, where I found XDG_DATA_HOME was still set to ${HOME}/.local/share (i.e. the ${HOME} was not substituted with the path to my home directory). Has anyone encountered this too? Or perhaps I'm just doing things incorrectly? Thanks!