You are not logged in.

#1 2020-01-08 20:37:28

cadaeib
Member
Registered: 2015-03-31
Posts: 7

pacman removed /etc/nextcloud/config/config.php (ok, most likely not)

After upgrading nextcloud from 17.0.1-1 to 17.0.2-1 config.php seems to have been deleted. How can that happen? Seems like it has happened before https://bbs.archlinux.org/viewtopic.php?id=241206, but that is the only other occurence of that problem I (google) could find.

I also posted this here https://help.nextcloud.com/t/config-php … date/67586.

I do not have a backup of config.php because I thought it is enough to backup /usr/share/webapps/nextcloud preserving symlinks btw hmm

Last edited by cadaeib (2020-01-16 09:13:24)

Offline

#2 2020-01-08 20:52:02

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 28,302
Website

Re: pacman removed /etc/nextcloud/config/config.php (ok, most likely not)

It's not in the PKGBUILD.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2020-01-09 13:02:10

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 7,640

Re: pacman removed /etc/nextcloud/config/config.php (ok, most likely not)

The package appears to use /etc/webapps/nextcloud/config , not the path you mention .

    # move config to /etc
    install -d  "$pkgdir"/etc/webapps/${pkgname}
    mv "$pkgdir"/usr/share/webapps/${pkgname}/config "$pkgdir"/etc/webapps/${pkgname}/config
    chown -R http:http "$pkgdir"/etc/webapps/${pkgname}
    ln -s /etc/webapps/${pkgname}/config "$pkgdir"/usr/share/webapps/${pkgname}/config
    chown -R root:http "$pkgdir"/usr/share/webapps/${pkgname}

These commands from its package() function do look like they may result in overriding usermade changes in /etc/webapps/nextcloud/config .

The code snippet feels weitd to me though, and I may be completely misunderstanding it.


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#4 2020-01-12 17:50:04

cadaeib
Member
Registered: 2015-03-31
Posts: 7

Re: pacman removed /etc/nextcloud/config/config.php (ok, most likely not)

Sorry I thought archlinux.org would notify me of posts.

Yes, it was in /etc/webapps/nextcloud/config and got overwritten by an almost empty config.php. If its the PKGBUILDs fault, then why has it not happened at other upgades?

In any case, I now rewrote the config.php as well as I could and it seems to work so far. Even though I did not specify the salt parameter and I took the instance id that was in the new config.php.

Offline

#5 2020-01-12 19:25:47

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 942

Re: pacman removed /etc/nextcloud/config/config.php (ok, most likely not)

You didn't read or understand JWR's post. So again, it's not in the the PKGBUILD
To make it more clear pacnew
And to make it even more clear, here's a PKGBUILD with backup PKGBUILD-with-backup
So if you still think it's a bug, create a bug report for the Nextcloud package.
But, I would say create your own PKGBUILD facilitating exactly  what you like, to backup all files you like, see second PKGBUILD I posted..

Always backup always;)

Offline

#6 2020-01-12 23:46:38

jonno2002
Member
Registered: 2016-11-21
Posts: 84

Re: pacman removed /etc/nextcloud/config/config.php (ok, most likely not)

strange thing is the nextcloud package doesnt include /etc/webapps/nextcloud/config/config.php as its a user created file, /etc/webapps/nextcloud/config/config.sample.php is included in the package, so no idea how it got overwritten.

Offline

#7 2020-01-14 09:27:20

cadaeib
Member
Registered: 2015-03-31
Posts: 7

Re: pacman removed /etc/nextcloud/config/config.php (ok, most likely not)

Sorry I don't know exactly how pacman works. Do I understand correctly, that if config.php would be part of the package, then pacman would overwrite it with every update, because its not specified in the PKGBUILD, that it should be saved?

But then, actually config.php is not part of the package, so pacman would never overwrite it?

Last edited by cadaeib (2020-01-14 09:28:50)

Offline

#8 2020-01-14 13:53:34

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 942

Re: pacman removed /etc/nextcloud/config/config.php (ok, most likely not)

The backup is not part of the PKGBUILD if you want that, create your own.
I cannot say why your config was overwritten, Sherlock the heck out of it and try to find out why that happened...
It should not have been that way sure but it did according to you, so figure it out.
Learn how your package manager works should be one of the first things if you want to use Arch successful.

But I keep saying it you should always backup configs if for whatever reason they get overwritten and 'whatever' clearly happened, to you wink

Offline

#9 2020-01-14 16:25:49

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,970

Re: pacman removed /etc/nextcloud/config/config.php (ok, most likely not)

cadaeib wrote:

Sorry I don't know exactly how pacman works. Do I understand correctly, that if config.php would be part of the package, then pacman would overwrite it with every update, because its not specified in the PKGBUILD, that it should be saved?

Correct. pacman will overwrite every file in the package, unless that file is specified as a "backup" file.

cadaeib wrote:

But then, actually config.php is not part of the package, so pacman would never overwrite it?

Also correct. I've listed the contents of every version of nextcloud going back to nextcloud-15.0.1-1-any.pkg.tar.xz, and all of them install etc/webapps/nextcloud/config/config.sample.php but none of them install etc/webapps/nextcloud/config/config.php

So upgrading would update the sample file, but nothing else. Deleting the package would remove the sample file, but not touch the actual config file, and then it would refuse to remove the etc/webapps/nextcloud/config/ directory because there are still files in it that are not being removed within that pacman transaction.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#10 2020-01-16 09:14:12

cadaeib
Member
Registered: 2015-03-31
Posts: 7

Re: pacman removed /etc/nextcloud/config/config.php (ok, most likely not)

ok, thank you

Offline

Board footer

Powered by FluxBB