Quantcast
Channel: Planet Plone - Where Developers And Integrators Write
Viewing all articles
Browse latest Browse all 3535

Josh Birdwell: Getting Upstart to work on RPi

$
0
0
I already ran into this problem once where the raspberry would not boot up anymore after installing upstart:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=30&t=29447

After recovering the old image, I ran sudo apt-get upgrade to update roughtly 180 packages in raspberry. OMG this is like a 2-3 hour process!!!

Afterwards I checked the debian version with: cat /etc/debian_version and it was 7.0 … now its not like the debian version got upgraded and I didn't even really check the version before starting the package upgrades …

Plenty of warning against trying to install upstart:
http://forum.deluge-torrent.org/viewtopic.php?f=7&t=42743

But I feel like these threads are telling me that it should be OK now:

I searched to check for which version of upstart is available now:
$ apt-cache --full search upstart

Package: live-config-upstart
Source: live-config
Version: 3.0.23-1
Installed-Size: 60
Maintainer: Debian Live Project <debian-live@lists.debian.org>
Architecture: all
Replaces: live-config-backend
Provides: live-config-backend
Depends: upstart
Conflicts: live-config-backend
Size: 15578
SHA256: dbcf521f80c7a7123bb2cfdafed83f69cd3a1e17d833b792102bb2e39d69308d
SHA1: 5521f446dfe1f96301813017980b81095a1b4974
MD5sum: 1bfa36dce1a7e0551676fe25a6d96a84
Description: Live System Configuration Scripts (upstart backend)
Description-md5: 2044e6fe5850f37f0b26f59af8b3bae2
Section: misc
Priority: optional
Filename: pool/main/l/live-config/live-config-upstart_3.0.23-1_all.deb

Package: upstart
Version: 1.6.1-1
Architecture: armhf
Maintainer: Steve Langasek <vorlon@debian.org>
Installed-Size: 1136
Depends: libc6 (>= 2.13-28), libdbus-1-3 (>= 1.2.16), libjson0 (>= 0.10), libnih-dbus1 (>= 1.0.0), libnih1 (>= 1.0.0), libselinux1 (>= 1.32), libudev0 (>= 152), sysvinit-utils (>= 2.86.ds1-23), sysv-rc, initscripts, mountall, ifupdown (>= 0.7.3), udev (>= 175-7.1)
Suggests: python, graphviz, bash-completion
Conflicts: lxcguest, startup-tasks, system-services, sysvinit, upstart-compat-sysv, upstart-job
Breaks: cryptsetup (<< 2:1.4.3-4.1), friendly-recovery (<< 0.2.13), libc6 (<< 2.12.1-0ubuntu12)
Replaces: startup-tasks, system-services, sysvinit, upstart-compat-sysv, upstart-job
Provides: upstart-job
Multi-Arch: foreign
Priority: extra
Section: admin
Filename: pool/main/u/upstart/upstart_1.6.1-1_armhf.deb
Size: 502290
SHA256: 0f3cb426492fda661f6e9b9e0da401760d0cadf5983518c9ce3738e8827ccee2
SHA1: f5bcd339e61de1e3b0d83ffd0ead7256ce4bca16
MD5sum: 441a6b6fdadb1bb4e87fdd39a90c565b
Description: event-based init daemon
upstart is a replacement for the /sbin/init daemon which handles
starting of tasks and services during boot, stopping them during
shutdown and supervising them while the system is running.

Let's backup an image before I F-it-up again:
$ sudo dd if=/dev/rdisk1 of=~/Downloads/rpi/rpi_06_02_2013.alt.img bs=1m
7460+0 records in
7460+0 records out
7822376960 bytes transferred in 371.936084 secs (21031509 bytes/sec)
$ diskutil eject /dev/rdisk1
Disk /dev/rdisk1 ejected

Loading it back later if needed, can be done via:
$ sudo dd bs=1m if=~/Downloads/rpi/rpi_06_02_2013.alt.img of=/dev/rdisk1

ok moment of truth … again:
$ sudo apt-get install upstart
Reading package lists... Done
Building dependency tree     
Reading state information... Done
The following packages were automatically installed and are no longer required:
libblas3gf liblapack3gf
Use 'apt-get autoremove' to remove them.
Suggested packages:
graphviz
The following packages will be REMOVED:
sysvinit
The following NEW packages will be installed:
upstart
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
sysvinit
0 upgraded, 1 newly installed, 1 to remove and 1 not upgraded.
Need to get 502 kB of archives.
After this operation, 932 kB of additional disk space will be used.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
?] Yes, do as I say!
Get:1 http://archive.raspbian.org/raspbian/ wheezy/main upstart armhf 1.6.1-1 [502 kB]
Fetched 502 kB in 2s (251 kB/s)
dpkg: warning: overriding problem because --force enabled:
This is an essential package - it should not be removed.
(Reading database ... 69926 files and directories currently installed.)
Removing sysvinit ...
Processing triggers for man-db ...
Selecting previously unselected package upstart.
(Reading database ... 69900 files and directories currently installed.)
Unpacking upstart (from .../upstart_1.6.1-1_armhf.deb) ...
Processing triggers for man-db ...
Setting up upstart (1.6.1-1) ...



For my sake, I once again hope that this is true:
Easy transition and perfect backwards compatibility with sysvinit were explicit design goals.[2] As such, Upstart is able to run sysvinit scripts unmodified.

$ initctl list
initctl: Name "com.ubuntu.Upstart" does not exist
$ sudo initctl list
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused

They say that a reboot can fix this … lets hope i come out of it…

Yay! Great Success :) I was able to ssh into it after reboot!
No glaring errors in logs either: less /var/log/messages
Time to play around, some syntax:

$ initctl list | grep tomcat
tomcat start/running
tomcat-web-1 start/running, process 694
tomcat-web start/running

Look at our logs:
$ less /var/log/tomcat/web-1.log


Back it up again
$ df -h
$ diskutil unmount /dev/disk1s1
Volume (null) on disk1s1 unmounted
$ sudo dd if=/dev/rdisk1 of=~/Downloads/rpi/rpi_06_02_2013.2.img bs=1m
Password:
7460+0 records in
7460+0 records out
7822376960 bytes transferred in 402.733484 secs (19423210 bytes/sec)
$ diskutil eject /dev/rdisk1
Author: Pulkit Singhal

Viewing all articles
Browse latest Browse all 3535

Trending Articles