* profile symlink structure [not found] <981904032.4122292.1590333823170.ref@mail.yahoo.com> @ 2020-05-24 15:23 ` vapnik spaknik 2020-05-25 8:03 ` Pierre Neidhardt 0 siblings, 1 reply; 5+ messages in thread From: vapnik spaknik @ 2020-05-24 15:23 UTC (permalink / raw) To: help-guix Hi, please could someone help me understand how guix organizes profile symlinks? I can't find a full explanation anywhere. So far I have figured out the following on my foreign distro: - original profile directories are named like: /gnu/store/<UID>-profile - /var/guix/profiles/per-user/<USR>/ contains symlinks to the profiles in /gnu/store associated with user <USR> - symlinks in /var/guix/profiles/per-user/<USR>/ seem to take one of the following forms: current-guix current-guix-<N>-link guix-profile guix-profile-<N>-link the ones with a number <N> in their name refer to the <N>th generation of a profile with the same name apart from the <N>-link part. - "guix-profile" is a symlink to the currently used generation for the profile used by "guix package" for the user - "current-guix" is a symlink to the currently used generation for the profile used by "guix pull" for the user - ~/.guix-profile is a symlink to the current profile used by "guix package", i.e. /var/guix/profiles/per-user/<USR>/guix-profile - ~/.config/guix/current is a symlink to the profile used by "guix pull" Now this is where I'm confused.. I was expecting ~/.config/guix/current to link to /var/guix/profiles/per-user/<USR>/current-guix where <USR> is the current user. However, in my case it links to /var/guix/profiles/per-user/root/current-guix, i.e. the profile for the root user, even though there are several "current-guix" symlinks for <USR>, i.e. links of the form /var/guix/profiles/per-user/<USR>/current-guix*. Could this be due to running "sudo guix pull" or "sudo -i guix pull"? Also, what determines which profile symlinks are placed in /var/guix/gcroots/auto? I read elsewhere that these symlinks will be automatically removed as soon as any of them are broken. In my case that directory only contains symlinks to /var/guix/profiles/per-user/*/current-guix* symlinks, one of which is missing (/var/guix/profiles/per-user/root/current-guix-1-link), and there is another link to ~/.config/guix/current-1-link which itself links directly to a profile in /gnu/store I suspect that the previously mentioned anomalies are the reason why "guix pull" fails for me with the following error when run as <USR>: > guix pull: error: symlink: File exists: "/var/guix/profiles/per-user/<USR>/current-guix-1-link" and which may have been caused by interrupting a "guix pull". I guess I can probably fix that problem by deleting current-guix-1-link, but I would really like to know how the symlinking works exactly, so that I'm prepared for potential future problems of this kind. Thankyou, Joe Bloggs ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: profile symlink structure 2020-05-24 15:23 ` profile symlink structure vapnik spaknik @ 2020-05-25 8:03 ` Pierre Neidhardt 2020-05-25 17:14 ` vapnik spaknik via 2020-05-25 22:04 ` vapnik spaknik via 0 siblings, 2 replies; 5+ messages in thread From: Pierre Neidhardt @ 2020-05-25 8:03 UTC (permalink / raw) To: vapnik spaknik, help-guix [-- Attachment #1: Type: text/plain, Size: 1299 bytes --] vapnik spaknik <vapniks@yahoo.com> writes: > Could this be due to running "sudo guix pull" or "sudo -i guix pull"? Did you run `sudo guix pull`? If so, you should probably not! :) > Also, what determines which profile symlinks are placed in /var/guix/gcroots/auto? I read elsewhere that these symlinks will be automatically removed as soon as any of them are broken. See my other email. `guix package --profile=...` is one of the commands that creates auto GC roots. > In my case that directory only contains symlinks to /var/guix/profiles/per-user/*/current-guix* symlinks, one of which is missing (/var/guix/profiles/per-user/root/current-guix-1-link), and there is another link to ~/.config/guix/current-1-link which itself links directly to a profile in /gnu/store > > I suspect that the previously mentioned anomalies are the reason why "guix pull" fails for me with the following error when run as <USR>: > >> guix pull: error: symlink: File exists: "/var/guix/profiles/per-user/<USR>/current-guix-1-link" > > and which may have been caused by interrupting a "guix pull". The symlinking operations should be atomic, thus this can not happen. I suspect that your error is due to calling `sudo guix pull`. Cheers! -- Pierre Neidhardt https://ambrevar.xyz/ [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 487 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: profile symlink structure 2020-05-25 8:03 ` Pierre Neidhardt @ 2020-05-25 17:14 ` vapnik spaknik via 2020-05-26 7:22 ` Pierre Neidhardt 2020-05-25 22:04 ` vapnik spaknik via 1 sibling, 1 reply; 5+ messages in thread From: vapnik spaknik via @ 2020-05-25 17:14 UTC (permalink / raw) To: help-guix, Pierre Neidhardt > On Monday, May 25, 2020, 09:03:44 AM GMT+1, Pierre Neidhardt <mail@ambrevar.xyz> wrote: > vapnik spaknik <vapniks@yahoo.com> writes: >> In my case that directory only contains symlinks to /var/guix/profiles/per-user/*/current-guix* symlinks, one of which is missing (/var/guix/profiles/per-user/root/current-guix-1-link), and there is another link to ~/.config/guix/current-1-link which itself links directly to a profile in /gnu/store >> >> I suspect that the previously mentioned anomalies are the reason why "guix pull" fails for me with the following error when run as <USR>: >> >>> guix pull: error: symlink: File exists: "/var/guix/profiles/per-user/<USR>/current-guix-1-link" >> >> and which may have been caused by interrupting a "guix pull". > > The symlinking operations should be atomic, thus this can not happen. > I suspect that your error is due to calling `sudo guix pull`. OK, so I checked the manual again, and found out that I'm supposed to run `sudo -i guix pull`, not `sudo guix pull` or `guix pull`. I've was trying both of the latter two commands which would explain the unnecessary /var/guix/profiles/per-user/ben/current-guix* symlinks (due to `guix pull`) and /root/.config/guix/* symlinks (due to `sudo guix pull`). Running `sudo -i guix pull` it seems to work. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: profile symlink structure 2020-05-25 17:14 ` vapnik spaknik via @ 2020-05-26 7:22 ` Pierre Neidhardt 0 siblings, 0 replies; 5+ messages in thread From: Pierre Neidhardt @ 2020-05-26 7:22 UTC (permalink / raw) To: vapnik spaknik, help-guix [-- Attachment #1: Type: text/plain, Size: 558 bytes --] vapnik spaknik <vapniks@yahoo.com> writes: > OK, so I checked the manual again, and found out that I'm supposed to > run `sudo -i guix pull`, not `sudo guix pull` or `guix pull`. I've was > trying both of the latter two commands which would explain the > unnecessary /var/guix/profiles/per-user/ben/current-guix* symlinks > (due to `guix pull`) and /root/.config/guix/* symlinks (due to `sudo > guix pull`). Only on a foreign distribution. On Guix System, `guix pull' (without sudo) is enough. -- Pierre Neidhardt https://ambrevar.xyz/ [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 487 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: profile symlink structure 2020-05-25 8:03 ` Pierre Neidhardt 2020-05-25 17:14 ` vapnik spaknik via @ 2020-05-25 22:04 ` vapnik spaknik via 1 sibling, 0 replies; 5+ messages in thread From: vapnik spaknik via @ 2020-05-25 22:04 UTC (permalink / raw) To: help-guix, Pierre Neidhardt > On Monday, May 25, 2020, 09:03:44 AM GMT+1, Pierre Neidhardt <mail@ambrevar.xyz> wrote: > The symlinking operations should be atomic, thus this can not happen. > I suspect that your error is due to calling `sudo guix pull`. > Cheers! Another question; what is the purpose of the *.lock files in the symlink directories exactly, and how are they used? I guess it has something to do with atomic transactions, but the .lock files appear to be untouched after several updates as the modification times are unchanged. -- ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-05-26 7:22 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <981904032.4122292.1590333823170.ref@mail.yahoo.com> 2020-05-24 15:23 ` profile symlink structure vapnik spaknik 2020-05-25 8:03 ` Pierre Neidhardt 2020-05-25 17:14 ` vapnik spaknik via 2020-05-26 7:22 ` Pierre Neidhardt 2020-05-25 22:04 ` vapnik spaknik via
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).