Bug 3518

Summary: /etc/init.d/urandom service fails to start and stop
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ming Liu <ming.liu>
Component: coreAssignee: Ming Liu <ming.liu>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: corneliux.stoicescu, meta.mr.watcher, meta.watcher, sgw, song.liu, zhenfeng.zhao
Version: 1.4   
Target Milestone: 1.4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Ming Liu 2012-11-30 09:42:44 UTC
Build a core-image-minimal, deploy it in qemu, failed information as follow:

$ /etc/init.d/urandom start
urandom start: failed.
$ /etc/init.d/urandom stop
urandom stop: failed.

This issue arises because "/etc/init.d/urandom" script wanna save random-seed into /var/lib/urandom folder which does not exist in the file system.

There are two ways fixing it:
1) use a available directory instead of /var/lib/urandom, like:
   /var/lib/misc (as SUSE does)
   /var/lib (as Redhat/Fedora does)

2) add /var/lib/urandom into initscript meta's exported list. (similar to Ubuntu)

I personally prefer to method 1.
Comment 1 Stoicescu Cornel 2012-12-03 11:46:15 UTC
Can you please specify the branch/commit on which you tested this on? Thank you :)
Comment 2 Saul Wold 2012-12-03 22:14:06 UTC
As was mentioned in an email reply to this, it could also be added to the initscripts populate-volatile, I think that keeping it in /var/lib/urandom more closely matches the /usr/lib/<package> approach.
Comment 3 Ming Liu 2012-12-04 01:44:58 UTC
(In reply to comment #1)
> Can you please specify the branch/commit on which you tested this on? Thank
> you :)

I tested it on commit 99f003356be43bb361634359a5d3c520f72f0a08 of master. :)
Comment 4 Ming Liu 2012-12-04 05:14:17 UTC
(In reply to comment #2)
> As was mentioned in an email reply to this, it could also be added to the
> initscripts populate-volatile, I think that keeping it in /var/lib/urandom
> more closely matches the /usr/lib/<package> approach.

Yes, I am on board. It seems a more reasonable solution.
Comment 6 Stoicescu Cornel 2013-02-26 12:21:45 UTC
Tested in master:7d22ef28e64de06b6238d0ef9b664c0bee6efa46

/etc/init.d/urandom does not work:

root@jasperforest:~# /etc/init.d/urandom
root@jasperforest:~# /etc/init.d/urandom start
root@jasperforest:~# ps aux | grep urandom
root       813  0.0  0.0   4432   616 pts/0    S+   08:19   0:00 grep urandom
root@jasperforest:~# /etc/init.d/urandom start
root@jasperforest:~# /etc/init.d/urandom stop
root@jasperforest:~# /etc/init.d/urandom stop
root@jasperforest:~#
Comment 7 Ming Liu 2013-02-27 01:49:44 UTC
hi, corneliux:

Do you mean there should be a daemon while /etc/init.d/urandom is started? But it's not supposed to be used like that, it's a single shot script, that attempting to get a random-seed from /dev/urandom when it's start/stop.
Comment 8 Stoicescu Cornel 2013-02-27 11:06:55 UTC
Hello Ming,

Indeed the script does not provide output. I tested urandom with the following scenario and it works:

cat /dev/urandom

I am sorry for my undocumented mistake.
Comment 9 Stoicescu Cornel 2013-02-27 11:07:50 UTC
Verified in master:7d22ef28e64de06b6238d0ef9b664c0bee6efa46