You are not logged in.

#1 2015-01-27 08:27:32

porcupene
Member
Registered: 2010-03-01
Posts: 34

warning: directory ownership differs on /etc/

Since upgrading to Pacman 4.2 I get the following every time I do an upgrade :

warning: directory ownership differs on /etc/
filesystem: 1000:100  package: 0:0
warning: directory ownership differs on /usr/
filesystem: 1000:100  package: 0:0
warning: directory ownership differs on /usr/lib/
filesystem: 1000:100  package: 0:0
warning: directory ownership differs on /usr/bin/
filesystem: 1000:100  package: 0:0
warning: directory ownership differs on /usr/share/
filesystem: 1000:100  package: 0:0
warning: directory ownership differs on /usr/
filesystem: 1000:100  package: 0:0
warning: directory ownership differs on /usr/lib/
filesystem: 1000:100  package: 0:0
warning: directory ownership differs on /usr/bin/
filesystem: 1000:100  package: 0:0 

While this doesn't seem to actually affect the upgrade process I wonder what is going on. Any ideas?

Last edited by porcupene (2015-01-27 08:27:59)

Offline

#2 2015-01-27 09:26:24

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: warning: directory ownership differs on /etc/

Why are those directories not owned by the root user on your system?   Looks like your user owns them, which is bad...

Offline

#3 2015-01-27 11:36:58

porcupene
Member
Registered: 2010-03-01
Posts: 34

Re: warning: directory ownership differs on /etc/

I don't know, I certainly made no modifications myself to the ownership of those directories.

All I can think of is maybe the culprit is something called "mate-applet-softupd", a mate applet that is supposed to let you know when updates are available only it also installs them with just a click without asking for a password.
I'm also using yaourt but I've been using it for years and I've had no issues with it.

Offline

#4 2015-01-27 22:27:12

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: warning: directory ownership differs on /etc/

Chown "root:root" those directories.   Then run "pacman -Qkk" to see what other files are affected.

Offline

#5 2015-01-29 08:01:55

porcupene
Member
Registered: 2010-03-01
Posts: 34

Re: warning: directory ownership differs on /etc/

I did that.

Now I can no longer use sudo (nor su) so I can no longer update my system.

I get a

sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

Offline

#6 2015-01-29 09:02:39

mystyfly
Member
Registered: 2013-03-25
Posts: 30

Re: warning: directory ownership differs on /etc/

I have the same problem as porcupene, I get several ownership warnings when updating packages. Running "pacman -Qkk" gave me about 600 warnings (UID/GID/Permissions/Symlink path/Modification time mismatch) like this (I'm using the messages for couchdb as an example):

warning: couchdb: /etc/couchdb (UID mismatch)
warning: couchdb: /etc/couchdb (GID mismatch)
warning: couchdb: /etc/couchdb/default.ini (UID mismatch)
warning: couchdb: /etc/couchdb/default.ini (GID mismatch)
warning: couchdb: /etc/couchdb/local.ini (UID mismatch)
warning: couchdb: /etc/couchdb/local.ini (GID mismatch)
warning: couchdb: /etc/couchdb/default.d (UID mismatch)
warning: couchdb: /etc/couchdb/default.d (GID mismatch)
warning: couchdb: /etc/couchdb/local.d (UID mismatch)
warning: couchdb: /etc/couchdb/local.d (GID mismatch)
warning: couchdb: /var/lib/couchdb (UID mismatch)
warning: couchdb: /var/lib/couchdb (GID mismatch)
warning: couchdb: /var/log/couchdb (UID mismatch)
warning: couchdb: /var/log/couchdb (GID mismatch)

The /var/lib/couchdb (as an example) directory is owned by "couchdb":"daemon". Furthermore, I get about 200 lines that are mostly like this:

backup file: couchdb: /etc/couchdb/local.ini (Modification time mismatch)
backup file: couchdb: /etc/couchdb/local.ini (Size mismatch)
couchdb: 748 total files, 7 altered files

Most of these 200 messages are like the first 2: "backup file: ... (... mismatch)".

Why are these messages turning up? Aren't my configuration files expected to change in size and modification time?

Offline

#7 2015-01-29 10:47:56

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: warning: directory ownership differs on /etc/

porcupene wrote:

I did that.

Now I can no longer use sudo (nor su) so I can no longer update my system.

I get a

sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

Use an install disk and arch-chroot to reinstall the sudo package.   But you must have done more than just fixing the permission of the directory...

Offline

#8 2015-01-29 12:03:39

ball
Member
From: Germany
Registered: 2011-12-23
Posts: 164

Re: warning: directory ownership differs on /etc/

I've got similar problems (I didn't play with permissions, I swear!).

My question is: After identifying wrong permissions / ownerships via pacman -Qkk, how do get to know the right permissions, which I want to set manually?

EDIT: I just tried to "fix" the permissions for a rather unimportant package, namely privoxy. My local dirs/files at /etc/privoxy were owned by privoxy:privoxy.  However, pacman complained upon an upgrade of the package that these dirs/files should be owned by root:root. No sooner said than done, I did 'sudo chown -R root:root /etc/privoxy' -- this rendered privoxy unfunctional, the proxy server didn't respond anymore.  After setting permissions to the status quo ante everything was back to normal. Except that pacman -Qkk complains about these files.

Last edited by ball (2015-01-29 12:14:10)

Offline

#9 2015-01-29 12:28:43

porcupene
Member
Registered: 2010-03-01
Posts: 34

Re: warning: directory ownership differs on /etc/

Allan wrote:

But you must have done more than just fixing the permission of the directory...

All I did was

sudo chown -vR root:root /usr

Offline

#10 2015-01-29 12:41:24

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: warning: directory ownership differs on /etc/

That changed permissions for all files in the directory rather than just the directory.

Offline

#11 2015-01-29 12:46:26

porcupene
Member
Registered: 2010-03-01
Posts: 34

Re: warning: directory ownership differs on /etc/

So how do I reverse it? I can live with the warnings but not with not being able to update the system.

Offline

#12 2015-01-29 15:28:08

okplayer02
Member
From: Denver, Colorado
Registered: 2008-11-24
Posts: 84

Re: warning: directory ownership differs on /etc/

take a look at this article https://unix.stackexchange.com/question … wn-command

perhaps in the log files for chown you can see what you need to revert back to the state you had previously.


Say what is good or keep silent  --Prophet Muhammad (SAW)

Offline

#13 2015-01-30 01:43:33

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: warning: directory ownership differs on /etc/

I'd boot into the Arch installer.  Mount your hard drive. Get a list of packages that are on that system using paclog-pkglist, and reinstall them using pacman -r /mnt -S ...

Then you will be able to boot into your system.  Run pacman -Qkk to check for any other issues.

Offline

#14 2015-01-31 10:09:03

porcupene
Member
Registered: 2010-03-01
Posts: 34

Re: warning: directory ownership differs on /etc/

Well... I managed to return to the previous situation.

Logged out, logged in as root, reinstalled sudo (and yaourt), reconfigured sudo.
I'm getting the same errors but at least now I can update the system.

pacman -Qkk is still giving me numerous permission mismatch warnings.

Offline

#15 2015-01-31 13:26:59

krabat
Member
Registered: 2014-07-03
Posts: 40

Re: warning: directory ownership differs on /etc/

@porcupene
Are you by any chance talking about an Arch Linux ARM system where you unpacked the archive containing the root fs as some user other than root? This would explain both your totally screwed FHS ownership and the setgid issues as stuff like this doesn't get restored either if users other than root are unpacking.


@mystfly, balls
I think your primary problem is ownership was changed in packages which pacman doesn't seem to apply automatically (which in turn makes sense, imho). I recently ran into this updating colord to 1.2.7-2:

warning: directory ownership differs on /var/lib/colord/icc/
filesystem: 0:0  package: 124:124

And indeed: FS#43189
ball, an easy means to figure out the permissions needed is re-installing the package in question by 'pacman -S <package>' which yields messages as the one stated above. Regarding privoxy I think something is wrong on your system. Recent privoxy runs as user privoxy so it can't work if /etc/privoxy is owned by root as files therein have permission bits 660.
mystfly, those messages about time and size mismatch are referring to files covered by "backup" in PKGBUILD, hence simply a necessity to track, imo.


The reason why all this cropped up only recently is a change in pacman 4.2, I suppose

https://projects.archlinux.org/pacman.git/tree/NEWS wrote:

- pacman prints a warning if an installed directory has different
  permission to that already on the filesystem (FS#34740)

Offline

#16 2015-01-31 13:37:13

Neitsab
Wiki Maintainer
Registered: 2013-12-05
Posts: 25

Re: warning: directory ownership differs on /etc/

Similar problem during the last upgrade only for colord and libvirt:

...
(21/53) updating colord                                                                        [------------------------------------------------------------] 100%
warning: directory ownership differs on /var/lib/colord/icc/
filesystem : 0:0, package : 124:124
...
(40/53) updating libvirt                                                                       [------------------------------------------------------------] 100%
...
warning: directory ownership differs on /var/cache/libvirt/qemu/
filesystem : 99:78, package : 0:0
warning: directory ownership differs on /var/lib/libvirt/qemu/
filesystem : 99:78, package : 0:0
warning: directory ownership differs on /var/lib/libvirt/qemu/channel/
filesystem : 99:78, package : 0:0
warning: directory ownership differs on /var/lib/libvirt/qemu/channel/target/
filesystem : 99:78, package : 0:78

(translated from my locale, please don't trip if the wording differs a little bit from yours)

Seeing krabat's comment  I proceeded to the change of ownserhip for colord, however I couldn't a similar bug report for libvirt. Am I the only one affected? If not then I'll create a bug report for it.
Edit: Wait, is FS#39361 corresponding to this? It dates back to 2014-03-12... And I am using the default user and group (root:kvm):

$ pacman -Qii libvirt | grep "/etc/libvirt/qemu.conf"
UNMODIFIED	/etc/libvirt/qemu.conf

Another problem is:

$ id 78
id: 78 : user doesn't exist
$ grep 78 /etc/group
kvm:x:78:
$ id libvirt
id: libvirt : user doesn't exist
$ grep libvirt /etc/group
libvirt:x:1001:neitsab

I think I remember screwing around with qemu/kvm user & group while trying to get qemu-kvm to work, but I fail to see how it could create this discrepancy...

Last edited by Neitsab (2015-01-31 21:25:01)

Offline

#17 2015-01-31 14:10:09

ampe0
Member
Registered: 2014-10-23
Posts: 6

Re: warning: directory ownership differs on /etc/

Also getting simlilar issues, never seen this before:

...
(11/25) upgrading colord                           [######################] 100%
warning: directory ownership differs on /var/lib/colord/icc/
filesystem: 0:0  package: 124:124
...

Offline

#18 2015-01-31 14:14:31

Neitsab
Wiki Maintainer
Registered: 2013-12-05
Posts: 25

Re: warning: directory ownership differs on /etc/

@ampe0
As krabat put it:

krabat wrote:

@mystfly, balls
I think your primary problem is ownership was changed in packages which pacman doesn't seem to apply automatically (which in turn makes sense, imho). I recently ran into this updating colord to 1.2.7-2:

warning: directory ownership differs on /var/lib/colord/icc/
filesystem: 0:0  package: 124:124

And indeed: FS#43189
...
The reason why all this cropped up only recently is a change in pacman 4.2, I suppose

https://projects.archlinux.org/pacman.git/tree/NEWS wrote:

- pacman prints a warning if an installed directory has different
  permission to that already on the filesystem (FS#34740)

Offline

#19 2015-01-31 23:59:29

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: warning: directory ownership differs on /etc/

I get some ownership and permission errors, but mostly modification time/filesize differences. (At least some of these are expected.) I'm never very sure how things end up with different ownership or permissions... These are definitely not cases where I've changed them. In many cases, they are files I've never so much as touched.

Hasn't pacman been warning about these for some time? What is new exactly?

What happens to a root login if the terminal emulator crashes?

[Konsole is extremely unstable with the recent updates in Arch. This is the first crash, though.]

If I reinstall filesystem, I get 4 or 5 complaints. Only 1 of these is unexpected and is a complaint about /etc/mtab. However, this seems to match what's in the file.

I do not get any complaints about the permissions on regular files in /etc, even though pacman -Qkk correctly says they don't match the package. If I unpack the pkg archive, I can see that, eg, gshadow should be rw-------. But on my system, it appears to be ---------. Similarly shadow. I have ---------, while filesystem has rw-------. Yet pacman does not complain on reinstall.

Is there an easier way of figuring out what the permissions or ownership should be? Which doesn't involve unpacking the package archive someplace and looking?

EDIT: And now Konsole is crashing and forgetting everything I just taught it...

Last edited by cfr (2015-02-01 02:27:24)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#20 2015-02-01 10:04:36

ball
Member
From: Germany
Registered: 2011-12-23
Posts: 164

Re: warning: directory ownership differs on /etc/

cfr wrote:

Is there an easier way of figuring out what the permissions or ownership should be? Which doesn't involve unpacking the package archive someplace and looking?

Yes. As krabat said, just reinstall the offending packages you've identified with pacman -Qkk. Upon reinstalling the correct permissions should be given.


krabat wrote:

ball, an easy means to figure out the permissions needed is re-installing the package in question by 'pacman -S <package>' which yields messages as the one stated above. Regarding privoxy I think something is wrong on your system. Recent privoxy runs as user privoxy so it can't work if /etc/privoxy is owned by root as files therein have permission bits 660.

Well I did had set /etc/privoxy to be owned by privoxy:privoxy and I've reset the ownership to this state.  But during the last update of privoxy pacman complained (among other things) that the directory should have 0:0 als ownership setting (which I interpret to be root:root); see the second line of the log:

[2015-01-29 12:29] [ALPM] warning: directory permissions differ on /etc/privoxy/ filesystem: 770  package: 755
[2015-01-29 12:29] [ALPM] warning: directory ownership differs on /etc/privoxy/ filesystem: 42:42  package: 0:0
[2015-01-29 12:29] [ALPM] warning: directory permissions differ on /etc/privoxy/templates/ filesystem: 770  package: 755
[2015-01-29 12:29] [ALPM] warning: directory ownership differs on /etc/privoxy/templates/ filesystem: 42:42  package: 0:0
[2015-01-29 12:29] [ALPM] warning: directory permissions differ on /var/log/privoxy/ filesystem: 700  package: 755
[2015-01-29 12:29] [ALPM] warning: directory ownership differs on /var/log/privoxy/ filesystem: 42:42  package: 0:42
[2015-01-29 12:29] [ALPM] upgraded privoxy (3.0.22-1 -> 3.0.23-1)

Offline

#21 2015-02-01 12:07:23

krabat
Member
Registered: 2014-07-03
Posts: 40

Re: warning: directory ownership differs on /etc/

@ball
In the meantime I ran into something similar regarding Postfix:

  • update Postfix (running flawlessly) from 2.11.3-1 to 2.11.3-2 -->

    warning: directory ownership differs on /var/lib/postfix/
    filesystem: 73:0  package: 0:0
    warning: directory ownership differs on /var/spool/postfix/{public,maildrop}
    filesystem: 73:75  package: 0:0
    warning: directory ownership differs on /var/spool/postfix/<all directories herein except pid and the ones already stated>
    filesystem: 73:0  package: 0:0

    (braces and so on included manually to keep it short)

  • adjust ownership accordingly => Postfix fails

  • re-install Postfix => ownership as stated in "filesystem:" above gets set, Postfix works flawlessly again

Apparently, this behaviour can only be seen if packages get re-installed or updated, not upon first install. That's why I hadn't seen your findings before posting my first message in this thread.
Actually, I think it's a bug but. Maybe Allan will chime in here once more and tell us about it.

Offline

#22 2015-02-01 14:34:13

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: warning: directory ownership differs on /etc/

The postfix user is not available during building.  It is created during install and then some directories are chowned as needed.

The next update, pacman sees these directories do not match what is in the package.  Directories are special, because multiple packages could own them, so we don't extract them if they are already there.  Instead we check their permissions, and warn if it is different to the package.

What happens if you "fix" the warnings, is you remove the needed permissions for postfix to work.  Then reinstalling it fix that, but gives no error as the directory permissions are the same as the package before they get changed again.

So most of the time (at the moment) these warnings are wrong, but sometimes they are right....  We are looking at a better solution long term, and maybe a hack fix for 4.2.1.

Offline

#23 2015-02-02 09:41:35

Erhan
Member
Registered: 2012-12-05
Posts: 12

Re: warning: directory ownership differs on /etc/

I will just leave this hint for everyone who will find this topic by google if they messed up the permissions. I did this once and it was a bit of work.

What I did was booting from arch install medium, searched on google for which common files need suid and set it manually for each file after chrooting into my install.

I remember having similar issues about permission in /usr/. But I know that i never changed anything. Never the less it worked out. Best thing was that I also forgot the root password at that time so I couldn't just login.

Offline

#24 2015-02-02 22:03:21

krabat
Member
Registered: 2014-07-03
Posts: 40

Re: warning: directory ownership differs on /etc/

@Allan
Thanks for clarifying.

There's just one more tiny detail bothering me a little bit:
As the problem doesn't seem to exist with colord I took a look at its PKBUILD and found package() invoking chown. The messages ceased with Postfix as well after adjusting PKGBUILD accordingly

package_postfix() {
        [...]
        chown 73:0   var/lib/postfix
        chown 73:0   var/spool/postfix/*
        chown 73:75  var/spool/postfix/{maildrop,public}
        chown 0:0    var/spool/postfix/pid
}

So wouldn't chown commands like this be an option to fix the problem in general, too?

Offline

#25 2015-02-02 22:09:28

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: warning: directory ownership differs on /etc/

Am I doing right ? if I do

sudo find /usr/ -user <user_name> -exec sudo chown -v root:root {} ';'

In my case I found almost all packages weren't  set with correct permissions.


do it good first, it will be faster than do it twice the saint wink

Offline

Board footer

Powered by FluxBB