3
# PREFIX - prefix of Likewise installation
4
# SERVICE_NAME - name of the service
6
LWSM="${PREFIX}/bin/lwsm"
9
if [ -f /etc/init.d/functions ]; then
10
. /etc/init.d/functions
12
elif [ -f /etc/rc.status ]; then
15
elif [ -f /etc/debian_version ]; then
16
. /lib/lsb/init-functions
18
elif [ "`uname -s`" = 'AIX' ]; then
20
elif [ "`uname -s`" = 'HP-UX' ]; then
22
elif [ "`uname -s`" = 'SunOS' ]; then
24
elif [ "`uname -s`" = 'VMkernel' ]; then
26
elif [ "`uname`" = "FreeBSD" ]; then
34
${LWSM} info "$1" | grep '^Description:' | sed 's/^Description: //'
39
basename "`${LWSM} info "$1" | grep '^Path:' | sed 's/^Path: //'`"
48
printf "%s" "Starting `service_progname $1`: "
49
daemon ${LWSM} -q start "${1}"
61
printf "%s" "Starting `service_description $1`"
62
${LWSM} -q start "${1}"
74
log_daemon_msg "Starting `service_description $1`: `service_progname $1`"
75
start-stop-daemon --start --exec ${LWSM} -- -q start "${1}"
80
printf "%s" "Starting `service_description $1`"
81
if (lssrc -s dhcpcd | grep active >/dev/null); then
82
# Wait up to 30 seconds for an ip address
84
ifconfig -a | grep inet | grep -v 127.0.0 | grep -v 0.0.0.0 | grep -v ::1/0 >/dev/null && break
88
${LWSM} -q start "${1}"
91
HP-UX | SOLARIS | FREEBSD | ESXI)
92
printf "%s" "Starting `service_description $1`"
93
${LWSM} -q start "${1}"
103
${LWSM} -q start "${1}"
115
case "${PLATFORM}" in
117
printf "%s" "Restarting `service_progname $1`: "
118
daemon ${LWSM} -q restart "${1}"
130
printf "%s" "Restarting `service_description $1`"
131
${LWSM} -q restart "${1}"
143
log_daemon_msg "Restarting `service_description $1`: `service_progname $1`"
144
start-stop-daemon --start --exec ${LWSM} -- -q restart "${1}"
149
printf "%s" "Restarting `service_description $1`"
150
if (lssrc -s dhcpcd | grep active >/dev/null); then
151
# Wait up to 30 seconds for an ip address
152
for i in `seq 30`; do
153
ifconfig -a | grep inet | grep -v 127.0.0 | grep -v 0.0.0.0 | grep -v ::1/0 >/dev/null && break
157
${LWSM} -q restart "${1}"
160
HP-UX | SOLARIS | FREEBSD | ESXI)
161
printf "%s" "Restarting `service_description $1`"
162
${LWSM} -q restart "${1}"
172
${LWSM} -q restart "${1}"
184
case "${PLATFORM}" in
186
printf "%s" $"Stopping `service_progname $1`: "
187
${LWSM} -q stop "${1}"
199
printf "%s" "Stopping `service_description $1`"
200
${LWSM} -q stop "${1}"
212
log_daemon_msg "Stopping `service_description $1`: `service_progname $1`"
213
${LWSM} -q stop "${1}"
217
AIX | HP-UX | SOLARIS | FREEBSD | ESXI)
218
printf "%s" "Stopping `service_description $1`"
219
${LWSM} -q stop "${1}"
229
${LWSM} -q stop "${1}"
239
case "${PLATFORM}" in
241
printf "%s" $"Refreshing `service_description $1` configuration"
242
${LWSM} -q refresh "$1"
254
printf "%s" $"Refreshing `service_description $1` configuration"
255
${LWSM} -q refresh "$1"
267
log_daemon_msg "Refreshing `service_description $1` configuration"
268
${LWSM} -q refresh "$1"
272
AIX | HP-UX | SOLARIS | FREEBSD | ESXI)
273
printf "%s" "Refreshing `service_description $1` configuration"
274
${LWSM} -q refresh "$1"
284
${LWSM} -q refresh "$1"
294
service_start "$SERVICE_NAME"
298
service_stop "$SERVICE_NAME"
302
$LWSM status "$SERVICE_NAME"
328
$LWSM info "$SERVICE_NAME"
332
service_restart "$SERVICE_NAME"
336
service_refresh "$SERVICE_NAME"
340
echo "Starting `service_description $SERVICE_NAME`"
344
echo "Stopping `service_description $SERVICE_NAME`"
348
echo "Unrecognized command: $1"