From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brice Waegeneire Subject: Re: native-search-paths and shepherd services (help wanted) Date: Sat, 08 Feb 2020 10:28:51 +0000 Message-ID: <28115b77287fbf2a07036fa50a811971@waegenei.re> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_a22065d2648e838e0950579dfbf16a85" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:42551) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0NMD-0003dX-7e for guix-devel@gnu.org; Sat, 08 Feb 2020 05:29:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j0NMB-0005mQ-Kj for guix-devel@gnu.org; Sat, 08 Feb 2020 05:29:01 -0500 In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: Jonathan Frederickson Cc: guix-devel@gnu.org, Guix-devel --=_a22065d2648e838e0950579dfbf16a85 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 2020-02-08 09:06, Jonathan Frederickson wrote: > Hi - I'm working on a Guix service for Minetest, and I'm running into > some issues. The Guix package for Minetest is divided into two > variables: "minetest" and "minetest-data", with only the former being > an installable package. The Minetest package uses native-search-paths > to allow Minetest to find additional available games > (MINETEST_SUBGAME_PATH), *including* minetest_game which is > effectively the default. > > This is all well and good when you're installing Minetest as a package > and running it manually, but I'd like to do this with a Guix service > instead. Problem is... the native-search-paths don't seem to affect > the environment variables set when I run Minetest through Shepherd. > I'm checking my env vars by running Minetest through strace in the > shepherd service at the moment: > > (start #~(make-forkexec-constructor > (list #$(file-append strace "/bin/strace") "-s1024" > "-vfe" "trace=execve" #$(file-append package "/bin/minetest") > "--server" "testworld" > "--map-dir" #$map-dir) > #:user "minetest" > #:group "minetest")) > > (I've attached my current services/games.scm for reference.) > > Is there a way for me to use the native-search-paths from the > installed Minetest package when starting it through Shepherd? I think I got it working, I managed to log and "play" on the server. You were really close to have a working service for minetest though. You were only missing the environment variable MINETEST_SUBGAME_PATH and *maybe* your profile-service-type extension was wrong (I just blandly copied how it was done for SDDM). I have attached your games.scm with the added fixes. --=_a22065d2648e838e0950579dfbf16a85 Content-Transfer-Encoding: base64 Content-Type: text/plain; name=games.scm Content-Disposition: attachment; filename=games.scm; size=5547 Ozs7IEdOVSBHdWl4IC0tLSBGdW5jdGlvbmFsIHBhY2thZ2UgbWFuYWdlbWVudCBmb3IgR05VCjs7 OyBDb3B5cmlnaHQgwqkgMjAxOCBBcnVuIElzYWFjIDxhcnVuaXNhYWNAc3lzdGVtcmVib290Lm5l dD4KOzs7Cjs7OyBUaGlzIGZpbGUgaXMgcGFydCBvZiBHTlUgR3VpeC4KOzs7Cjs7OyBHTlUgR3Vp eCBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5 IGl0Cjs7OyB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNl IGFzIHB1Ymxpc2hlZCBieQo7OzsgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVy IHZlcnNpb24gMyBvZiB0aGUgTGljZW5zZSwgb3IgKGF0Cjs7OyB5b3VyIG9wdGlvbikgYW55IGxh dGVyIHZlcnNpb24uCjs7Owo7OzsgR05VIEd1aXggaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUg dGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwgYnV0Cjs7OyBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0 aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mCjs7OyBNRVJDSEFOVEFCSUxJVFkgb3Ig RklUTkVTUyBGT1IgQSBQ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AgICAoc2hlcGhl cmQtc2VydmljZQogICAgICAgIChkb2N1bWVudGF0aW9uICJUaGUgQmF0dGxlIGZvciBXZXNub3Ro IHNlcnZlciIpCiAgICAgICAgKHByb3Zpc2lvbgogICAgICAgICAnKHdlc25vdGgtZGFlbW9uKSkK ICAgICAgICAocmVxdWlyZW1lbnQKICAgICAgICAgJyhuZXR3b3JraW5nKSkKICAgICAgICAobW9k dWxlcwogICAgICAgICAnKChnbnUgYnVpbGQgc2hlcGhlcmQpKSkKICAgICAgICAoc3RhcnQgI34o bWFrZS1mb3JrZXhlYy1jb25zdHJ1Y3Rvci9jb250YWluZXIKICAgICAgICAgICAgICAgICAgKGxp c3QgIyQoZmlsZS1hcHBlbmQgcGFja2FnZSAiL2Jpbi93ZXNub3RoZCIpCiAgICAgICAgICAgICAg ICAgICAgICAgICItcCIgIyQobnVtYmVyLT5zdHJpbmcgcG9ydCkpCiAgICAgICAgICAgICAgICAg ICM6dXNlciAid2Vzbm90aGQiICM6Z3JvdXAgIndlc25vdGhkIikpCiAgICAgICAgKHN0b3AgI34o bWFrZS1raWxsLWRlc3RydWN0b3IpKSkpKSkpCgooZGVmaW5lIHdlc25vdGhkLXNlcnZpY2UtdHlw ZQogIChzZXJ2aWNlLXR5cGUKICAgKG5hbWUgJ3dlc25vdGhkKQogICAoZGVzY3JpcHRpb24KICAg ICJSdW4gVGhlIEJhdHRsZSBmb3IgV2Vzbm90aCBzZXJ2ZXIgQGNvbW1hbmR7d2Vzbm90aGR9LiIp CiAgIChleHRlbnNpb25zCiAgICAobGlzdAogICAgIChzZXJ2aWNlLWV4dGVuc2lvbiBhY2NvdW50 LXNlcnZpY2UtdHlwZQogICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgJXdlc25vdGhkLWFj Y291bnRzKSkKICAgICAoc2VydmljZS1leHRlbnNpb24gc2hlcGhlcmQtcm9vdC1zZXJ2aWNlLXR5 cGUKICAgICAgICAgICAgICAgICAgICAgICAgKGNvbXBvc2UgbGlzd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v cnQgbWFwLWRpcikKICAgICAoc2hlcGhlcmQtc2VydmljZQogICAgICAoZG9jdW1lbnRhdGlvbiAi TWluZXRlc3Qgc2VydmVyLiIpCiAgICAgIChyZXF1aXJlbWVudCAnKG5ldHdvcmtpbmcpKQogICAg ICAocHJvdmlzaW9uICcobWluZXRlc3QpKQogICAgICAoc3RhcnQgI34obWFrZS1mb3JrZXhlYy1j b25zdHJ1Y3RvcgogICAgICAgICAgICAgICAgKGxpc3QgIyQoZmlsZS1hcHBlbmQgcGFja2FnZSAi L2Jpbi9taW5ldGVzdCIpCiAgICAgICAgICAgICAgICAgICAgICItLXNlcnZlciIgInRlc3R3b3Js ZCIKICAgICAgICAgICAgICAgICAgICAgIi0tbWFwLWRpciIgIyRtYXAtZGlyKQogICAgICAgICAg ICAgICAgOzsgKGxpc3QgIyQoZmlsZS1hcHBlbmQgc3RyYWNlICIvYmluL3N0cmFjZSIpICItczEw MjQiICItdmZlIiAidHJhY2U9ZXhlY3ZlIiAjJChmaWxlLWFwcGVuZCBwYWNrYWdlICIvYmluL21p bmV0ZXN0IikKICAgICAgICAgICAgICAgIDs7ICAgICAgICItLXNlcnZlciIgInRlc3R3b3JsZCIK ICAgICAgICAgICAgICAgIDs7ICAgICAgICItLW1hcC1kaXIiICMkbWFwLWRpcikKICAgICAgICAg ICAgICAgICM6dXNlciAibWluZXRlc3QiCiAgICAgICAgICAgICAgICAjOmdyb3VwICJtaW5ldGVz dCI7OyApKQogICAgICAgICAgICAgICAgIzplbnZpcm9ubWVudC12YXJpYWJsZXMKICAgICAgICAg ICAgICAgICcoIkhPTUU9L3Zhci9taW5ldGVzdCIKICAgICAgICAgICAgICAgICAgIk1JTkVURVNU X1NVQkdBTUVfUEFUSD0vcnVuL2N1cnJlbnQtc3lzdGVtL3Byb2ZpbGUvc2hhcmUvbWluZXRlc3Qv Z2FtZXMiKSkpCiAgICAgIChzdG9wICN+KG1ha2Uta2lsbC1kZXN0cnVjdG9yKSkpKSkpCgooZGVm aW5lIG1pbmV0ZXN0LXByb2ZpbGUtc2VydmljZQogIChjb21wb3NlIGxpc3QgbWluZXRlc3QtY29u ZmlndXJhdGlvbi1wYWNrYWdlKSkKCihkZWZpbmUgbWluZXRlc3Qtc2VydmljZS10eXBlCiAgKHNl cnZpY2UtdHlwZQogICAobmFtZSAnbWluZXRlc3QpCiAgIChkZXNjcmlwdGlvbgogICAgIlJ1biB0 aGUgTWluZXRlc3Qgc2VydmVyIEBjb21tYW5ke21pbmV0ZXN0fS4iKQogICAoZXh0ZW5zaW9ucwog ICAgKGxpc3QgKHNlcnZpY2UtZXh0ZW5zaW9uIGFjY291bnQtc2VydmljZS10eXBlCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKGNvbnN0ICVtaW5ldGVzdC1hY2NvdW50cykpCiAgICAgICAg ICAoc2VydmljZS1leHRlbnNpb24gcHJvZmlsZS1zZXJ2aWNlLXR5cGUKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBtaW5ldGVzdC1wcm9maWxlLXNlcnZpY2UKICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA7OyAobGFtYmRhIChjb25maWcpCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOzsgICAobGlzdCAobWluZXRlc3QtY29uZmlndXJhdGlvbi1wYWNrYWdlCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOzsgICAgICAgICAgY29uZmlnKSkpCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKQogICAgICAgICAgKHNlcnZpY2UtZXh0ZW5zaW9uIHNoZXBoZXJkLXJvb3Qt c2VydmljZS10eXBlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbXBvc2UgbGlzdCBt aW5ldGVzdC1zaGVwaGVyZC1zZXJ2aWNlKSkpKQogICAoZGVmYXVsdC12YWx1ZSAobWluZXRlc3Qt Y29uZmlndXJhdGlvbikpKSkK --=_a22065d2648e838e0950579dfbf16a85--