diff --git a/README.md b/README.md index 533f817..01c9c1a 100644 --- a/README.md +++ b/README.md @@ -49,13 +49,10 @@ and "wheel" groups: `-e UMAP="nobody:99:100 www:80:800" -e GMAP="users:100 wheel:800"` -For commands that create files without an explicit user or group name, you may want to set the `UGID` environment -variable so that files created by the command will have the correct user and group IDs in the host. For example, if your -command is `echo foo > /dir1/foo.txt`, then by default the file will be created as the "root" user of the container. If -you want it to be created as user "nobody" with its default group, you would set `UGID` to the values specified by -``echo `id -u nobody`:`id -g nobody` `` in the host. For instance: - -`-e UGID=99:100` +For commands that create files without an explicit user or group name, you may want to set the `USER_ID` and `GROUP_ID` +in the config file. For example, if your command is `echo foo > /dir1/foo.txt`, then by default the file will be +created as the "root" user of the container. If you want it to be created with the user ID and group ID of "nobody" in +the host, you would set these config values to the output of `id -u nobody` and `id -g nobody` in the host. Examples -------- @@ -67,6 +64,9 @@ This example is to run a permissions-repairing utility whenever there's a change MAX_WAIT_TIME=30 MIN_PERIOD=30 COMMAND="/root/newperms /dir2" + # Need to run as root to have the authority to fix the permissions + USER_ID=0 + GROUP_ID=0 # This is important because chmod/chown will change files in the monitored directory IGNORE_EVENTS_WHILE_COMMAND_IS_RUNNING=1 @@ -83,7 +83,10 @@ This example tells SageTV to rescan its imported media when the media directory MAX_WAIT_TIME=05:00 MIN_PERIOD=10:00 COMMAND="wget -nv -O /dev/null --auth-no-challenge http://sage:frey@192.168.1.102:8080/sagex/api?c=RunLibraryImportScan&1=" + # User and group don't really matter for the wget command. But we need to specify them in the config file. + USER_ID=0 + GROUP_ID=0 IGNORE_EVENTS_WHILE_COMMAND_IS_RUNNING=0 We don't need to ignore events while the command is running because the wget command is a "fire and forget" asynchronous -operation. We also don't need to use UMAP, GMAP, or UGID since this command doesn't write to any watch directory. +operation. We also don't need to use UMAP or GMAP.