Posted to tcl by marc.ziegenhagen at Fri Aug 26 12:24:45 GMT 2011view raw
- # unset DISPLAY for .profile
- unset DISPLAY;
-
- cd `dirname $0`;
- DIR=`pwd`
-
- # start init server in group pgproj / pgprod
-
- TCLKIT=${DIR}/tclkit
- MWEBKIT=${DIR}/mweb-linux.kit
- LOGFILE=${DIR}/mweb.log
-
- OWNER=`stat -c %u $TCLKIT`
- USER=`stat -c %U $TCLKIT`
- echo "owner=$USER/$OWNER" >>$LOGFILE
-
- GRPID=`stat -c %g $TCLKIT`
- GROUP=`stat -c %G $TCLKIT`
- echo "group=$GROUP/$GRPID" >>$LOGFILE
-
- echo "echo \"$TCLKIT $MWEBKIT\" | newgrp $GROUP" | su $USER >>$LOGFILE 2>&1
Comments
Posted by patthoyts@all.tclers.tk at Tue Oct 04 12:06:28 GMT 2011 [text] [code]
It is better to use linux capabilities to give just the necessary permission to the executable to run the server on the desired port. See http://www.patthoyts.tk/blog/using-tclhttpd-with-linux-capabilities.html for an example of this with tclhttpd.