LCDd won't start on boot but it works if started manually

A B <[email protected]> Sat, 17 Aug 2013 19:18:53 +0200
Newsgroups gmane.comp.sysutils.lcdproc
Message-ID <CABje1_Zh4fRLVKbbfO9=d3C9kjXzWmwc6Mp80qLx7CYRO_=nkQ@mail.gmail.com>
--===============5730932128267638553==
Content-Type: multipart/alternative; boundary=001a1130cec8cdb48c04e427e6ec

--001a1130cec8cdb48c04e427e6ec
Content-Type: text/plain; charset=ISO-8859-1

Hi all,
       I'm having a strange problem with LCDd: it won't start at boot
time but it works as expected if invoked by CLI.


My hw is a Raspberry Pi rev.2 interfaced with a 20x4 LCD via i2c and
MCP23017 port expander.

I've sucessfully build & installed LCDproc from source
CVS-current-20130410 on a Raspbmc distro (Linux raspbmc 3.6.11 #2
PREEMPT Tue Jul 30 02:02:22 UTC 2013 armv6l GNU/Linux).

If I start manually LCDd with sudo /usr/local/sbin/LCDd it works, but
the file /etc/init.d/LCDd is unable to load LCDd as a service. My
LCDd.conf file is OK (I can load LCDd using /usr/local/sbin/LCDd -c
/usr/local/etc/LCDd.conf with no problem) and /etc/init.d/LCDd seems
to be ok also: /etc/init.d/LCDd start (restart or stop) works.

I've tracked down what's happened at boot time (less /var/log/syslog |
grep LCDd):

Aug 13 15:29:08 raspbmc LCDd: LCDd version CVS-current-20130410 starting
Aug 13 15:29:08 raspbmc LCDd: Built on Aug 11 2013, protocol version
0.3, API version 0.5
Aug 13 15:29:08 raspbmc LCDd: Using Configuration File:
/usr/local/etc/LCDd.conf
Aug 13 15:29:08 raspbmc LCDd: Set report level to 5, output to syslog
Aug 13 15:29:08 raspbmc LCDd: Server running in foreground
Aug 13 15:29:08 raspbmc LCDd: Listening for queries on 127.0.0.1:13666
Aug 13 15:29:08 raspbmc LCDd: screenlist_init()
Aug 13 15:29:08 raspbmc LCDd: driver_load(name="hd44780",
filename="/usr/local/lib/lcdproc/hd44780.so")
Aug 13 15:29:08 raspbmc LCDd: HD44780: using ConnectionType: piplate
Aug 13 15:29:08 raspbmc LCDd: hd44780: Using hd44780_default charmap
Aug 13 15:29:08 raspbmc LCDd: HD44780: piplate: Using device
'/dev/i2c-1' and address 0x20 for a MCP23017
Aug 13 15:29:08 raspbmc LCDd: HD44780: piplate: open i2c device
'/dev/i2c-1' failed: No such file or directory
Aug 13 15:29:08 raspbmc LCDd: Driver [hd44780] init failed, return code -1
Aug 13 15:29:08 raspbmc LCDd: Module /usr/local/lib/lcdproc/hd44780.so
could not be loaded
Aug 13 15:29:08 raspbmc LCDd: Could not load driver hd44780
Aug 13 15:29:08 raspbmc LCDd: There is no output driver
Aug 13 15:29:08 raspbmc LCDd: Critical error while initializing, abort.



The relevant info: Aug 13 15:29:08 raspbmc LCDd: HD44780: piplate: open
i2c device '/dev/i2c-1' failed: No such file or directory.


My /etc/init.d/LCDd file:

#!/bin/sh -e

### BEGIN INIT INFO
# Provides:          LCDd
# Required-Start:    $syslog $local_fs $network $remote_fs
# Required-Stop:     $syslog $local_fs $network $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      S 0 1 6
# Short-Description: LCDproc Server Daemon
# Description:       Debian init script for LCDd, the display
#                    server daemon in the LCDproc suite
### END INIT INFO

# local variables
prefix=/usr/local
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
sbindir=${exec_prefix}/sbin
etc=${prefix}/etc

NAME=LCDd
DAEMON=${sbindir}/${NAME}
DESC="LCDproc display server daemon"
OPTIONS="-f -c /usr/local/etc/LCDd.conf"

# installation check
test -x ${DAEMON} || exit 0

case "$1" in
    start)
	printf "Starting ${DESC}: "
	start-stop-daemon --start --quiet --exec ${DAEMON} -- ${OPTIONS}
	printf "${NAME}.\n"
	;;
    stop)
	printf "Stopping ${DESC}: "
	start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON}
	printf "${NAME}.\n"
	;;
    restart|force-reload)
	$0 stop
	sleep 1
	$0 start
	;;
    *)
	printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2
	exit 1
	;;
esac

exit 0


I think LCDd tries to load and check if i2c-1 exist too early (maybe
i2c-1 is created at some time after the LCDd check).


What can I do  to solver the problem?


Thank you in advance.
A B

--001a1130cec8cdb48c04e427e6ec
Content-Type: text/html; charset=ISO-8859-1

<div dir="ltr"><pre>Hi all,
       I&#39;m having a strange problem with LCDd: it won&#39;t start at boot time but it works as expected if invoked by CLI.<br><br><br>My hw is a Raspberry Pi rev.2 interfaced with a 20x4 LCD via i2c and MCP23017 port expander.

I&#39;ve sucessfully build &amp; installed LCDproc from source CVS-current-20130410 on a Raspbmc distro (Linux raspbmc 3.6.11 #2 PREEMPT Tue Jul 30 02:02:22 UTC 2013 armv6l GNU/Linux).

If I start manually LCDd with sudo /usr/local/sbin/LCDd it works, but
the file /etc/init.d/LCDd is unable to load LCDd as a service. My
LCDd.conf file is OK (I can load LCDd using /usr/local/sbin/LCDd -c
/usr/local/etc/LCDd.conf with no problem) and /etc/init.d/LCDd seems to be ok also: /etc/init.d/LCDd start (restart or stop) works.  

I&#39;ve tracked down what&#39;s happened at boot time (less /var/log/syslog | grep LCDd):

Aug 13 15:29:08 raspbmc LCDd: LCDd version CVS-current-20130410 starting
Aug 13 15:29:08 raspbmc LCDd: Built on Aug 11 2013, protocol version
0.3, API version 0.5
Aug 13 15:29:08 raspbmc LCDd: Using Configuration File:
/usr/local/etc/LCDd.conf
Aug 13 15:29:08 raspbmc LCDd: Set report level to 5, output to syslog
Aug 13 15:29:08 raspbmc LCDd: Server running in foreground
Aug 13 15:29:08 raspbmc LCDd: Listening for queries on <a href="http://127.0.0.1:13666">127.0.0.1:13666</a>
Aug 13 15:29:08 raspbmc LCDd: screenlist_init()
Aug 13 15:29:08 raspbmc LCDd: driver_load(name=&quot;hd44780&quot;,
filename=&quot;/usr/local/lib/lcdproc/hd44780.so&quot;)
Aug 13 15:29:08 raspbmc LCDd: HD44780: using ConnectionType: piplate
Aug 13 15:29:08 raspbmc LCDd: hd44780: Using hd44780_default charmap
Aug 13 15:29:08 raspbmc LCDd: HD44780: piplate: Using device
&#39;/dev/i2c-1&#39; and address 0x20 for a MCP23017
Aug 13 15:29:08 raspbmc LCDd: HD44780: piplate: open i2c device
&#39;/dev/i2c-1&#39; failed: No such file or directory
Aug 13 15:29:08 raspbmc LCDd: Driver [hd44780] init failed, return code -1
Aug 13 15:29:08 raspbmc LCDd: Module /usr/local/lib/lcdproc/hd44780.so
could not be loaded
Aug 13 15:29:08 raspbmc LCDd: Could not load driver hd44780
Aug 13 15:29:08 raspbmc LCDd: There is no output driver
Aug 13 15:29:08 raspbmc LCDd: Critical error while initializing, abort.



The relevant info: Aug 13 15:29:08 raspbmc LCDd: HD44780: piplate: open
i2c device &#39;/dev/i2c-1&#39; failed: No such file or directory.


My /etc/init.d/LCDd file:

#!/bin/sh -e

### BEGIN INIT INFO
# Provides:          LCDd
# Required-Start:    $syslog $local_fs $network $remote_fs
# Required-Stop:     $syslog $local_fs $network $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      S 0 1 6
# Short-Description: LCDproc Server Daemon
# Description:       Debian init script for LCDd, the display
#                    server daemon in the LCDproc suite
### END INIT INFO

# local variables
prefix=/usr/local
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
sbindir=${exec_prefix}/sbin
etc=${prefix}/etc

NAME=LCDd
DAEMON=${sbindir}/${NAME}
DESC=&quot;LCDproc display server daemon&quot;
OPTIONS=&quot;-f -c /usr/local/etc/LCDd.conf&quot;

# installation check
test -x ${DAEMON} || exit 0

case &quot;$1&quot; in
    start)
	printf &quot;Starting ${DESC}: &quot;
	start-stop-daemon --start --quiet --exec ${DAEMON} -- ${OPTIONS}
	printf &quot;${NAME}.\n&quot;
	;;
    stop)
	printf &quot;Stopping ${DESC}: &quot;
	start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON}
	printf &quot;${NAME}.\n&quot;
	;;
    restart|force-reload)
	$0 stop
	sleep 1
	$0 start
	;;
    *)
	printf &quot;Usage: $0 {start|stop|restart|force-reload}\n&quot; &gt;&amp;2
	exit 1
	;;
esac

exit 0


I think LCDd tries to load and check if i2c-1 exist too early (maybe
i2c-1 is created at some time after the LCDd check).


What can I do  to solver the problem?


Thank you in advance.
<br>A B</pre></div>

--001a1130cec8cdb48c04e427e6ec--

--===============5730932128267638553==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
LCDproc mailing list
[email protected]
http://lists.omnipotent.net/mailman/listinfo/lcdproc

--===============5730932128267638553==--