FS#55769 - [nextcloud] failed run pacman hook

Attached to Project: Community Packages
Opened by Gustavo Alvarez (sl1pkn07) - Wednesday, 27 September 2017, 14:30 GMT
Last edited by Sergej Pupykin (sergej) - Tuesday, 03 October 2017, 11:12 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

[2017-09-27 16:25] [PACMAN] Running 'pacman --color auto -Syu community/nextcloud'
[2017-09-27 16:25] [ALPM] transaction started
[2017-09-27 16:25] [ALPM] upgraded nextcloud (12.0.2-1 -> 12.0.3-1)
[2017-09-27 16:25] [ALPM] transaction completed
[2017-09-27 16:25] [ALPM] running 'nextcloud.hook'...
[2017-09-27 16:25] [ALPM-SCRIPTLET] llamada a execv fallida (No existe el fichero o el directorio)

traduction: file or directory not found

This task depends upon

Closed by  Sergej Pupykin (sergej)
Tuesday, 03 October 2017, 11:12 GMT
Reason for closing:  Fixed
Comment by Chih-Hsuan Yen (yan12125) - Wednesday, 27 September 2017, 19:27 GMT
Got this error, too. English version:

[2017-09-28 03:21] [ALPM] running 'nextcloud.hook'...
[2017-09-28 03:21] [ALPM-SCRIPTLET] call to execv failed (No such file or directory)
Comment by Eli Schwartz (eschwartz) - Wednesday, 27 September 2017, 19:44 GMT
Looking at the actual content of the hook added in  FS#55625  it is is actually completely broken, hooks are exec'ed and you cannot use a bash string like 'sudo -u http /usr/bin/php /usr/share/webapps/nextcloud/occ upgrade'

The hook also requires sudo to be installed...
Comment by Eli Schwartz (eschwartz) - Wednesday, 27 September 2017, 22:37 GMT
https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/nextcloud&id=43d5bdc8f4c660f2f6927ae7466a9fcc71446635

That is *a* fix, yes... but I don't see the need for a script or an optdepends. alpm-hooks(5) specifies e.g. the "Depends = sudo" key, or preferably you would simply use `su` provided by util-linux as part of base and base-devel and required by mkinitcpio and systemd. So however you do it there is no need to test for `which sudo`. Just run /usr/bin/su http -c 'command'.

EDIT: replace su with runuser also from util-linux. /usr/bin/runuser -u http -- command
(thanks dreisner)
Comment by Anthony PERARD (sheep_42) - Saturday, 30 September 2017, 13:41 GMT
Hi,

The hook is a good idee, but in my case, I use a different user for my nextcloud installation, so the script is going to fail. I guess I'll just disable the hook for now.

Thanks.
Comment by David Runge (dvzrv) - Saturday, 30 September 2017, 16:56 GMT
I have a setup in which I don't use the systems default php.ini file, but a specific one using php's '-c' option to interface my nextcloud instance. I have all options unset in the global php.ini.
This hook will fail every time for me.

Also: gd is needed for nextcloud and in a default php installation this is deactivated, so this will fail, too, when freshly installing.

I'm not sure this hook is a good idea.
Comment by Damjan Georgievski (damjan) - Sunday, 01 October 2017, 10:31 GMT
the hook assumes too much. I'm running my nextcloud installation in uwsgi, with its own user and service, and using the NEXTCLOUD_CONFIG_DIR= env var to setup an alternate directory for the config.

the hook fails on each of those customizations
Comment by Sergej Pupykin (sergej) - Monday, 02 October 2017, 08:38 GMT
I've added hook example into https://wiki.archlinux.org/index.php/Nextcloud#Setup and removed it from package. I think this is most proper fix.

Loading...