Pino Toscano
2013-Dec-12 13:34 UTC
Re: [Libguestfs] [PATCH] sysprep: handle distro specific sysv scripts
Hello, (sorry for the late reply, I was not involved in libugestfs until recently.) On Friday 21 September 2012 20:00:34 Olaf Hering wrote:> Currently firstboot would only work on redhat-based images. > Handle redhat-based, suse-based and debian guests, error out in case > of an unknown distro. > Update firstboot.sh: > - make sure scripts exists and can be executed > - add LSB header to avoid insserv warnings later on > - run script only if called with "start" > Update functions, pass only required options. > > Signed-off-by: Olaf Hering <olaf@aepfle.de> > > diff --git a/sysprep/firstboot.ml b/sysprep/firstboot.ml > index 97cd8a9..c5296a1 100644 > --- a/sysprep/firstboot.ml > +++ b/sysprep/firstboot.ml > @@ -28,14 +28,35 @@ let firstboot_dir = "/usr/lib/virt-sysprep" > let firstboot_sh = sprintf "\ > #!/bin/sh - > > +### BEGIN INIT INFO > +# Provides: virt-sysprep > +# Required-Start: $null > +# Should-Start: $all > +# Required-Stop: $null > +# Should-Stop: $allThis basically means that the firstboot script can be executed ahead of anything else; thus doing something like virt-builder debian-7 --firstboot-command "du -hcs /usr/share/doc" can fail because of /usr not mounted yet. Likewise for other kind of commands. I understand that this functionality might be used to do simple stuff, but still IMHO it would be better to have it run after all the other facilities (at least the standard ones) are available, so I would propose to change the written LSB header into: # Required-Start: $all # Should-Start: $null # Required-Stop: $null # Should-Stop: $null (or just remove the two Should-* and leave Required-Stop blank) What do you think? (Firstboot scripts are not working in Debian anyway, see #1019388.) -- Pino Toscano
Olaf Hering
2013-Dec-12 13:49 UTC
Re: [Libguestfs] [PATCH] sysprep: handle distro specific sysv scripts
On Thu, Dec 12, Pino Toscano wrote:> What do you think?I think that your Should-Start handling is broken. Required means the given file can not properly work without the listed servers, insserv will error out. Should means it can very well work without them if they are not present or enabled. Otherwise the given file has to be scheduled after the listed services. Olaf
Pino Toscano
2013-Dec-12 13:56 UTC
Re: [Libguestfs] [PATCH] sysprep: handle distro specific sysv scripts
On Thursday 12 December 2013 14:49:36 Olaf Hering wrote:> On Thu, Dec 12, Pino Toscano wrote: > > What do you think? > > I think that your Should-Start handling is broken. Required means the > given file can not properly work without the listed servers, insserv > will error out. Should means it can very well work without them if > they are not present or enabled. Otherwise the given file has to be > scheduled after the listed services.Sure, and I said there's no guarantee that the firstboot command can work without any of the other system services. What if my command requires the system time to be set, but it is scheduled by insserv before $time is available? -- Pino Toscano
Seemingly Similar Threads
- Re: [PATCH] sysprep: handle distro specific sysv scripts
- Re: [PATCH] sysprep: handle distro specific sysv scripts
- [PATCH] sysprep: handle distro specific sysv scripts
- Re: [PATCH] sysprep: handle distro specific sysv scripts
- Re: [PATCH] sysprep: handle distro specific sysv scripts