summaryrefslogtreecommitdiff
blob: 25769df286197ffada9214fa23447e992814b88e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/abrt/files/abrt-2.0.5-init,v 1.1 2011/11/16 07:44:24 tetromino Exp $

description="Automated crash detection service"

depend() {
	need dbus logger
}

start() {
	ebegin "Starting abrtd"
	start-stop-daemon --start --quiet --pidfile /var/run/abrtd.pid \
		--exec /usr/sbin/abrtd -- ${ABRTD_OPTS}
	eend $?

	if [[ "${START_VMCORE}" = "yes" ]]; then
		ebegin "Running abrt-harvest-vmcore"
		/usr/sbin/abrt-harvest-vmcore
		eend $?
	fi

	if [[ "${START_CCPP}" = "yes" ]]; then
		ebegin "Installing abrt-ccpp hook"
		/usr/sbin/abrt-install-ccpp-hook install
		eend $?
	fi

	if [[ "${START_OOPS}" = "yes" ]]; then
		ebegin "Starting abrt-dump-oops"
		start-stop-daemon --start --quiet \
			--pidfile /var/run/abrt-dump-oops.pid \
			--make-pidfile --background \
			--exec /usr/bin/abrt-dump-oops -- ${OOPS_OPTS}
		eend $?
	fi
}

stop() {
	if [[ "${START_OOPS}" = "yes" ]]; then
		ebegin "Stopping abrt-dump-oops"
		start-stop-daemon --stop --quiet \
			--pidfile /var/run/abrt-dump-oops.pid
		eend $?
	fi

	if [[ "${START_CCPP}" = "yes" ]]; then
		ebegin "Uninstalling abrt-ccpp hook"
		/usr/sbin/abrt-install-ccpp-hook uninstall
		eend $?
	fi

	ebegin "Stopping abrtd"
	start-stop-daemon --stop --quiet --pidfile /var/run/abrtd.pid
	eend $?
}