Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

dist: add rkt tmpfiles #2088

Merged
merged 3 commits into from Feb 3, 2016
Merged

dist: add rkt tmpfiles #2088

merged 3 commits into from Feb 3, 2016

Conversation

iaguis
Copy link
Member

@iaguis iaguis commented Feb 3, 2016

Fixes #2082

@krnowak
Copy link
Collaborator

krnowak commented Feb 3, 2016

A paragraph in "Note for packagers" in changelog would be nice.

@iaguis
Copy link
Member Author

iaguis commented Feb 3, 2016

Sure, I'm still playing with this and testing

@iaguis
Copy link
Member Author

iaguis commented Feb 3, 2016

Ready for review.

d /var/lib/rkt/pods/prepared 2750 root rkt
d /var/lib/rkt/pods/run 2750 root rkt
d /var/lib/rkt/pods/exited-garbage 2750 root rkt
d /var/lib/rkt/pods/garbage 2750 root rkt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@iaguis iaguis force-pushed the iaguis/tmpfiles branch 5 times, most recently from a635a25 to ba170a7 Compare February 3, 2016 15:26
@jonboulle
Copy link
Contributor

LGTM, any example of it working + being equivalent to rkt install?

@iaguis
Copy link
Member Author

iaguis commented Feb 3, 2016

Checking that uncovered a bug :)

@iaguis
Copy link
Member Author

iaguis commented Feb 3, 2016

> pwd
/home/iaguis/work/coreos/go/src/github.com/coreos/rkt
> sudo cp dist/init/systemd/tmpfiles.d/rkt.conf /etc/tmpfiles.d/
> sudo rm -rf /var/lib/rkt
> sudo rm -rf /var/lib/rkt-install
> sudo rkt install && sudo mv /var/lib/rkt /var/lib/rkt-install && sudo systemd-tmpfiles --create rkt.conf
install: rkt directory structure successfully created.
> cd /var/lib
> sudo ls -lR rkt > /tmp/rkt-tmpfiles
> cat /tmp/rkt-tmpfiles
rkt:
total 16
drwxrws--- 9 root rkt 4096 Feb  3 16:45 cas
drwxr-s--- 2 root rkt 4096 Feb  3 16:45 locks
drwxr-s--- 8 root rkt 4096 Feb  3 16:45 pods
drwxr-s--- 2 root rkt 4096 Feb  3 16:45 tmp

rkt/cas:
total 28
drwxrws--- 2 root rkt 4096 Feb  3 16:45 blob
drwxrws--- 2 root rkt 4096 Feb  3 16:45 db
drwxrws--- 2 root rkt 4096 Feb  3 16:45 imagelocks
drwxrws--- 2 root rkt 4096 Feb  3 16:45 imageManifest
drwxrws--- 2 root rkt 4096 Feb  3 16:45 tmp
drwx--S--- 2 root rkt 4096 Feb  3 16:45 tree
drwx--S--- 2 root rkt 4096 Feb  3 16:45 treestorelocks

rkt/cas/blob:
total 0

rkt/cas/db:
total 0
-rw-rw---- 1 root rkt 0 Feb  3 16:45 ql.db

rkt/cas/imagelocks:
total 0

rkt/cas/imageManifest:
total 0

rkt/cas/tmp:
total 0

rkt/cas/tree:
total 0

rkt/cas/treestorelocks:
total 0

rkt/locks:
total 0

rkt/pods:
total 24
drwxr-s--- 2 root rkt 4096 Feb  3 16:45 embryo
drwxr-s--- 2 root rkt 4096 Feb  3 16:45 exited-garbage
drwxr-s--- 2 root rkt 4096 Feb  3 16:45 garbage
drwxr-s--- 2 root rkt 4096 Feb  3 16:45 prepare
drwxr-s--- 2 root rkt 4096 Feb  3 16:45 prepared
drwxr-s--- 2 root rkt 4096 Feb  3 16:45 run

rkt/pods/embryo:
total 0

rkt/pods/exited-garbage:
total 0

rkt/pods/garbage:
total 0

rkt/pods/prepare:
total 0

rkt/pods/prepared:
total 0

rkt/pods/run:
total 0

rkt/tmp:
total 0
> sudo ls -lR rkt-install > /tmp/rkt-install
rkt-install:
total 16
drwxrws--- 9 root rkt 4096 Feb  3 16:49 cas
drwxr-s--- 2 root rkt 4096 Feb  3 16:49 locks
drwxr-s--- 8 root rkt 4096 Feb  3 16:49 pods
drwxr-s--- 2 root rkt 4096 Feb  3 16:49 tmp

rkt-install/cas:
total 28
drwxrws--- 2 root rkt 4096 Feb  3 16:49 blob
drwxrws--- 2 root rkt 4096 Feb  3 16:49 db
drwxrws--- 2 root rkt 4096 Feb  3 16:49 imagelocks
drwxrws--- 2 root rkt 4096 Feb  3 16:49 imageManifest
drwxrws--- 2 root rkt 4096 Feb  3 16:49 tmp
drwx--S--- 2 root rkt 4096 Feb  3 16:49 tree
drwx--S--- 2 root rkt 4096 Feb  3 16:49 treestorelocks

rkt-install/cas/blob:
total 0

rkt-install/cas/db:
total 0
-rw-rw---- 1 root rkt 0 Feb  3 16:49 ql.db

rkt-install/cas/imagelocks:
total 0

rkt-install/cas/imageManifest:
total 0

rkt-install/cas/tmp:
total 0

rkt-install/cas/tree:
total 0

rkt-install/cas/treestorelocks:
total 0

rkt-install/locks:
total 0

rkt-install/pods:
total 24
drwxr-s--- 2 root rkt 4096 Feb  3 16:49 embryo
drwxr-s--- 2 root rkt 4096 Feb  3 16:49 exited-garbage
drwxr-s--- 2 root rkt 4096 Feb  3 16:49 garbage
drwxr-s--- 2 root rkt 4096 Feb  3 16:49 prepare
drwxr-s--- 2 root rkt 4096 Feb  3 16:49 prepared
drwxr-s--- 2 root rkt 4096 Feb  3 16:49 run

rkt-install/pods/embryo:
total 0

rkt-install/pods/exited-garbage:
total 0

rkt-install/pods/garbage:
total 0

rkt-install/pods/prepare:
total 0

rkt-install/pods/prepared:
total 0

rkt-install/pods/run:
total 0

rkt-install/tmp:
total 0
> sed -i 's/rkt-install/rkt/g' /tmp/rkt-install
> diff /tmp/rkt-tmpfiles /tmp/rkt-install
> echo $?
0

@krnowak
Copy link
Collaborator

krnowak commented Feb 3, 2016

Seems to be working, LGTM.

@iaguis
Copy link
Member Author

iaguis commented Feb 3, 2016

Semaphore is running because I changed a comment in a go file. We can merge it without waiting.

iaguis added a commit that referenced this pull request Feb 3, 2016
@iaguis iaguis merged commit 09adfd7 into rkt:master Feb 3, 2016
@iaguis
Copy link
Member Author

iaguis commented Feb 3, 2016

Now that I think of it, this would only work if rkt's data path is /var/lib/rkt.

We could make it generic by removing the /var/lib/ prefix and then asking the users to run systemd-tmpfiles --root=/var/lib --create rkt.conf.

@jonboulle
Copy link
Contributor

Ruh roh. Let's do that?

On Wed, Feb 3, 2016 at 5:04 PM, Iago López Galeiras <
notifications@github.com> wrote:

Now that I think of it, this would only work if rkt's data path is
`/var/lib/rkt.

We could make it generic by removing the /var/lib/ prefix and then asking
the users to run systemd-tmpfiles --root=/var/lib --create rkt.conf.


Reply to this email directly or view it on GitHub
#2088 (comment).

@iaguis
Copy link
Member Author

iaguis commented Feb 3, 2016

It's a bit more annoying:

--root=root
   Takes a directory path as an argument. All paths will be prefixed with the given alternate root
   path, **including config search paths.**

So the user would have to refer to the absolute path of rkt.conf:

systemd-tmpfiles --root=/var/lib --create /etc/tmpfiles.d/rkt.conf

Also, that wouldn't work on boot time because it will try to create /rkt/cas etc.

@iaguis
Copy link
Member Author

iaguis commented Feb 3, 2016

I guess distros would have to modify this file to match their location of rkt's data directory...

@alban
Copy link
Member

alban commented Feb 3, 2016

Distros know how to carry patches if they want to use another directory than /var/lib/.

@iaguis
Copy link
Member Author

iaguis commented Feb 3, 2016

Smart distros

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants