Changeset 2962
- Timestamp:
- Nov 30, 2016, 4:04:39 PM (4 years ago)
- Location:
- lliurex-statistics/trunk/fuentes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-statistics/trunk/fuentes/debian/changelog
r2952 r2962 1 lliurex-statistics (0.2-2) xenial; urgency=medium 2 3 * Add debug verbosity 4 * Fixes confirmator logic 5 * Fixes acl's 6 7 -- M.Angel Juan <m.angel.juan@gmail.com> Wed, 30 Nov 2016 13:11:00 +0100 8 1 9 lliurex-statistics (0.2-1) xenial; urgency=medium 2 10 -
lliurex-statistics/trunk/fuentes/debian/lliurex-statistics.postinst
r2952 r2962 48 48 echo -e "-a exit,always -F arch=b32 -F euid>999 -S execve\n" >> /etc/audit/rules.d/analytics.rules 49 49 touch /etc/lliurex-analytics/status 50 51 #USELESS INTO SQUASHED FS, LOGIC INTO STARTUP SERVICE 50 52 # 10003 (fixed group into ldap 4 teachers) 51 setfacl -m g:10003:rw /etc/lliurex-analytics/status 52 setfacl -m g:adm:rw /etc/lliurex-analytics/status 53 #echo "setting acl's" 54 #setfacl -m g:10003:rw /etc/lliurex-analytics/status 55 #setfacl -m g:adm:rw /etc/lliurex-analytics/status 56 #getfacl /etc/lliurex-analytics/status 57 53 58 service auditd restart 54 59 ;; -
lliurex-statistics/trunk/fuentes/lliurex-statistics.install/etc/init.d/analytics
r2776 r2962 20 20 PIDFILE=/var/run/"$NAME".pid 21 21 SCRIPTNAME=/etc/init.d/"$NAME" 22 STATUS_FILE=/etc/lliurex-analytics/status 22 23 23 24 # Exit if the package is not installed … … 30 31 . /lib/lsb/init-functions 31 32 33 set_acls() 34 { 35 if [ -w "${STATUS_FILE}" ]; then 36 # fixed group 10003 for teachers into ldap 37 setfacl -m g:10003:rw ${STATUS_FILE} 38 setfacl -m g:adm:rw ${STATUS_FILE} 39 fi 40 } 32 41 # 33 42 # Function that starts the daemon/service … … 39 48 # 1 if daemon was already running 40 49 # 2 if daemon could not be started 50 set_acls 41 51 start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" -- \ 42 52 $EXTRAOPTIONS \ -
lliurex-statistics/trunk/fuentes/lliurex-statistics.install/usr/bin/confirmator
r2948 r2962 19 19 fi 20 20 DPKG="$(${WHICH} dpkg)" 21 GREP="$(${WHICH} grep)"21 GREP="$(${WHICH} egrep)" 22 22 23 23 if [ -z "${DPKG}" -o -z "${GREP}" ]; then … … 62 62 63 63 # INSTALLATION TYPE DETECTION & ACKNOWLEDGE TYPES 64 RUN_ON_LIVE="$(${FINDMNT} -P -t squashfs|${GREP} 'target="/rofs" source="/dev/loop"')"64 RUN_ON_LIVE="$(${FINDMNT} -P -t squashfs|${GREP} -i 'target="/rofs" source="/dev/loop[0-9]?"')" 65 65 66 66 if [ -n "${RUN_ON_LIVE}" ]; then … … 76 76 fi 77 77 78 #NOT USED INSIDE CONFIRMATOR, THIS LOGIC IS INTO COLLECTOR 79 SERVER_OVERRRIDE="$(${N4DCLI} -h server -c VariablesManager -m get_variable -a 'STATS_ENABLED'|${GREP} -i yes)" 80 if [ -n "${SERVER_OVERRIDE}" ]; then 81 exit 0 78 RUN_AS_CLIENT=$(${LLIUREX_VERSION} |${GREP} -i client) 79 RUN_AS_SERVER=$(${LLIUREX_VERSION} |${GREP} -i server) 80 RUN_AS_DESKTOP="" 81 if [ -z ${RUN_AS_CLIENT} -a -z ${RUN_AS_SERVER} ];then 82 RUN_AS_DESKTOP="yes" 83 else 84 #NOT USED INSIDE CONFIRMATOR, THIS LOGIC IS INTO COLLECTOR AND WILL BE ACCEPTED NOT NEED WRITE THE LOCAL FILE 85 SERVER_OVERRRIDE="$(${N4DCLI} -h server -c VariablesManager -m get_variable -a 'STATS_ENABLED'|${GREP} '1')" 86 if [ -n "${SERVER_OVERRIDE}" ]; then 87 exit 0 88 fi 82 89 fi 83 90 … … 86 93 DEBCONF_ACKNOWLEDGE="$(echo get lliurex-statistics/acknowledge|${DEBCONF_COMM} 2>/dev/null |${GREP} -E -i -o 'true|false')" 87 94 88 # NOT NEEDED89 #RUN_AS_CLIENT=$(${LLIUREX_VERSION} |${GREP} -i client)90 #RUN_AS_SERVER=$(${LLIUREX_VERSION} |${GREP} -i server)91 #RUN_AS_DESKTOP=""92 #if [ -z ${RUN_AS_CLIENT} -a -z ${RUN_AS_SERVER} ];then93 # RUN_AS_DESKTOP="yes"94 #fi95 95 96 96 # DIALOG FUNCTION -
lliurex-statistics/trunk/fuentes/lliurex-statistics.install/usr/sbin/analytics
r2948 r2962 79 79 # Send data to master server 80 80 send_data() 81 else: 82 debug("Sending not allowed when try to change file") 81 83 # Get new temporary filename 82 84 next_filename=get_filename(LOGPATH) … … 108 110 try: 109 111 if answer == "yes": 112 debug("allow_send stats by check local acknowledge") 110 113 return True 111 114 else: 115 debug("deny allow_send stats by check server & local acknowledge") 112 116 return False 113 117 except Exception as e: 118 debug("deny allow_send stats by exception check server & local acknowledge") 114 119 return False 115 120 else: 121 debug("allow_send stats by check server acknowledge") 116 122 return True 117 123 #END def allow_send() … … 129 135 # Send data to master server 130 136 send_data() 137 else 138 debug("Sending not allowed when try send file") 131 139 # Clear database file 132 140 clear_db() … … 279 287 jsonobj=json.dumps({'uid':uid,'vers':version,'sab':sabor, 'stats': jsonobj }); 280 288 payload = {'stats':jsonobj}; 289 try: 290 debug("SENDING DATA:"+str(payload)) 291 except Exception as e: 292 debug("Error debugging data to send") 293 281 294 r = requests.post(url,data=payload,headers=headers); 282 295 debug("S("+r.text+')',2);
Note: See TracChangeset
for help on using the changeset viewer.