Changeset 2214
- Timestamp:
- 27/02/07 16:10:40 (14 years ago)
- Location:
- TI12-security/trunk/python
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/ndg.security.common/ndg/security/common/AttCert.py
r2178 r2214 93 93 # certificate 94 94 __validProvenanceSettings = ('original', 'mapped') 95 namespace = "urn:ndg .security"95 namespace = "urn:ndg:security:attributeCertificate" 96 96 97 97 #_________________________________________________________________________ -
TI12-security/trunk/python/ndg.security.test/ndg/security/test/AttAuthority/attAuthorityClientTest.cfg
r2178 r2214 11 11 # setting for test6GetMappedAttCert 12 12 uri = http://localhost:5000/AttributeAuthority 13 #uri = http://glue.badc.rl.ac.uk:42000/AttributeAuthority13 uri = http://glue.badc.rl.ac.uk:41000/AttributeAuthority 14 14 15 15 # X.509 certificate for Attribute Authority - to verify the signature of -
TI12-security/trunk/python/share/ndg-aa
r2186 r2214 31 31 tacFilePath=${prefixDir}/${srvSubDir}/server-config.tac 32 32 33 # Set a specific location for the properties file if required 34 #export NDGSEC_AA_PROPFILEPATH= 35 33 36 serviceName=${0##*/} 34 37 … … 42 45 # process listing 43 46 prog=/usr/local/NDG/bin/twistd 47 48 # Specify python for status() to search when looking for an existing process 49 # running 50 statCheckProg=/usr/local/NDG/bin/python 51 44 52 args="-u ${uid} -g ${gid} --syslog --prefix=${serviceName} \ 45 53 --pidfile=${pidFilePath} -oy ${tacFilePath}" … … 90 98 91 99 mv /tmp/${serviceName}.pid /var/run/${serviceName}.pid 100 101 # Put in placeholder so as not to upset twistd when it looks for it 102 # on shutdown 103 touch /tmp/${serviceName}.pid 104 chown ${uid}:${gid} /tmp/${serviceName}.pid 92 105 93 106 touch /var/lock/subsys/${serviceName} … … 144 157 fi 145 158 146 # Remove pid fileif any.159 # Remove pid and lock files if any. 147 160 rm -f /var/run/${serviceName}.pid 148 161 rm -f /var/lock/subsys/${serviceName} 162 149 163 echo 150 164 } … … 164 178 165 179 # Get pid from "/var/run/*.pid" file 180 local pidFound= 166 181 if [ -f $pidFilePath ] ; then 167 182 read pid < $pidFilePath … … 170 185 return 171 186 fi 187 pidFound=Yes 172 188 fi 173 189 174 190 # look for pid in listing 175 local pidFound= 176 for i in `pidof -o $$ -o $PPID -o %PPID -x "${prog}"`; do 191 for i in `pidof -o $$ -o $PPID -o %PPID -x "${statCheckProg}"`; do 177 192 [[ $i = $pid ]] && pidFound=Yes && break; 178 193 done … … 180 195 if [ -n "$pidFound" ]; then 181 196 echo $"$prog (pid $pid) is running..." 182 return 183 197 184 198 elif [ -f /var/lock/subsys/${serviceName} ]; then 185 echo $"$prog dead but subsys locked and pid file $pidFilePath exists" 186 return 199 echo $"$prog is dead but subsys locked" 200 201 elif [ -f /var/run/${serviceName}.pid ]; then 202 echo $"$prog is dead but pid file $pidFilePath exists" 187 203 else 188 echo $"$prog dead but pid file $pidFilePath exists"204 echo $"$prog is dead" 189 205 fi 190 206 } -
TI12-security/trunk/python/share/ndg-ca
r2186 r2214 28 28 # set tacFilePath directly 29 29 prefixDir=$(dirname $(dirname $(type -p python))) 30 srvSubDir=lib/site-packages/ndg/security/server/ ca30 srvSubDir=lib/site-packages/ndg/security/server/CertificateAuthority 31 31 tacFilePath=${prefixDir}/${srvSubDir}/server-config.tac 32 33 # Set a specific location for the properties file if required 34 #export NDGSEC_AA_PROPFILEPATH= 32 35 33 36 serviceName=${0##*/} … … 42 45 # process listing 43 46 prog=/usr/local/NDG/bin/twistd 47 48 # Specify python for status() to search when looking for an existing process 49 # running 50 statCheckProg=/usr/local/NDG/bin/python 51 44 52 args="-u ${uid} -g ${gid} --syslog --prefix=${serviceName} \ 45 53 --pidfile=${pidFilePath} -oy ${tacFilePath}" … … 81 89 RETVAL=$? 82 90 if [ $RETVAL = 0 ]; then 83 # Use root privilege to move pid file to correct location - put wait 84 # in to give twistd some leaway 85 i=0 86 while [ ! -f /tmp/${serviceName}.pid ] && [ "$i" -lt 10 ]; do 87 sleep 1; 88 let "i++"; 89 done 90 91 mv /tmp/${serviceName}.pid /var/run/${serviceName}.pid 91 # Use root privilege to move pid file to correct location - put wait 92 # in to give twistd some leaway 93 i=0 94 while [ ! -f /tmp/${serviceName}.pid ] && [ "$i" -lt 10 ]; do 95 sleep 1; 96 let "i++"; 97 done 98 99 mv /tmp/${serviceName}.pid /var/run/${serviceName}.pid 100 101 # Put in placeholder so as not to upset twistd when it looks for it 102 # on shutdown 103 touch /tmp/${serviceName}.pid 104 chown ${uid}:${gid} /tmp/${serviceName}.pid 92 105 93 106 touch /var/lock/subsys/${serviceName} … … 144 157 fi 145 158 146 # Remove pid fileif any.159 # Remove pid and lock files if any. 147 160 rm -f /var/run/${serviceName}.pid 148 161 rm -f /var/lock/subsys/${serviceName} 162 149 163 echo 150 164 } … … 164 178 165 179 # Get pid from "/var/run/*.pid" file 180 local pidFound= 166 181 if [ -f $pidFilePath ] ; then 167 182 read pid < $pidFilePath … … 170 185 return 171 186 fi 187 pidFound=Yes 172 188 fi 173 189 174 190 # look for pid in listing 175 local pidFound= 176 for i in `pidof -o $$ -o $PPID -o %PPID -x "${prog}"`; do 191 for i in `pidof -o $$ -o $PPID -o %PPID -x "${statCheckProg}"`; do 177 192 [[ $i = $pid ]] && pidFound=Yes && break; 178 193 done … … 180 195 if [ -n "$pidFound" ]; then 181 196 echo $"$prog (pid $pid) is running..." 182 return 183 197 184 198 elif [ -f /var/lock/subsys/${serviceName} ]; then 185 echo $"$prog dead but subsys locked and pid file $pidFilePath exists" 186 return 199 echo $"$prog is dead but subsys locked" 200 201 elif [ -f /var/run/${serviceName}.pid ]; then 202 echo $"$prog is dead but pid file $pidFilePath exists" 187 203 else 188 echo $"$prog dead but pid file $pidFilePath exists"204 echo $"$prog is dead" 189 205 fi 190 206 } -
TI12-security/trunk/python/share/ndg-gk
r2186 r2214 31 31 tacFilePath=${prefixDir}/${srvSubDir}/server-config.tac 32 32 33 # Set a specific location for the properties file if required 34 #export NDGSEC_AA_PROPFILEPATH= 35 33 36 serviceName=${0##*/} 34 37 … … 42 45 # process listing 43 46 prog=/usr/local/NDG/bin/twistd 47 48 # Specify python for status() to search when looking for an existing process 49 # running 50 statCheckProg=/usr/local/NDG/bin/python 51 44 52 args="-u ${uid} -g ${gid} --syslog --prefix=${serviceName} \ 45 53 --pidfile=${pidFilePath} -oy ${tacFilePath}" … … 81 89 RETVAL=$? 82 90 if [ $RETVAL = 0 ]; then 83 # Use root privilege to move pid file to correct location - put wait 84 # in to give twistd some leaway 85 i=0 86 while [ ! -f /tmp/${serviceName}.pid ] && [ "$i" -lt 10 ]; do 87 sleep 1; 88 let "i++"; 89 done 90 91 mv /tmp/${serviceName}.pid /var/run/${serviceName}.pid 91 # Use root privilege to move pid file to correct location - put wait 92 # in to give twistd some leaway 93 i=0 94 while [ ! -f /tmp/${serviceName}.pid ] && [ "$i" -lt 10 ]; do 95 sleep 1; 96 let "i++"; 97 done 98 99 mv /tmp/${serviceName}.pid /var/run/${serviceName}.pid 100 101 # Put in placeholder so as not to upset twistd when it looks for it 102 # on shutdown 103 touch /tmp/${serviceName}.pid 104 chown ${uid}:${gid} /tmp/${serviceName}.pid 92 105 93 106 touch /var/lock/subsys/${serviceName} … … 144 157 fi 145 158 146 # Remove pid fileif any.159 # Remove pid and lock files if any. 147 160 rm -f /var/run/${serviceName}.pid 148 161 rm -f /var/lock/subsys/${serviceName} 162 149 163 echo 150 164 } … … 164 178 165 179 # Get pid from "/var/run/*.pid" file 180 local pidFound= 166 181 if [ -f $pidFilePath ] ; then 167 182 read pid < $pidFilePath … … 170 185 return 171 186 fi 187 pidFound=Yes 172 188 fi 173 189 174 190 # look for pid in listing 175 local pidFound= 176 for i in `pidof -o $$ -o $PPID -o %PPID -x "${prog}"`; do 191 for i in `pidof -o $$ -o $PPID -o %PPID -x "${statCheckProg}"`; do 177 192 [[ $i = $pid ]] && pidFound=Yes && break; 178 193 done … … 180 195 if [ -n "$pidFound" ]; then 181 196 echo $"$prog (pid $pid) is running..." 182 return 183 197 184 198 elif [ -f /var/lock/subsys/${serviceName} ]; then 185 echo $"$prog dead but subsys locked and pid file $pidFilePath exists" 186 return 199 echo $"$prog is dead but subsys locked" 200 201 elif [ -f /var/run/${serviceName}.pid ]; then 202 echo $"$prog is dead but pid file $pidFilePath exists" 187 203 else 188 echo $"$prog dead but pid file $pidFilePath exists"204 echo $"$prog is dead" 189 205 fi 190 206 } -
TI12-security/trunk/python/share/ndg-log
r2186 r2214 1 1 #!/bin/bash 2 2 # 3 # SysV init script for NDG Security Log Service3 # SysV init script for NDG Security Log 4 4 # 5 5 # P J Kershaw … … 31 31 tacFilePath=${prefixDir}/${srvSubDir}/server-config.tac 32 32 33 # Set a specific location for the properties file if required 34 #export NDGSEC_AA_PROPFILEPATH= 35 33 36 serviceName=${0##*/} 34 37 … … 42 45 # process listing 43 46 prog=/usr/local/NDG/bin/twistd 47 48 # Specify python for status() to search when looking for an existing process 49 # running 50 statCheckProg=/usr/local/NDG/bin/python 51 44 52 args="-u ${uid} -g ${gid} --syslog --prefix=${serviceName} \ 45 53 --pidfile=${pidFilePath} -oy ${tacFilePath}" … … 81 89 RETVAL=$? 82 90 if [ $RETVAL = 0 ]; then 83 # Use root privilege to move pid file to correct location - put wait 84 # in to give twistd some leaway 85 i=0 86 while [ ! -f /tmp/${serviceName}.pid ] && [ "$i" -lt 10 ]; do 87 sleep 1; 88 let "i++"; 89 done 90 91 mv /tmp/${serviceName}.pid /var/run/${serviceName}.pid 91 # Use root privilege to move pid file to correct location - put wait 92 # in to give twistd some leaway 93 i=0 94 while [ ! -f /tmp/${serviceName}.pid ] && [ "$i" -lt 10 ]; do 95 sleep 1; 96 let "i++"; 97 done 98 99 mv /tmp/${serviceName}.pid /var/run/${serviceName}.pid 100 101 # Put in placeholder so as not to upset twistd when it looks for it 102 # on shutdown 103 touch /tmp/${serviceName}.pid 104 chown ${uid}:${gid} /tmp/${serviceName}.pid 92 105 93 106 touch /var/lock/subsys/${serviceName} … … 144 157 fi 145 158 146 # Remove pid fileif any.159 # Remove pid and lock files if any. 147 160 rm -f /var/run/${serviceName}.pid 148 161 rm -f /var/lock/subsys/${serviceName} 162 149 163 echo 150 164 } … … 164 178 165 179 # Get pid from "/var/run/*.pid" file 180 local pidFound= 166 181 if [ -f $pidFilePath ] ; then 167 182 read pid < $pidFilePath … … 170 185 return 171 186 fi 187 pidFound=Yes 172 188 fi 173 189 174 190 # look for pid in listing 175 local pidFound= 176 for i in `pidof -o $$ -o $PPID -o %PPID -x "${prog}"`; do 191 for i in `pidof -o $$ -o $PPID -o %PPID -x "${statCheckProg}"`; do 177 192 [[ $i = $pid ]] && pidFound=Yes && break; 178 193 done … … 180 195 if [ -n "$pidFound" ]; then 181 196 echo $"$prog (pid $pid) is running..." 182 return 183 197 184 198 elif [ -f /var/lock/subsys/${serviceName} ]; then 185 echo $"$prog dead but subsys locked and pid file $pidFilePath exists" 186 return 199 echo $"$prog is dead but subsys locked" 200 201 elif [ -f /var/run/${serviceName}.pid ]; then 202 echo $"$prog is dead but pid file $pidFilePath exists" 187 203 else 188 echo $"$prog dead but pid file $pidFilePath exists"204 echo $"$prog is dead" 189 205 fi 190 206 } -
TI12-security/trunk/python/share/ndg-sm
r2186 r2214 31 31 tacFilePath=${prefixDir}/${srvSubDir}/server-config.tac 32 32 33 # Set a specific location for the properties file if required 34 #export NDGSEC_AA_PROPFILEPATH= 35 33 36 serviceName=${0##*/} 34 37 … … 42 45 # process listing 43 46 prog=/usr/local/NDG/bin/twistd 47 48 # Specify python for status() to search when looking for an existing process 49 # running 50 statCheckProg=/usr/local/NDG/bin/python 51 44 52 args="-u ${uid} -g ${gid} --syslog --prefix=${serviceName} \ 45 53 --pidfile=${pidFilePath} -oy ${tacFilePath}" … … 81 89 RETVAL=$? 82 90 if [ $RETVAL = 0 ]; then 83 # Use root privilege to move pid file to correct location - put wait 84 # in to give twistd some leaway 85 i=0 86 while [ ! -f /tmp/${serviceName}.pid ] && [ "$i" -lt 10 ]; do 87 sleep 1; 88 let "i++"; 89 done 90 91 mv /tmp/${serviceName}.pid /var/run/${serviceName}.pid 91 # Use root privilege to move pid file to correct location - put wait 92 # in to give twistd some leaway 93 i=0 94 while [ ! -f /tmp/${serviceName}.pid ] && [ "$i" -lt 10 ]; do 95 sleep 1; 96 let "i++"; 97 done 98 99 mv /tmp/${serviceName}.pid /var/run/${serviceName}.pid 100 101 # Put in placeholder so as not to upset twistd when it looks for it 102 # on shutdown 103 touch /tmp/${serviceName}.pid 104 chown ${uid}:${gid} /tmp/${serviceName}.pid 92 105 93 106 touch /var/lock/subsys/${serviceName} … … 144 157 fi 145 158 146 # Remove pid fileif any.159 # Remove pid and lock files if any. 147 160 rm -f /var/run/${serviceName}.pid 148 161 rm -f /var/lock/subsys/${serviceName} 162 149 163 echo 150 164 } … … 164 178 165 179 # Get pid from "/var/run/*.pid" file 180 local pidFound= 166 181 if [ -f $pidFilePath ] ; then 167 182 read pid < $pidFilePath … … 170 185 return 171 186 fi 187 pidFound=Yes 172 188 fi 173 189 174 190 # look for pid in listing 175 local pidFound= 176 for i in `pidof -o $$ -o $PPID -o %PPID -x "${prog}"`; do 191 for i in `pidof -o $$ -o $PPID -o %PPID -x "${statCheckProg}"`; do 177 192 [[ $i = $pid ]] && pidFound=Yes && break; 178 193 done … … 180 195 if [ -n "$pidFound" ]; then 181 196 echo $"$prog (pid $pid) is running..." 182 return 183 197 184 198 elif [ -f /var/lock/subsys/${serviceName} ]; then 185 echo $"$prog dead but subsys locked and pid file $pidFilePath exists" 186 return 199 echo $"$prog is dead but subsys locked" 200 201 elif [ -f /var/run/${serviceName}.pid ]; then 202 echo $"$prog is dead but pid file $pidFilePath exists" 187 203 else 188 echo $"$prog dead but pid file $pidFilePath exists"204 echo $"$prog is dead" 189 205 fi 190 206 }
Note: See TracChangeset
for help on using the changeset viewer.