3 # apport Script to control apport handling of core dumps
5 # Author: Will Woods <wwoods@redhat.com>
8 # description: Starts and stops apport crash handling
10 # Source function library.
11 . /etc/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/share/apport/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 show "Enabling apport crash handling"
44 touch /var/lock/subsys/apport
49 show "Disabling apport crash handling"
52 rm -f /var/lock/subsys/apport
57 # See how we were called.
66 # FIXME are these the right return values?
67 if grep -q 'apport' $PATFILE; then
68 echo "Apport is enabled."
71 echo "Apport is disabled."
80 msg_usage "$0 {start|stop|status|restart|reload}"