Closed ubuntu-server-builder closed 1 year ago
Launchpad user KIM JUNHO(wnsgh611) wrote on 2018-03-02T05:23:56.027018+00:00
Launchpad attachments: I followed step 3 and 4
Launchpad user Scott Moser(smoser) wrote on 2018-03-08T22:27:13.369863+00:00
Hi, Without looking much further I suspect you're right in that your attempts to insert the rc service do not work on the "current" boot.
You can run earlier in boot with 'bootcmd' rathre than 'runcmd', but I suspect even then your inserting of rc jobs will be too late.
I suggest just inserting the jobs as you are, and then "manually" starting them in a runcmd entry.
Please let me know if you think there is something that cloud-init could reasonably do here to support this issue, and then set the state back to New.
Scott
Launchpad user KIM JUNHO(wnsgh611) wrote on 2018-04-17T12:55:35.204175+00:00
Hi,
I read your answer and understood that cloud-init does not support rc module in current version.
So, if there is a chance, how about supporting rc-script module in cloud-init? If run-level script formats are different from linux-distribution, it would be hard to implement, but most of them have similar format.
Launchpad user Scott Moser(smoser) wrote on 2018-04-17T14:51:24.678550+00:00
while cloud-init is in a position that it could provide a layer of indirection between multiple init systems, we're not really interested in doing so at this point.
I wouldn't be opposed to accepting patches that implemented a way
to insert sysvinit jobs and make sure they started (if the system
was sysvinit).
That is not likely to make our teams development roadmap, but you're
free to work on it and contribute. We do have a similar function
for upstart jobs.
I suspect that what you are doing is close to working, and would proably "just work" on reboot.
So what I'm suggesting you do is add to your runcmd:
Launchpad user Launchpad Janitor(janitor) wrote on 2018-06-17T04:17:31.018160+00:00
[Expired for cloud-init because there has been no activity for 60 days.]
This bug was originally filed in Launchpad as LP: #1752789
Launchpad details
Launchpad user KIM JUNHO(wnsgh611) wrote on 2018-03-02T05:23:56.027018+00:00
Hi, I'm newbie on cloud-init. I used qemu-system-x86_64 using kvm and cloud-init for provisioning ubuntu-cloud-image. I want to file system mount using 9p file system. If I want to use it, I need to put my path on the qemu starting command like '-fsdev .. something like that' and in the virtual machine, I need to mount using 9p type file system using mount command. So, I choose using ubuntu run-level script which is writing script on the init.d and use update-rc.d command. When I tried to normal script file such as 'touch /blah/blah', it worked properly.
Also, it wrote successfully into file, and execute that script, it works (which means that it can attach 9p-filesystem, just it does not work on first time boot).
However, when I tried to attach 9p-file system. It does not working. When I reboot the instance, it successfully attched the file system. So, I reasonably consider that cloud-init cannot working properly before boot. Rest of this issue detail is the detail I follow the guideline.
Many thanks :)
-> Ubuntu 16.04 cloud xenial-amd64 img
Content-Type: multipart/mixed; boundary="==BOUNDARY==" MIME-Version: 1.0
--==BOUNDARY== MIME-Version: 1.0 Content-Type: text/cloud-config; charset="us-ascii"
cloud-config
users:
root disable_root: False chpasswd: list:
!/bin/bash
BEGIN INIT INFO
Provides: ceph-9p-script-0
Required-Start: $all
Required-Stop:
Default-start: 2 3 5
Default-stop:
Short-Description: 9p fileStorage Mount Script
Description: 9p fileStorage Mount Script
END INIT INFO
mkdir -p /root/test; mount -t 9p -o trans=virtio,version=9p2000.L host_share_0 /root/test
!/bin/bash
BEGIN INIT INFO
Provides: startscript
Required-Start: $all
Required-Stop:
Default-start: 2 3 5
Default-stop:
Short-Description: Vm Custom Start Script
Description: Vm Custom Start Script
END INIT INFO
timeout 5s /root/start.sh
!/bin/bash
touch /root/startTest
runcmd:
merge_type: 'list(append)+dict(recurse_array,no_replace)+str()'
--==BOUNDARY==--
Run: cloud-init collect
If your cloud-init does not have that sub command, then please collect: dmesg > dmesg.txt journalctl -o short-precise > journal.txt tar -cvf cloud-init.tar dmesg.txt journal.txt /var/log/cloud-init.log /var/log/cloud-init-output.log /run/cloud-init
======== I attached as a file.
I masked some string for sensitive data. But, it does not matter for watch you log.