Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override replace with systemd - missing unit files #1340

Closed
dustymabe opened this issue Apr 19, 2018 · 4 comments
Closed

override replace with systemd - missing unit files #1340

dustymabe opened this issue Apr 19, 2018 · 4 comments
Assignees
Labels
bug jira for syncing to jira

Comments

@dustymabe
Copy link
Member

This was found when trying to test bug1568594

f28AH: ostree-2018.3-2.fc28.x86_64, rpm-ostree-2018.4-1.fc28.x86_64

override replacing systemd seems to yield a broken system with missing systemd unit files.

Here are some steps to repro:

[root@vanilla-f28-atomic ~]# for f in https://kojipkgs.fedoraproject.org//work/tasks/6414/26446414/systemd-{,container-,pam-,libs-,udev-}238-7.fc28.1.x86_64.rpm; do curl -L -O $f; done                          
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                                                                                                                   
                                 Dload  Upload   Total   Spent    Left  Speed                                                                                                                                     
100 3732k  100 3732k    0     0  4184k      0 --:--:-- --:--:-- --:--:-- 4180k                                                                                                                                    
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                                                                                                                   
                                 Dload  Upload   Total   Spent    Left  Speed                                                                                                                                     
100  459k  100  459k    0     0   804k      0 --:--:-- --:--:-- --:--:--  804k                                                                                                                                    
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                                                                                                                   
                                 Dload  Upload   Total   Spent    Left  Speed                                                                                                                                     
100  203k  100  203k    0     0   391k      0 --:--:-- --:--:-- --:--:--  390k                                                                                                                                    
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                                                                                                                   
                                 Dload  Upload   Total   Spent    Left  Speed                                                                                                                                     
100  506k  100  506k    0     0   858k      0 --:--:-- --:--:-- --:--:--  856k                                                                                                                                    
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                                                                                                                   
                                 Dload  Upload   Total   Spent    Left  Speed                                                                                                                                     
100 1312k  100 1312k    0     0  1991k      0 --:--:-- --:--:-- --:--:-- 1991k                                                                                                                                    
[root@vanilla-f28-atomic ~]#                                                                                                                                                                                      
[root@vanilla-f28-atomic ~]# rpm-ostree override replace ./systemd-*rpm
Checking out tree 37ea5be... done
Enabled rpm-md repositories: updates-testing updates fedora

Updating metadata for 'updates-testing': [=============] 100%
rpm-md repo 'updates-testing'; generated: 2018-04-19 08:42:46

Updating metadata for 'updates': [=============] 100%
rpm-md repo 'updates'; generated: 2018-02-20 19:18:14

Updating metadata for 'fedora': [=============] 100%
rpm-md repo 'fedora'; generated: 2018-04-18 11:14:02

Importing metadata [=============] 100%
Resolving dependencies... done
Applying 5 overrides

Building filesystem (10/10) [=============] 100%
Running pre scripts... 1 done
Running post scripts... 12 done
Writing rpmdb... done
Writing OSTree commit... done
Copying /etc changes: 21 modified, 0 removed, 52 added
Transaction complete; bootconfig swap: yes deployment count change: 1
Upgraded:
  systemd 238-7.fc28 -> 238-7.fc28.1
  systemd-container 238-7.fc28 -> 238-7.fc28.1
  systemd-libs 238-7.fc28 -> 238-7.fc28.1
  systemd-pam 238-7.fc28 -> 238-7.fc28.1
  systemd-udev 238-7.fc28 -> 238-7.fc28.1
Run "systemctl reboot" to start a reboot
[root@vanilla-f28-atomic ~]# rpm-ostree status      
State: idle; auto updates disabled
Deployments:
  ostree://fedora-atomic:fedora/28/x86_64/atomic-host
                   Version: 28.20180417.n.0 (2018-04-17 12:18:44)
                BaseCommit: 37ea5be68b2e894d9d8b589f568ae421fd241fabd01bb6bccb7d01ccd5ac6631
              GPGSignature: Valid signature by 128CF232A9371991C8A65695E08E7E629DB62FB1
      ReplacedBasePackages: systemd-container systemd-udev systemd-libs systemd systemd-pam 238-7.fc28 -> 238-7.fc28.1

● ostree://fedora-atomic:fedora/28/x86_64/atomic-host
                   Version: 28.20180417.n.0 (2018-04-17 12:18:44)
                    Commit: 37ea5be68b2e894d9d8b589f568ae421fd241fabd01bb6bccb7d01ccd5ac6631
              GPGSignature: Valid signature by 128CF232A9371991C8A65695E08E7E629DB62FB1

and before reboot we see:

[root@vanilla-f28-atomic ~]# ls /usr/lib/systemd/system/ | grep ostree                                                                                                                                            
ostree-prepare-root.service                         
ostree-remount.service                              
rpm-ostreed-automatic.service                       
rpm-ostreed-automatic.timer                         
rpm-ostreed.service

after reboot we see:

[root@vanilla-f28-atomic /]# ls /usr/lib/systemd/system/ | grep ostree
[root@vanilla-f28-atomic /]#
@jlebon jlebon added the bug label Apr 19, 2018
@keszybz
Copy link
Contributor

keszybz commented Apr 19, 2018

In general there's just files from the newly installed rpms in /usr/lib/systemd/system/, everything else is gone.

@jlebon
Copy link
Member

jlebon commented Apr 19, 2018

Hmm, yeah override replace systemd is a good litmus test. We made it a bit smarter in #1227, but looks like it might need to be smarter still.

@jlebon jlebon self-assigned this Apr 19, 2018
@jlebon jlebon added the jira for syncing to jira label Apr 19, 2018
cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue Apr 19, 2018
@cgwalters
Copy link
Member

Sorry I should have looked earlier at this that @jlebon took it - filing my PR here now so we hopefully avoid duplicated work: #1341

@jlebon
Copy link
Member

jlebon commented Apr 20, 2018

No worries, I hadn't started looking into it in earnest yet.

cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue Apr 20, 2018
It's very normal for base packages to own directories with
dependent packages installing files there.  Doing an rm-rf
for directories was just wrong.  Concretely this fixes
an `override replace ./systemd-*.rpm`.

librpm is also pretty conservative here (for good reason)
and just ignores `ENOTEMPTY`, so let's match that.

I opted to split things up so we remove not-directories
in a first pass, then remove all directories we can in the
second.  This should maximize our chances of removing what we can
in a scenario where e.g. two co-dependent packages install files
to a directory one of them owns.

Closes: coreos#1340
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug jira for syncing to jira
Projects
None yet
Development

No branches or pull requests

4 participants