Posted to tcl by marc.ziegenhagen at Fri Aug 26 12:24:45 GMT 2011view raw

  1. # unset DISPLAY for .profile
  2. unset DISPLAY;
  3.  
  4. cd `dirname $0`;
  5. DIR=`pwd`
  6.  
  7. # start init server in group pgproj / pgprod
  8.  
  9. TCLKIT=${DIR}/tclkit
  10. MWEBKIT=${DIR}/mweb-linux.kit
  11. LOGFILE=${DIR}/mweb.log
  12.  
  13. OWNER=`stat -c %u $TCLKIT`
  14. USER=`stat -c %U $TCLKIT`
  15. echo "owner=$USER/$OWNER" >>$LOGFILE
  16.  
  17. GRPID=`stat -c %g $TCLKIT`
  18. GROUP=`stat -c %G $TCLKIT`
  19. echo "group=$GROUP/$GRPID" >>$LOGFILE
  20.  
  21. 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.