I was suprised not to be able to find any documentation regarding the proper user of these functions:
log_daemon_msg
log_progress_msg
log_end_msg
log_action_msg
log_success_msg
log_failure_msg
log_warning_msg
Where can I find more information about their usage and maybe other related functions?
Note, I found them inside /lib/lsb/init-functions
but the is documentation regarding their usage is mostly missing.
I think this is what you are looking for:
http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html
I've been reading a lot of init scripts on debian wheezy but there doesn't seems to be a unified way of creating init scripts. Some people use echo
instead of log_warning_msg
or log_failure_msg
.
Note: /lib/lsb/init-functions
doesn't seem to work well under bash. So remember to use the appropriate shebang:
#!/bin/sh
just try to test that with any script:
vim 123.sh
#!/bin/sh
. /lib/lsb/init-functions
[ 1 != 2 ] && log_end_msg 1
So I`ve included funcs from /lib/lsb/init-functions.
And execute:
bash 123.sh
...fail!
And so on:
cat 123.sh
#!/bin/sh
. /lib/lsb/init-functions
[ 1 != 2 ] && log_end_msg 0
And run:
bash 123.sh
...done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With