]>
Commit | Line | Data |
---|---|---|
1 | #! /bin/sh | |
2 | # Copyright (c) 2002 SuSE GmbH Nuernberg, Germany. All rights reserved. | |
3 | # | |
4 | # Author: Marcus Meissner <meissner@suse.de> | |
5 | # | |
6 | # /etc/init.d/hwscan | |
7 | # | |
8 | # System startup script for boot hw probing and reconfiguration | |
9 | # | |
10 | ### BEGIN INIT INFO | |
11 | # Provides: hwscan | |
12 | # Required-Start: | |
13 | # X-UnitedLinux-Should-Start: hotplug kbd | |
14 | # Required-Stop: | |
15 | # Default-Start: 2 3 5 | |
16 | # Default-Stop: | |
17 | # Description: Hardware scan and reconfiguration on boot. | |
18 | ### END INIT INFO | |
19 | ||
20 | HWBOOTSCAN_BIN=/usr/sbin/hwbootscan | |
21 | test -x $HWBOOTSCAN_BIN || exit 5 | |
22 | ||
23 | # Shell functions sourced from /etc/rc.status: | |
24 | # rc_check check and set local and overall rc status | |
25 | # rc_status check and set local and overall rc status | |
26 | # rc_status -v ditto but be verbose in local rc status | |
27 | # rc_status -v -r ditto and clear the local rc status | |
28 | # rc_failed set local and overall rc status to failed | |
29 | # rc_reset clear local rc status (overall remains) | |
30 | # rc_exit exit appropriate to overall rc status | |
31 | . /etc/rc.status | |
32 | ||
33 | # First reset status of this service | |
34 | rc_reset | |
35 | ||
36 | # Return values acc. to LSB for all commands but status: | |
37 | # 0 - success | |
38 | # 1 - misc error | |
39 | # 2 - invalid or excess args | |
40 | # 3 - unimplemented feature (e.g. reload) | |
41 | # 4 - insufficient privilege | |
42 | # 5 - program not installed | |
43 | # 6 - program not configured | |
44 | # 7 - program is not running | |
45 | # | |
46 | # Note that starting an already running service, stopping | |
47 | # or restarting a not-running service as well as the restart | |
48 | # with force-reload (in case signalling is not supported) are | |
49 | # considered a success. | |
50 | ||
51 | case "$1" in | |
52 | start) | |
53 | echo -n "Starting hardware scan on boot" | |
54 | rc_splash "YaST" | |
55 | [ -n "$REDIRECT" ] && exec 0<> $REDIRECT 1>&0 2>&0 | |
56 | $HWBOOTSCAN_BIN | |
57 | rc_check | |
58 | rc_status -v | |
59 | ;; | |
60 | stop) | |
61 | rc_check | |
62 | ;; | |
63 | restart) | |
64 | ## Stop the service and regardless of whether it was | |
65 | ## running or not, start it again. | |
66 | # Remember status and be quiet | |
67 | rc_check | |
68 | ;; | |
69 | force-reload) | |
70 | ## Signal the daemon to reload its config. Most daemons | |
71 | ## do this on signal 1 (SIGHUP). | |
72 | ## If it does not support it, restart. | |
73 | # Remember status and be quiet | |
74 | rc_check | |
75 | ;; | |
76 | reload) | |
77 | ## Like force-reload, but if daemon does not support | |
78 | ## signalling, do nothing (!) | |
79 | ||
80 | # If it supports signalling: | |
81 | rc_reset | |
82 | ;; | |
83 | status) | |
84 | ## Check status with checkproc(8), if process is running | |
85 | ## checkproc will return with exit status 0. | |
86 | ||
87 | # Status has a slightly different for the status command: | |
88 | # 0 - service running | |
89 | # 1 - service dead, but /var/run/ pid file exists | |
90 | # 2 - service dead, but /var/lock/ lock file exists | |
91 | # 3 - service not running | |
92 | ||
93 | rc_reset | |
94 | ;; | |
95 | *) | |
96 | echo "Usage: $0 {start|stop|restart|force-reload|reload|status}" | |
97 | exit 1 | |
98 | ;; | |
99 | esac | |
100 | rc_exit | |
101 |