~upstart-devel/upstart/upstart-jobs

« back to all changes in this revision

Viewing changes to utopic/etc/init.d/bootchart

  • Committer: Dimitri John Ledkov
  • Date: 2014-11-19 12:58:41 UTC
  • Revision ID: dimitri.j.ledkov@intel.com-20141119125841-98dr37roy8dvcv3b
auto update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh -e
2
 
### BEGIN INIT INFO
3
 
# Provides:          bootchart
4
 
# Required-Start:
5
 
# Required-Stop:
6
 
# Should-Start:      
7
 
# Default-Start:     S
8
 
# Default-Stop:
9
 
# Short-Description: Start bootchart
10
 
# Description:       Bootchart is normally started from the initramfs
11
 
#                    however this starts it if not
12
 
### END INIT INFO
13
 
 
14
 
[ -x /lib/bootchart/collector ] || exit 0
15
 
 
16
 
# Jail we run from in initramfs
17
 
JAIL=/dev/.bootchart
18
 
 
19
 
# Where we put the output
20
 
LOGS=/var/run/bootchart
21
 
 
22
 
test -d $JAIL && exit 0
23
 
 
24
 
grep -q "profile" /proc/cmdline && exit 0
25
 
grep -q "bootchart=disable" /proc/cmdline && exit 0
26
 
 
27
 
if grep -q "bootchart=[0-9]*hz" /proc/cmdline; then
28
 
    HZ=$(sed -e 's/.*bootchart=//;s/hz.*//' /proc/cmdline)
29
 
else
30
 
    HZ=25
31
 
fi
32
 
 
33
 
# Get lsb functions
34
 
. /lib/lsb/init-functions
35
 
. /etc/default/rcS
36
 
 
37
 
case "$1" in
38
 
    start)
39
 
        mkdir -p $LOGS
40
 
        /lib/bootchart/collector $HZ $LOGS 2>/dev/null &
41
 
        ;;
42
 
    stop|restart|reload|force-reload)
43
 
        ;;
44
 
    *)
45
 
        log_success_msg "Usage: /etc/init.d/bootchart {start|stop|restart|reload|force-reload}"
46
 
        exit 1
47
 
esac
48
 
 
49
 
exit 0