Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

update-rc.d, systemd: redirect also stderr from type

* different shells different behavior?
  bash prints 'type: update-rc.d: not found' on stderr
  busybox's sh on stdout

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
  • Loading branch information...
commit 45e22312c48b23480bd6dff98702b0691a48f7d1 1 parent e9e4a90
Martin 'JaMa' Jansa shr-project authored rpurdie committed
4 meta/classes/systemd.bbclass
@@ -27,7 +27,7 @@ if [ -n "$D" ]; then
27 27 OPTS="--root=$D"
28 28 fi
29 29
30   -if type systemctl >/dev/null; then
  30 +if type systemctl >/dev/null 2>/dev/null; then
31 31 systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
32 32
33 33 if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
@@ -37,7 +37,7 @@ fi
37 37 }
38 38
39 39 systemd_prerm() {
40   -if type systemctl >/dev/null; then
  40 +if type systemctl >/dev/null 2>/dev/null; then
41 41 if [ -z "$D" ]; then
42 42 systemctl stop ${SYSTEMD_SERVICE}
43 43 fi
4 meta/classes/update-rc.d.bbclass
@@ -18,7 +18,7 @@ if test "x$D" != "x"; then
18 18 else
19 19 OPT="-s"
20 20 fi
21   -if type update-rc.d >/dev/null; then
  21 +if type update-rc.d >/dev/null 2>/dev/null; then
22 22 update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
23 23 fi
24 24 }
@@ -35,7 +35,7 @@ if test "$D" != ""; then
35 35 else
36 36 OPT=""
37 37 fi
38   -if type update-rc.d >/dev/null; then
  38 +if type update-rc.d >/dev/null 2>/dev/null; then
39 39 update-rc.d $OPT ${INITSCRIPT_NAME} remove
40 40 fi
41 41 }

0 comments on commit 45e2231

Please sign in to comment.
Something went wrong with that request. Please try again.