How to properly use log_daemon_msg, log_end_msg, log_progress_msg to write a proper daemon script?

sorin picture sorin · May 31, 2013 · Viewed 26.6k times · Source

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.

Answer

alfredocambera picture alfredocambera · Aug 11, 2013

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