google-code-export / measureit

Automatically exported from code.google.com/p/measureit
1 stars 0 forks source link

Measureit.py does not run on boot #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. No new readings are obtained on rebooting
2. ...... unitil I run sudo /etc/init.d/measureit start
3.

What is the expected output? What do you see instead?
Should start automatically

What version of the product are you using? On what operating system?
112 on Raspbian wheezy

Please provide any additional information below.
Tried the following.....

pi@raspberrypi ~ $ sudo update-rc.d measureit defaults 
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match 
measureit Default-Stop values (none)
insserv: script measureit: service rsyncd already provided!
insserv: exiting now!
update-rc.d: error: insserv rejected the script header

Also tried adding "0 1 6" to the stop part of the script but still get the 
"update-rc.d: error: insserv rejected the script header" error

Original issue reported on code.google.com by gor...@gmail.com on 8 Oct 2012 at 4:47

GoogleCodeExporter commented 9 years ago
Worked out that measureit init.d script was not working on startup as 
data-input.py was failing to start due to MYSQL loading at a later time.

(this is due to MYSQL on Ubuntu being started by 'upstart' rather than init.d)

I think a work around is to use an upstart script to start data-input.py rather 
than init.d

e.g. create /etc/init/measureit.conf

# Start when mysql started
start on started mysql

stop on runlevel [016]

# Start measureit via the daemon control script.
exec /usr/bin/python /var/www/python/data-input.py start

# Restart the process if it dies with a signal
# or exit code not given by the 'normal exit' stanza.
respawn

# Give up if restart occurs 10 times in 90 seconds.
respawn limit 10 90

Original comment by gor...@gmail.com on 9 Nov 2012 at 10:56

GoogleCodeExporter commented 9 years ago
I resolved this issue with the following steps:
1. # rm /etc/rc*/*measureit
2. # nano /etc/init.d/measureit:
     #Required-Start: $remotefs $mysql $syslog $all
3. # update-rc.d measureit defaults

You can download my modified init script which also check that the service is 
not already running

Original comment by rmcgovern095@gmail.com on 10 Dec 2012 at 11:33

Attachments:

GoogleCodeExporter commented 9 years ago
This won't work with distris that use 'upstart' rather than init.d for starting 
MySQL (eg Ubuntu)?

Original comment by gor...@gmail.com on 10 Dec 2012 at 11:57

GoogleCodeExporter commented 9 years ago
I resolved this problem by using supervise. This is very cool and works on 
every system.

setup instructions for supervise can be found here:
http://71421.de/wiki/doku.php?id=measureit:install:linux:supervise

How to start measureit with supervise here:
http://71421.de/wiki/doku.php?id=measureit:install:linux:measureit

These are my private and not well documentated instructions. 
Detailed instructions and  a patched version from supervise will be in the next 
version from measureit

Original comment by lalelu...@gmail.com on 10 Dec 2012 at 5:33

GoogleCodeExporter commented 9 years ago
It works on my Raspberry Pi running Raspian Wheezy as in the OP

Original comment by rmcgovern095@gmail.com on 10 Dec 2012 at 6:26

Attachments:

GoogleCodeExporter commented 9 years ago
in the current setup the grabber process will be controlled by supervise from 
daemontools

it starts the grabber on system boot, control it and restart it if it is not 
running

Original comment by lalelu...@gmail.com on 17 Feb 2013 at 2:18