diff options
Diffstat (limited to 'meta-oe/recipes-connectivity/krb5/krb5/etc/init.d/krb5-admin-server')
-rwxr-xr-x | meta-oe/recipes-connectivity/krb5/krb5/etc/init.d/krb5-admin-server | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/krb5/krb5/etc/init.d/krb5-admin-server b/meta-oe/recipes-connectivity/krb5/krb5/etc/init.d/krb5-admin-server new file mode 100755 index 000000000..79238d4f4 --- /dev/null +++ b/meta-oe/recipes-connectivity/krb5/krb5/etc/init.d/krb5-admin-server | |||
@@ -0,0 +1,140 @@ | |||
1 | #! /bin/sh | ||
2 | ### BEGIN INIT INFO | ||
3 | # Provides: krb5-admin-server | ||
4 | # Required-Start: $local_fs $remote_fs $network $syslog | ||
5 | # Required-Stop: $local_fs $remote_fs $network $syslog | ||
6 | # Should-Start: krb5-kdc | ||
7 | # Should-Stop: krb5-kdc | ||
8 | # Default-Start: 2 3 4 5 | ||
9 | # Default-Stop: 0 1 6 | ||
10 | # Short-Description: MIT Kerberos KDC administrative daemon | ||
11 | # Description: Starts, stops, or restarts the MIT Kerberos KDC | ||
12 | # administrative daemon (kadmind). This daemon answers | ||
13 | # requests from kadmin clients and allows administrators | ||
14 | # to create, delete, and modify principals in the KDC | ||
15 | # database. | ||
16 | ### END INIT INFO | ||
17 | |||
18 | # Author: Sam Hartman <hartmans@mit.edu> | ||
19 | # Author: Russ Allbery <rra@debian.org> | ||
20 | # | ||
21 | # Based on the /etc/init.d/skeleton template as found in initscripts version | ||
22 | # 2.86.ds1-15. | ||
23 | |||
24 | # June, 2012: Adopted for yocto <amy.fong@windriver.com> | ||
25 | |||
26 | PATH=/usr/sbin:/usr/bin:/sbin:/bin | ||
27 | DESC="Kerberos administrative servers" | ||
28 | NAME=kadmind | ||
29 | DAEMON=/usr/sbin/$NAME | ||
30 | DAEMON_ARGS="" | ||
31 | SCRIPTNAME=/etc/init.d/krb5-admin-server | ||
32 | DEFAULT=/etc/default/krb5-admin-server | ||
33 | |||
34 | # Exit if the package is not installed. | ||
35 | [ -x "$DAEMON" ] || exit 0 | ||
36 | |||
37 | # Read configuration if it is present. | ||
38 | [ -r "$DEFAULT" ] && . "$DEFAULT" | ||
39 | |||
40 | # Get the setting of VERBOSE and other rcS variables. | ||
41 | [ -f /etc/default/rcS ] && . /etc/default/rcS | ||
42 | |||
43 | . /etc/init.d/functions | ||
44 | |||
45 | ADMIN_SERVER_LOG=/var/log/kadmind.log | ||
46 | [ -f $ADMIN_SERVER_LOG ] && (test ! -x /sbin/restorecon \ | ||
47 | || /sbin/restorecon -F $ADMIN_SERVER_LOG) | ||
48 | |||
49 | # Return | ||
50 | # 0 if daemon has been started | ||
51 | # 1 if daemon was already running | ||
52 | # 2 if daemon could not be started | ||
53 | do_start() | ||
54 | { | ||
55 | start-stop-daemon --start --quiet --startas $DAEMON --name $NAME --test \ | ||
56 | > /dev/null || return 1 | ||
57 | start-stop-daemon --start --quiet --startas $DAEMON --name $NAME \ | ||
58 | -- $DAEMON_ARGS || return 2 | ||
59 | } | ||
60 | |||
61 | # Return | ||
62 | # 0 if daemon has been stopped | ||
63 | # 1 if daemon was already stopped | ||
64 | # 2 if daemon could not be stopped | ||
65 | # other if a failure occurred | ||
66 | do_stop() | ||
67 | { | ||
68 | start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME | ||
69 | RETVAL="$?" | ||
70 | [ "$RETVAL" = 2 ] && return 2 | ||
71 | return "$RETVAL" | ||
72 | } | ||
73 | |||
74 | |||
75 | case "$1" in | ||
76 | start) | ||
77 | if [ "$RUN_KADMIND" = false ] ; then | ||
78 | if [ "$VERBOSE" != no ] ; then | ||
79 | echo "Not starting $DESC per configuration" | ||
80 | fi | ||
81 | exit 0 | ||
82 | fi | ||
83 | [ "$VERBOSE" != no ] && echo "Starting $DESC" "$NAME" | ||
84 | do_start | ||
85 | case "$?" in | ||
86 | 0|1) [ "$VERBOSE" != no ] && echo 0 ;; | ||
87 | 2) [ "$VERBOSE" != no ] && echo 1 ;; | ||
88 | esac | ||
89 | ;; | ||
90 | |||
91 | stop) | ||
92 | [ "$VERBOSE" != no ] && echo "Stopping $DESC" "$NAME" | ||
93 | do_stop | ||
94 | case "$?" in | ||
95 | 0|1) [ "$VERBOSE" != no ] && echo 0 ;; | ||
96 | 2) [ "$VERBOSE" != no ] && echo 1 ;; | ||
97 | esac | ||
98 | ;; | ||
99 | |||
100 | restart|force-reload) | ||
101 | if [ "$RUN_KADMIND" = false ] ; then | ||
102 | if [ "$VERBOSE" != no ] ; then | ||
103 | echo "Not restarting $DESC per configuration" | ||
104 | fi | ||
105 | exit 0 | ||
106 | fi | ||
107 | echo "Restarting $DESC" "$NAME" | ||
108 | do_stop | ||
109 | case "$?" in | ||
110 | 0|1) | ||
111 | do_start | ||
112 | case "$?" in | ||
113 | 0) [ "$VERBOSE" != no ] && echo 0 ;; | ||
114 | *) [ "$VERBOSE" != no ] && echo 1 ;; | ||
115 | esac | ||
116 | ;; | ||
117 | *) | ||
118 | echo 1 | ||
119 | ;; | ||
120 | esac | ||
121 | ;; | ||
122 | |||
123 | status) | ||
124 | pidofproc "$DAEMON" >/dev/null | ||
125 | status=$? | ||
126 | if [ $status -eq 0 ]; then | ||
127 | echo "$NAME is running." | ||
128 | else | ||
129 | echo "$NAME is not running." | ||
130 | fi | ||
131 | exit $status | ||
132 | ;; | ||
133 | |||
134 | *) | ||
135 | echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 | ||
136 | exit 3 | ||
137 | ;; | ||
138 | esac | ||
139 | |||
140 | : | ||