From 4ada0348854eaa1e9f32f73f8ebc00ca1a18d53d Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Tue, 22 Aug 2023 13:12:52 +0200 Subject: [PATCH] Update packaging_apps_hooks.md --- .../60.advanced/50.hooks/packaging_apps_hooks.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pages/06.contribute/10.packaging_apps/60.advanced/50.hooks/packaging_apps_hooks.md b/pages/06.contribute/10.packaging_apps/60.advanced/50.hooks/packaging_apps_hooks.md index 00355c8e..4894506d 100644 --- a/pages/06.contribute/10.packaging_apps/60.advanced/50.hooks/packaging_apps_hooks.md +++ b/pages/06.contribute/10.packaging_apps/60.advanced/50.hooks/packaging_apps_hooks.md @@ -19,21 +19,18 @@ You should create a directory with the name of the hooks into `/etc/yunohost/hoo mkdir -p /etc/yunohost/hooks.d/post_user_create ``` -After creating the directory check the permissions: -``` -stat -c "%a" /etc/yunohost/hooks.d/post_user_create -``` - -The directory needs to have `777` permissions. Otherwise the hooks inside the directory won't be executed. If the command above doesn't print `777` modify permissions: -``` -chmod 777 /etc/yunohost/hooks.d/post_user_create -``` Next create a bash script inside this directory prefixed by 2 numbers and a dash: ```bash nano /etc/yunohost/hooks.d/post_user_create/05-add-user-to-samba ``` +By default, the directory must be readable and traversable by root, but if you notice your hook is not run at all by YunoHost, you can check permissions with `ls -l /etc/yunohost/hooks.d/` and apply these commands if needed: +``` +chown root:root /etc/yunohost/hooks.d/post_user_create +chmod u+rx /etc/yunohost/hooks.d/post_user_create +``` + ## How to add a hook in an app package If you are packaging an app, you should not set by yourself the hook into `/etc/yunohost/hooks.d` instead you should create a hooks dir at the root of your package. ```