[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: lost file ownerships in etc?



On 6/17/14, Darac Marjal <mailinglist@darac.org.uk> wrote:
> On Tue, Jun 17, 2014 at 12:28:34PM +1000, Zenaan Harkness wrote:
>> On 6/17/14, John D. Hendrickson and Sara Darnell <johnandsara2@cox.net>
>> wrote:
>> > Zenaan Harkness wrote:
>> >> On 6/16/14, der.hans <deb-user@lufthans.com> wrote:
>> >>> Am 16. Jun, 2014 schwätzte Zenaan Harkness so:
>> >>> moin moin,
>> >>>> Most files in /etc/ have lost their file ownerships, having become
>> >>>> user
>> >>>> 1000.
>> >>
>> >>>> Can it be easily fixed?
>> >>>>
>> >>>> I am running etckeeper - is that useful to fixing this?
>> >>> Yes, etckeeper keeps track of file ownership and permissions.
>> >>>
>> >>> See /etc/.etckeeper.
>> >>
>> >> OK, I guess I can run this:
>> >> git log --pretty=oneline|more
>> >>
>> >> and view/record the commits that might have anything interesting (for
>> >> replaying), and just try rolling back on day at a time, eg with:
>> >>
>> >> git reset --hard HEAD~1
>> >>
>> >> Any other techniques I should keep in mind?
>>
>> /etc/passwd appears normal.
>>
>> > maybe reinstall the files.  dpkg can do that.
>>
>> That sounds good. How would I that?
>>
>> sudoers, sudoers.d, shadow and cups/ seem fine, but _everything_ else
>> is 1000.1000.
>>
>> Looks like a lot of packages to reinstall - is there a semi-automated
>> way, or just spend the hour or two to reinstall everything?
>
> One possibility might be to debootstrap a directory and then use "chown
> --reference chrootdir/etc/foo /etc/foo ; chmod --reference
> chrootdir/etc/foo /etc/foo"

Interesting option "--reference". Looks like it could be quite useful.

Unfortunately I have so many packages installed, it would be a rather
large chroot once done, just to get ownerships back. Theoretically
do-able though... thanks.

I have been hoping that there was something inside etckeeper that
would make this much easier. I'll do some more research.

Thanks again all,
Zenaan


Reply to: