3 # apport Script to control apport handling of core dumps
5 # chkconfig: 2345 90 10
6 # description: Starts and stops apport crash handling
10 # Source function library.
11 . /etc/rc.d/init.d/functions
13 # The location of the core pattern file
14 PATFILE=/proc/sys/kernel/core_pattern
15 # The location of the apport binary
16 APPORT='/usr/bin/apport %p %s %c'
17 # Location to save the old core_pattern
18 OLDPAT=/var/run/core_pattern
20 # Return success if apport is already enabled
22 # XXX check the lock here too?
23 grep -q "^|.*apport" $PATFILE
27 if ! apport_is_enabled; then
28 cat $PATFILE > $OLDPAT
29 echo "|$APPORT" > $PATFILE
34 if apport_is_enabled; then
35 cat $OLDPAT > $PATFILE
41 if [ ! -f /var/lock/subsys/apport ]; then
42 show "Enabling Apport crash handling"
45 touch /var/lock/subsys/apport
48 msg_already_running "Apport crash handling"
53 if [ -f /var/lock/subsys/apport ]; then
54 show "Disabling Apport crash handling"
57 rm -f /var/lock/subsys/apport
60 msg_not_running "Apport crash handling"
65 # See how we were called.
74 # FIXME are these the right return values?
75 if grep -q 'apport' $PATFILE; then
76 echo "Apport is enabled."
79 echo "Apport is disabled."
88 msg_usage "$0 {start|stop|status|restart|reload}"