14.10 Nvidia issues
After each kernel update run
sudo apt-get install nvidia-331 nvidia-331-uvm --reinstall
12.04 & 12.10 Add USB MTP support
Add/Update the folwoing PPA to get the version of Gvfs intended for 13.04 with support for MTP
This will enable you to access your Android 4.X devices over USB
sudo add-apt-repository ppa:langdalepl/gvfs-mtp
sudo apt-get update
sudo apt-get upgrade
Logging in init-scripts
Currently there are two sets of functions intended to implement the several kinds of messages normally output by Debian and Ubuntu initscripts.
The first is for reporting the starting and stopping of services:
log_daemon_msg "Foo" "bar" ; log_progress_msg "baz" ; log_end_msg 0
Debian: Foo: bar baz.
Ubuntu: * Foo bar [ ok ]
The second is for reporting actions to be taken:
log_action_msg "Foo"
Debian: Foo.
Ubuntu: * Foo
The third is for reporting actions to be taken and their completion:
log_action_begin_msg "Foo" ; log_action_cont_msg "bar" ; log_action_end_msg 0
Debian: Foo...bar...done.
Ubuntu: * Foo...
* bar... [ ok ]
In addition there is a function for reporting success:
log_success_msg "Foo"
Debian: Foo
Ubuntu: * Foo
one for reporting failure:
log_failure_msg "Foo"
Debian: * Foo [asterisk is red]
Ubuntu: * Foo [asterisk is red]
and a function for warning:
log_warning_msg "Foo"
Debian: * Foo [asterisk is amber]
Ubuntu: * Foo [asterisk is amber]
Finally there is a
log_begin_msg which seems to be obsolete.
Note that the success/failure/warning message functions are the ones specified by the upstream LSB... they aren't very pretty and don't conform to Debian policy, and there's no real way to kludge them into doing so.
Generally you will use the format:
- Report what foo will be do
- Do foo
- Report that foo has now been done
log_action_begin_msg "Will do foo"
foo
log_action_end_msg $?
A problem is that foo may produce output and this will break up the nice single-line format. You may need to devert stdout to /dev/null, but you will be reluctant to divert stderr to /dev/null and error messages will also break up formatting:
Debian: Foo...ERROR
failed. [in red]
Ubuntu: * Foo...
ERROR
[fail] [in red]
I think if you have a serious worry about stderr, you probably should 2> to a temporary file, then cat it after the failure message if necessary. e.g. something like:
f=`tempfile`
log_action_begin_msg "Will do foo"
foo 2>>$f
log_action_end_msg $?
if [ -s $f ]; then
cat $f >/dev/fd/2
fi
rf -f $f