mirror of
https://github.com/YunoHost/doc.git
synced 2024-09-03 20:06:26 +02:00
Update packaging_apps_hooks.md
This commit is contained in:
parent
546b5b3e7a
commit
4ada034885
1 changed files with 6 additions and 9 deletions
|
@ -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
|
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:
|
Next create a bash script inside this directory prefixed by 2 numbers and a dash:
|
||||||
```bash
|
```bash
|
||||||
nano /etc/yunohost/hooks.d/post_user_create/05-add-user-to-samba
|
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
|
## 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.
|
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.
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue