[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qubes-users
Subject:    Re: [qubes-users] Where to configure target dir of `qvm-move`/`qvm-copy` (`/home/user/QubesIncomming
From:       "'Johannes Graumann' via qubes-users" <qubes-users () googlegroups ! com>
Date:       2022-04-13 13:16:18
Message-ID: 5eb5fde15cdb7b2923dcf6012a356ad7024db543.camel () graumannschaft ! org
[Download RAW message or body]

On Tue, 2022-04-12 at 15:10 +0200, Johannes Graumann wrote:
> On Fri, 2022-04-08 at 04:45 +0200, airelemental via qubes-users
> wrote:
> > 
> > 
> > > See subject line - I'd like to remap the `/home/user` bit to
> > > `/tmp`
> > > to
> > > enforce cleanup ...
> > > 
> > > Thanks for any pointers.
> > > 
> > > Joh
> > > 
> > In /rw/config/rc.local, you can create /tmp/QubesIncoming. Then
> > replace ~/QubesIncoming with a symlink to /tmp/QubesIncoming
> > 
> 
> Good strategy, I'll try that. Thank you.

This *.sls works nicely:

```
configure `rc.local` to remove any present `QubesIncoming`:
  file.replace:
    - name: /rw/config/rc.local
    - pattern: '^rm -rf /home/user/QubesIncoming$'
    - repl: 'rm -rf /home/user/QubesIncoming'
    - append_if_not_found: True 

configure `rc.local` to create `/tmp/QubesIncoming`:
  file.replace:
    - name: /rw/config/rc.local
    - pattern: '^install -d -o user -g user -m 770 /tmp/QubesIncoming$'
    - repl: 'install -d -o user -g user -m 770 /tmp/QubesIncoming'
    - append_if_not_found: True 

configure `rc.local` to link `/tmp/QubesIncoming` to $HOME:
  file.replace:
    - name: /rw/config/rc.local
    - pattern: '^ln -s /tmp/QubesIncoming /home/user/QubesIncoming$'
    - repl: 'ln -s /tmp/QubesIncoming /home/user/QubesIncoming'
    - append_if_not_found: True 

configure `rc.local` to properly chown the link:
  file.replace:
    - name: /rw/config/rc.local
    - pattern: '^chown -h user:user /home/user/QubesIncoming$'
    - repl: 'chown -h user:user /home/user/QubesIncoming'
    - append_if_not_found: True 
```

It generates this code block in `/rw/config/rc.local`:

```
rm -rf /home/user/QubesIncoming
install -d -o user -g user -m 770 /tmp/QubesIncoming
ln -s /tmp/QubesIncoming /home/user/QubesIncoming
chown -h user:user /home/user/QubesIncoming
```

-- 
You received this message because you are subscribed to the Google Groups \
"qubes-users" group. To unsubscribe from this group and stop receiving emails from \
it, send an email to qubes-users+unsubscribe@googlegroups.com. To view this \
discussion on the web visit \
https://groups.google.com/d/msgid/qubes-users/5eb5fde15cdb7b2923dcf6012a356ad7024db543.camel%40graumannschaft.org.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic