artanis
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can /tmp/cache/route.cache and other tmp dirs be moved outside proje


From: Mortimer Cladwell
Subject: Re: Can /tmp/cache/route.cache and other tmp dirs be moved outside project directory?
Date: Sat, 27 Nov 2021 02:23:47 -0500

Thanks Nala,

>use (current-toplevel) to put it to somewhere inside the app
>folder. Say, "/opt/myapp/tmp/route.cache".

So in the case of Guix, won't myapp be trying to create a file like:

/gnu/store/......./myapp-0.1/tmp/route.cache?

In general if you are trying to "put it somewhere inside the app" and the app is in the store, you are trying to write and maybe delete in /gnu/store/... which is not allowed?

Would a solution be to place route.cache for myapp1 in /tmp/myapp1/tmp/route.cache
for myapp2 in /tmp/myapp2/tmp/route.cache

and so (current-toplevel) should be "/tmp/myapp" ?

Thanks
Mortimer



On Fri, Nov 26, 2021 at 1:43 PM Nala Ginrut <mulei@gnu.org> wrote:

Hi Mortimer!
First, let me explain the basic idea of (current-toplevel).

If your app folder is /opt/myapp, then the (current-toplevel) is
"/opt/myapp".

For something like route.cache, it's an "app constrained" file, so we
use (current-toplevel) to put it to somewhere inside the app
folder. Say, "/opt/myapp/tmp/route.cache".

If we put it to /tmp/, and if you have another Artanis app on the same
machine, it'll interfere. It's normal to exist many Artanis apps in the
same machine (VPS), you can use Nginx for reverse proxying the traffic to
these apps according to different domain name. And the apps should be
isolated safely in their folders.

Now let's back to the issue.
I think the problem is this line:
>            0 (delete-file "/gnu/store/3jbsa6x6wk8g3pzcz59v6abyh4ai8r?")
Usually Guix have a $HOME/.guix directory to put the mutable files.
Could you try to figure out the filename here?

Best regards.


Mortimer Cladwell writes:

> Hi Nala,
>
> I have an artanis project I am trying to run from guix's /gnu/store....
> I have encountered a problem where some methods e.g. (clean-stuffs) are
> trying to edit the store e.g.:
>
> ---------------ERROR----------------------------------------------------
> In artanis/commands/work.scm:
>     124:2  2 (init-work)
>     120:2  1 (clean-stuffs)
> In unknown file:
>            0 (delete-file "/gnu/store/3jbsa6x6wk8g3pzcz59v6abyh4ai8r?")
>
> ERROR: In procedure delete-file:
> In procedure delete-file: Read-only file system
> --------------END
> ERROR----------------------------------------------------------
>
> Problem is /gnu/store.... is read only.
> Any way to move the tmp directory outside of the store? I can envision an
> artanis.conf parameter "temp-dir" that redirects to e.g. /tmp/cache... or
> maybe $HOME/tmp/cache...
>
> Also something like modify
> (define route-cache (string-append (current-toplevel)
> "/tmp/cache/route.cache"))
> to
> (define route-cache  "/tmp/cache/route.cache")
>
> Looking for some input as to where the changes need to be e.g. is it safe
> to globally modify current-toplevel e.g. current-toplevel == "" or
> current-toplevel == $HOME?
> Has anyone had success running an artanis project from /gnu/store...?
> Thanks
> Mortimer


--
GNU Powered it
GPL Protected it
GOD Blessed it
HFG - NalaGinrut
Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058

reply via email to

[Prev in Thread] Current Thread [Next in Thread]