diff options
| author | Xiaofeng Yan <xiaofeng.yan@windriver.com> | 2011-05-10 16:30:16 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-11 16:43:22 +0100 |
| commit | 1809999605cc2dab60ed0f96e92e563a073f0b5d (patch) | |
| tree | c1c51ccc4c5cc81361df8fa6d41415ef2befa5f6 | |
| parent | 1320cad1ca5c10a3b639ac2b7116bd8acd735725 (diff) | |
| download | poky-1809999605cc2dab60ed0f96e92e563a073f0b5d.tar.gz | |
init-functions: Conforming applications may install one or more initialization scripts
LSB Test Suite need init scripts for lsb-image.
During the installer's post-install processing phase the program /usr/lib/lsb/install_initd \
must be called to activate the init script. \
When a software package is removed, /usr/lib/lsb/remove_initd \
must be called to deactivate the init script.
(From OE-Core rev: 5c846091b034fff21333487df4ada5667eb8e247)
Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rwxr-xr-x | meta/recipes-extended/lsb/lsb/init-functions | 32 | ||||
| -rwxr-xr-x | meta/recipes-extended/lsb/lsb/lsb_killproc | 6 | ||||
| -rwxr-xr-x | meta/recipes-extended/lsb/lsb/lsb_log_message | 27 | ||||
| -rwxr-xr-x | meta/recipes-extended/lsb/lsb/lsb_pidofproc | 6 | ||||
| -rwxr-xr-x | meta/recipes-extended/lsb/lsb/lsb_start_daemon | 45 |
5 files changed, 116 insertions, 0 deletions
diff --git a/meta/recipes-extended/lsb/lsb/init-functions b/meta/recipes-extended/lsb/lsb/init-functions new file mode 100755 index 0000000000..bf424dde1c --- /dev/null +++ b/meta/recipes-extended/lsb/lsb/init-functions | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # LSB initscript functions, as defined in the LSB Spec 1.1.0 | ||
| 4 | # | ||
| 5 | # Lawrence Lim <llim@core.com> - Tue, 26 June 2007 | ||
| 6 | # Updated to the latest LSB 3.1 spec | ||
| 7 | # http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic_lines.txt | ||
| 8 | |||
| 9 | start_daemon () { | ||
| 10 | /etc/core-lsb/lsb_start_daemon "$@" | ||
| 11 | } | ||
| 12 | |||
| 13 | killproc () { | ||
| 14 | /etc/core-lsb/lsb_killproc "$@" | ||
| 15 | } | ||
| 16 | |||
| 17 | pidofproc () { | ||
| 18 | /etc/core-lsb/lsb_pidofproc "$@" | ||
| 19 | } | ||
| 20 | |||
| 21 | log_success_msg () { | ||
| 22 | /etc/core-lsb/lsb_log_message success "$@" | ||
| 23 | } | ||
| 24 | |||
| 25 | log_failure_msg () { | ||
| 26 | /etc/core-lsb/lsb_log_message failure "$@" | ||
| 27 | } | ||
| 28 | |||
| 29 | log_warning_msg () { | ||
| 30 | /etc/core-lsb/lsb_log_message warning "$@" | ||
| 31 | } | ||
| 32 | |||
diff --git a/meta/recipes-extended/lsb/lsb/lsb_killproc b/meta/recipes-extended/lsb/lsb/lsb_killproc new file mode 100755 index 0000000000..e1121e4e86 --- /dev/null +++ b/meta/recipes-extended/lsb/lsb/lsb_killproc | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | . /etc/init.d/functions | ||
| 4 | |||
| 5 | LSB=LSB-1.1 killproc $* | ||
| 6 | exit $? | ||
diff --git a/meta/recipes-extended/lsb/lsb/lsb_log_message b/meta/recipes-extended/lsb/lsb/lsb_log_message new file mode 100755 index 0000000000..2995f781e0 --- /dev/null +++ b/meta/recipes-extended/lsb/lsb/lsb_log_message | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | . /etc/init.d/functions | ||
| 4 | |||
| 5 | ACTION=$1 | ||
| 6 | shift | ||
| 7 | |||
| 8 | case "$ACTION" in | ||
| 9 | success) | ||
| 10 | echo -n $* | ||
| 11 | success "$*" | ||
| 12 | echo | ||
| 13 | ;; | ||
| 14 | failure) | ||
| 15 | echo -n $* | ||
| 16 | failure "$*" | ||
| 17 | echo | ||
| 18 | ;; | ||
| 19 | warning) | ||
| 20 | echo -n $* | ||
| 21 | warning "$*" | ||
| 22 | echo | ||
| 23 | ;; | ||
| 24 | *) | ||
| 25 | ;; | ||
| 26 | esac | ||
| 27 | exit 0 | ||
diff --git a/meta/recipes-extended/lsb/lsb/lsb_pidofproc b/meta/recipes-extended/lsb/lsb/lsb_pidofproc new file mode 100755 index 0000000000..ffc17bbf65 --- /dev/null +++ b/meta/recipes-extended/lsb/lsb/lsb_pidofproc | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | . /etc/init.d/functions | ||
| 4 | |||
| 5 | pidofproc $* | ||
| 6 | exit $? | ||
diff --git a/meta/recipes-extended/lsb/lsb/lsb_start_daemon b/meta/recipes-extended/lsb/lsb/lsb_start_daemon new file mode 100755 index 0000000000..05b6371771 --- /dev/null +++ b/meta/recipes-extended/lsb/lsb/lsb_start_daemon | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | . /etc/init.d/functions | ||
| 4 | |||
| 5 | nice= | ||
| 6 | force= | ||
| 7 | pidfile= | ||
| 8 | user= | ||
| 9 | check= | ||
| 10 | RETVAL= | ||
| 11 | while [ "$1" != "${1##[-+]}" ]; do | ||
| 12 | case $1 in | ||
| 13 | -f) | ||
| 14 | force="--force" | ||
| 15 | shift | ||
| 16 | ;; | ||
| 17 | -n) | ||
| 18 | nice=$2 | ||
| 19 | shift 2 | ||
| 20 | ;; | ||
| 21 | -p) | ||
| 22 | pidfile="--pidfile $2" | ||
| 23 | shift 2 | ||
| 24 | ;; | ||
| 25 | -u) | ||
| 26 | user="--user $2" | ||
| 27 | shift 2 | ||
| 28 | ;; | ||
| 29 | -c) | ||
| 30 | check="--check $2" | ||
| 31 | shift 2 | ||
| 32 | ;; | ||
| 33 | *) | ||
| 34 | echo "Unknown Option $1" | ||
| 35 | echo "Options are:" | ||
| 36 | echo "-f" | ||
| 37 | echo "-p {pidfile}" | ||
| 38 | echo "-n [+/-nicelevel]" | ||
| 39 | echo "-u {user}" | ||
| 40 | echo "-c {base}" | ||
| 41 | exit 1;; | ||
| 42 | esac | ||
| 43 | done | ||
| 44 | LSB=LSB-1.1 daemon ${force:-} ${nice:-} ${pidfile:-} ${user:-} ${check:-} $* | ||
| 45 | exit $? | ||
