1.1 --- a/README.txt Sun Aug 02 01:04:59 2015 +0200
1.2 +++ b/README.txt Sun Aug 02 14:23:40 2015 +0200
1.3 @@ -36,30 +36,14 @@
1.4
1.5 adduser www-data lmtp
1.6
1.7 -Stored and published data is then initialised as follows:
1.8 -
1.9 - mkdir /var/lib/imip-agent/store /var/lib/imip-agent/preferences
1.10 - mkdir /var/www/imip-agent/static
1.11 - chown imip-agent /var/lib/imip-agent/store /var/lib/imip-agent/preferences
1.12 - chown imip-agent /var/www/imip-agent/static
1.13 - chgrp lmtp /var/lib/imip-agent/store /var/lib/imip-agent/preferences
1.14 - chgrp lmtp /var/www/imip-agent/static
1.15 - chmod g+ws /var/lib/imip-agent/store /var/lib/imip-agent/preferences
1.16 - chmod g+ws /var/www/imip-agent/static
1.17 +Stored and published data is then initialised using the tools/init.sh script.
1.18 +The script employs the setgid flag on the directories initialised for stored
1.19 +and published data so that new files and directories have the appropriate
1.20 +group associated with them.
1.21
1.22 -Here, the setgid flag should ensure that new files and directories have the
1.23 -appropriate group associated with them.
1.24 -
1.25 -Fixing ownership can be done as follows:
1.26 -
1.27 - chown -R imip-agent /var/lib/imip-agent
1.28 - chgrp -R imip-agent /var/lib/imip-agent
1.29 - chown -R imip-agent /var/lib/imip-agent/store /var/lib/imip-agent/preferences
1.30 - chown -R imip-agent /var/www/imip-agent/static
1.31 - chgrp -R lmtp /var/lib/imip-agent/store /var/lib/imip-agent/preferences
1.32 - chgrp -R lmtp /var/www/imip-agent/static
1.33 - chmod -R g+w /var/lib/imip-agent/store /var/lib/imip-agent/preferences
1.34 - chmod -R g+w /var/www/imip-agent/static
1.35 +Fixing ownership can be done using the tools/fix.sh script, in case some form
1.36 +of modification has altered the ownership or membership of the created files
1.37 +and directories.
1.38
1.39 Installing the Software
1.40 -----------------------
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/tools/fix.sh Sun Aug 02 14:23:40 2015 +0200
2.3 @@ -0,0 +1,15 @@
2.4 +#!/bin/sh
2.5 +
2.6 +USER=imip-agent
2.7 +GROUP=lmtp
2.8 +INSTALL_DIR=/var/lib/imip-agent
2.9 +WEB_INSTALL_DIR=/var/www/imip-agent
2.10 +
2.11 +chown -R "$USER" "$INSTALL_DIR"
2.12 +chgrp -R "$GROUP" "$INSTALL_DIR"
2.13 +
2.14 +for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static ; do
2.15 + chown -R "$USER" "$DIR"
2.16 + chgrp -R "$GROUP" "$DIR"
2.17 + chmod -R g+w "$DIR"
2.18 +done
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/tools/init.sh Sun Aug 02 14:23:40 2015 +0200
3.3 @@ -0,0 +1,13 @@
3.4 +#!/bin/sh
3.5 +
3.6 +USER=imip-agent
3.7 +GROUP=lmtp
3.8 +INSTALL_DIR=/var/lib/imip-agent
3.9 +WEB_INSTALL_DIR=/var/www/imip-agent
3.10 +
3.11 +for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static ; do
3.12 + mkdir -p "$DIR"
3.13 + chown "$USER" "$DIR"
3.14 + chgrp "$GROUP" "$DIR"
3.15 + chmod g+ws "$DIR"
3.16 +done