File tree Expand file tree Collapse file tree 2 files changed +39
-11
lines changed Expand file tree Collapse file tree 2 files changed +39
-11
lines changed Original file line number Diff line number Diff line change
1
+ #! /sbin/openrc-run
1
2
#
2
3
# Copyright 2020 New Relic Corporation. All rights reserved.
3
4
# SPDX-License-Identifier: Apache-2.0
4
5
#
5
6
6
- #!/sbin/openrc-run
7
-
8
7
description=" New Relic Daemon"
9
8
command=" ${nrdaemon:-/ usr/ bin/ newrelic-daemon} "
10
9
command_args=
Original file line number Diff line number Diff line change 10
10
# processname: newrelic-daemon
11
11
# config: /etc/newrelic/newrelic.cfg
12
12
#
13
+ # ## BEGIN INIT INFO
14
+ # Provides: newrelic-daemon
15
+ # Required-Start: $all
16
+ # Required-Stop:
17
+ # Default-Start: 2 3 4 5
18
+ # Default-Stop: 0 1 6
19
+ # Description: The New Relic Daemon is used by the New Relic PHP Agent to communicate
20
+ # with the New Relic Backend
21
+ # ## END INIT INFO
13
22
14
23
LANG=C
15
24
NAME=newrelic-daemon
@@ -18,7 +27,11 @@ DESC="New Relic Daemon"
18
27
#
19
28
# Source function library.
20
29
#
21
- . /etc/init.d/functions
30
+ has_initd_functions=0
31
+ if [ -f /etc/init.d/functions ]; then
32
+ . /etc/init.d/functions
33
+ has_initd_functions=1
34
+ fi
22
35
23
36
ulimit -n 2048 > /dev/null 2>&1
24
37
@@ -223,14 +236,22 @@ EOF
223
236
224
237
if running ; then
225
238
if [ -z " ${NR_SILENT} " -a -z " ${SILENT} " ]; then
226
- success
227
- echo
239
+ if [ $has_initd_functions -eq 1 ]; then
240
+ success
241
+ echo
242
+ else
243
+ echo " [ OK ]"
244
+ fi
228
245
fi
229
246
return 0
230
247
else
231
248
if [ -z " ${NR_SILENT} " -a -z " ${SILENT} " ]; then
232
- failure
233
- echo
249
+ if [ $has_initd_functions -eq 1 ]; then
250
+ failure
251
+ echo
252
+ else
253
+ echo " [FAILED]"
254
+ fi
234
255
fi
235
256
return 1
236
257
fi
@@ -274,14 +295,22 @@ stop() {
274
295
275
296
if running ; then
276
297
if [ -z " ${NR_SILENT} " -a -z " ${SILENT} " ]; then
277
- failure
278
- echo
298
+ if [ $has_initd_functions -eq 1 ]; then
299
+ failure
300
+ echo
301
+ else
302
+ echo " [FAILED]"
303
+ fi
279
304
fi
280
305
return 1
281
306
else
282
307
if [ -z " ${NR_SILENT} " -a -z " ${SILENT} " ]; then
283
- success
284
- echo
308
+ if [ $has_initd_functions -eq 1 ]; then
309
+ success
310
+ echo
311
+ else
312
+ echo " [ OK ]"
313
+ fi
285
314
fi
286
315
return 0
287
316
fi
You can’t perform that action at this time.
0 commit comments