Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 #!/bin/sh
2 #
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 #
8 # Find Mozilla PID and send it a signal, to be used
9 # with the jprof tool.
10 #
12 jpsignal_usage() {
13 echo "Usage: jprofsig [start|stop]"
14 exit 1
15 }
17 if [ $# != 1 ]; then
18 echo "Wrong number of arguments."
19 jpsignal_usage
20 fi
22 jpsignal_arg="$1"
24 # Find & print mozilla PID
25 tmpmoz=`ps aux | grep mozilla-bin | head -1 | awk '{ print $2 }'`
26 echo "Mozilla PID = $tmpmoz"
28 # See how we were called.
29 case "$jpsignal_arg" in
30 start)
31 if [ "$JP_REALTIME" = 1 ]; then
32 kill -ALRM $tmpmoz
33 else
34 # Normal, non-realtime mode.
35 kill -PROF $tmpmoz
36 fi
37 ;;
38 stop)
39 kill -USR1 $tmpmoz
40 ;;
41 *)
42 jpsignal_usage
43 exit 1
44 esac
46 exit 0