Changeset 1200
- Timestamp:
- 07/19/08 02:43:24 (1 month ago)
- Files:
-
- trunk/server/CHANGES (modified) (1 diff)
- trunk/server/debian/mogilefsd.init (modified) (2 diffs)
- trunk/server/debian/mogstored.config (modified) (1 diff)
- trunk/server/debian/mogstored.init (modified) (5 diffs)
- trunk/server/debian/mogstored.postinst (modified) (2 diffs)
- trunk/server/debian/mogstored.preinst (added)
- trunk/server/debian/mogstored.templates (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/server/CHANGES
r1198 r1200 1 * Specify username to run the mogstored daemon (Jonathan Share) 2 1 3 * Many spelling errors corrected. 2 4 trunk/server/debian/mogilefsd.init
r1192 r1200 22 22 [ -x "$DAEMON" ] || exit 0 23 23 24 if [ ! -e $DEFAULTS ] 25 then 26 echo "Can't start $NAME. Defaults file ($DEFAULTS) doesn't exist." 27 echo "Please run dpkg-reconfigure $NAME to correct the problem." 28 exit 0 24 # Read configuration variable file if it is present 25 if [ -r $DEFAULTS ] ; then 26 27 . $DEFAULTS 28 29 if [ -z "$MOGILEFSD_RUNASUSER" ]; then 30 echo "Cannot determine user to run as, even though defaults file ($DEFAULTS) exists." 31 echo "Please run dpkg-reconfigure $NAME to correct the problem." 32 exit 0 33 fi 34 else 35 echo "Can't start $NAME. Defaults file ($DEFAULTS) doesn't exist." 36 echo "Please run dpkg-reconfigure $NAME to correct the problem." 37 exit 0 29 38 fi 30 31 # Read configuration variable file if it is present32 [ -r /etc/default/$NAME ] && . /etc/default/$NAME33 39 34 40 # Load the VERBOSE setting and other rcS variables 35 41 . /lib/init/vars.sh 36 37 if [ "$MOGILEFSD_RUNASUSER" == "" ]38 then39 40 echo "Cannot determine user to run as, even though defaults file ($DEFAULTS) exists."41 echo "Please run dpkg-reconfigure $NAME to correct the problem."42 exit 043 fi44 42 45 43 set -e … … 52 50 if [ -e $PIDFILE ] 53 51 then 54 52 55 53 if [ -d /proc/`cat $PIDFILE`/ ] 56 54 then trunk/server/debian/mogstored.config
r167 r1200 8 8 db_input medium $PACKAGE/docroot || true 9 9 db_go 10 11 RUNASUSER="" 12 13 while [ "$RUNASUSER" = "" ] 14 do 15 16 db_input medium $PACKAGE/runasuser || true 17 db_go 18 19 db_get $PACKAGE/runasuser 20 RUNASUSER="$RET" 21 22 if [ "$RUNASUSER" = "root" ] 23 then 24 25 db_reset $PACKAGE/runasuser 26 db_fset $PACKAGE/runasuser seen false 27 fi 28 29 done trunk/server/debian/mogstored.init
r1192 r1200 15 15 NAME=mogstored 16 16 DESC=mogstored 17 DEFAULTS=/etc/default/$NAME 17 18 PIDFILE=/var/run/$NAME.pid 18 19 SCRIPTNAME=/etc/init.d/$NAME … … 22 23 23 24 # Read configuration variable file if it is present 24 [ -r /etc/default/$NAME ] && . /etc/default/$NAME 25 if [ -r $DEFAULTS ] ; then 26 27 . $DEFAULTS 28 29 if [ -z "$MOGSTORED_RUNASUSER" ]; then 30 echo "Cannot determine user to run as, even though defaults file ($DEFAULTS) exists." 31 echo "Please run dpkg-reconfigure $NAME to correct the problem." 32 exit 0 33 fi 34 else 35 echo "Can't start $NAME. Defaults file ($DEFAULTS) doesn't exist." 36 echo "Please run dpkg-reconfigure $NAME to correct the problem." 37 exit 0 38 fi 25 39 26 40 # Load the VERBOSE setting and other rcS variables … … 36 50 if [ -e $PIDFILE ] 37 51 then 38 52 39 53 if [ -d /proc/`cat $PIDFILE`/ ] 40 54 then … … 48 62 fi 49 63 50 start-stop-daemon --start --quiet --exec $DAEMON --pidfile $PIDFILE -b -m --name $NAME 64 start-stop-daemon --start --quiet --exec $DAEMON --pidfile $PIDFILE -b -m --name $NAME --chuid $MOGSTORED_RUNASUSER 51 65 } 52 66 … … 56 70 do_stop() 57 71 { 58 start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --name $NAME 72 start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --name $NAME --user $MOGSTORED_RUNASUSER 59 73 rm -f $PIDFILE 60 74 } trunk/server/debian/mogstored.postinst
r1190 r1200 18 18 db_get $PKG/docroot 19 19 MOGSTORED_DOCROOT=$RET 20 db_get $PKG/runasuser 21 RUNASUSER="$RET" 20 22 21 23 if [ ! -d "$MOGSTORED_DOCROOT" ] 22 24 then 23 25 24 26 mkdir -p $MOGSTORED_DOCROOT 27 chown $RUNASUSER $MOGSTORED_DOCROOT 25 28 chmod 755 $MOGSTORED_DOCROOT 26 29 fi … … 45 48 46 49 #DEBHELPER# 47 trunk/server/debian/mogstored.templates
r167 r1200 4 4 _Description: Document root for mogstored: 5 5 The mogstored daemon needs a directory for the root of its filetree. 6 7 Template: mogstored/runasuser 8 Type: string 9 _Default: mogstored 10 _Description: User to run mogstored as: 11 The mogstored storage daemon cannot be run as root. What user should it be 12 run as? This user will be created for you as a system user if it does not 13 yet exist.
