summaryrefslogtreecommitdiffstats
path: root/appliance/init
Commit message (Collapse)AuthorAgeFilesLines
* appliance: Update paths to udevd.Richard W.M. Jones2012-07-021-1/+3
| | | | | systemd is playing a WTF game with udevd, moving it around and renaming it unnecessarily in each release. Chase all known locations.
* virtio-scsi: Increase udev timeout.Richard W.M. Jones2012-06-141-1/+1
| | | | | In Koji, when you've got 200+ disks, udev times out before all the udev events have been processed.
* appliance: 'udevd' has been renamed, since it joined systemd.Richard W.M. Jones2012-05-281-28/+29
|
* appliance: Remove some unnecessary errors.Richard W.M. Jones2012-04-251-2/+4
| | | | | | | | | | | | virt-rescue prints errors such as: rm: cannot remove `/proc': Is a directory mkdir: cannot create directory `/proc': File exists rm: cannot remove `/sys': Is a directory mkdir: cannot create directory `/sys': File exists People have reported these errors (which are nothing to worry about) as bugs in the past, so avoid them where possible.
* appliance: Enhance --enable-valgrind-daemon with a suppressions file.Richard W.M. Jones2012-03-141-1/+4
| | | | This lets us suppress errors in system libraries.
* Test fails in arch linuxNikos Skalkotos2012-03-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --20cf303ea4a84a7a7c04ba331375 Content-Type: text/plain; charset=ISO-8859-1 Hello Richard, I found what the problem was and the udev symlinks where not created. The init script in the appliance uses a full paths for udevadm (/sbin/udevadm) which in my case was wrong. In Arch Linux udevadm is hosted under /usr/bin, not /sbin. When I fixed this, libguestfs was able to communicate with the appliance VM. Since PATH variable is defined and exported in init, there is no need in using full paths for external programs. As far as I've seen this affects all the git branches in libguestfs's repository. Please find attached a patch for the master branch. Nikos Skalkotos, Athens, Greece On 24 February 2012 10:25, Richard W.M. Jones <rjones@redhat.com> wrote: > On Thu, Feb 23, 2012 at 08:50:12PM +0200, Nikos Skalkotos wrote: > [...] > > I don't know specifically why it fails with ArchLinux, but the problem > is caused by the /dev/virtio-ports/* symlinks not getting created by > udev. > > /dev/vport0p1 exists: > > > crw------- 1 root root 252, 1 Feb 23 18:17 vport0p1 > > but udev doesn't make the corresponding /dev/virtio-ports symlink: > > > /dev/virtio-ports/org.libguestfs.channel.0: No such file or directory > > The symlink is supposed to be created by this udev rule: > > /lib/udev/rules.d/50-udev-default.rules:KERNEL=="vport*", > ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" > > So I'd start by looking to see if that rule exists in the udev rules > that Arch is using. Secondly if it does exist, is the corresponding > *.rules being copied into the appliance? (Check appliance/supermin.d/ > hostfiles) > > In an old Ubuntu that has udev that predates having this rule, we add > the following patch: > > > http://libguestfs.org/download/binaries/ubuntu1004-packages/0002-ubuntu-10.04-Use-dev-vport0p1.patch > > Rich. > > -- > Richard Jones, Virtualization Group, Red Hat > http://people.redhat.com/~rjones > virt-p2v converts physical machines to virtual machines. Boot with a > live CD or over the network (PXE) and turn machines into Xen guests. > http://et.redhat.com/~rjones/virt-p2v > Hello Richard,<br><br>I found what the problem was and the udev symlinks where not created. The init script in the appliance uses a full paths for udevadm (/sbin/udevadm) which in my case was wrong. In Arch Linux udevadm is hosted under /usr/bin, not /sbin. When I fixed this, libguestfs was able to communicate with the appliance VM.<br> <br>Since PATH variable is defined and exported in init, there is no need in using full paths for external programs. As far as I&#39;ve seen this affects all the git branches in libguestfs&#39;s repository. Please find attached a patch for the master branch.<br> <br>Nikos Skalkotos,<br>Athens, Greece<br><br><div class="gmail_quote">On 24 February 2012 10:25, Richard W.M. Jones <span dir="ltr">&lt;<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> On Thu, Feb 23, 2012 at 08:50:12PM +0200, Nikos Skalkotos wrote:<br> [...]<br> <br> I don&#39;t know specifically why it fails with ArchLinux, but the problem<br> is caused by the /dev/virtio-ports/* symlinks not getting created by<br> udev.<br> <br> /dev/vport0p1 exists:<br> <div class="im"><br> &gt; crw------- 1 root root 252,   1 Feb 23 18:17 vport0p1<br> <br> </div>but udev doesn&#39;t make the corresponding /dev/virtio-ports symlink:<br> <div class="im"><br> &gt; /dev/virtio-ports/org.libguestfs.channel.0: No such file or directory<br> <br> </div>The symlink is supposed to be created by this udev rule:<br> <br> /lib/udev/rules.d/50-udev-default.rules:KERNEL==&quot;vport*&quot;, ATTR{name}==&quot;?*&quot;, SYMLINK+=&quot;virtio-ports/$attr{name}&quot;<br> <br> So I&#39;d start by looking to see if that rule exists in the udev rules<br> that Arch is using.  Secondly if it does exist, is the corresponding<br> *.rules being copied into the appliance?  (Check appliance/supermin.d/<br> hostfiles)<br> <br> In an old Ubuntu that has udev that predates having this rule, we add<br> the following patch:<br> <br> <a href="http://libguestfs.org/download/binaries/ubuntu1004-packages/0002-ubuntu-10.04-Use-dev-vport0p1.patch" target="_blank">http://libguestfs.org/download/binaries/ubuntu1004-packages/0002-ubuntu-10.04-Use-dev-vport0p1.patch</a><br> <br> Rich.<br> <span class="HOEnZb"><font color="#888888"><br> --<br> Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/%7Erjones%0Avirt-p2v" target="_blank">http://people.redhat.com/~rjones<br> virt-p2v</a> converts physical machines to virtual machines.  Boot with a<br> live CD or over the network (PXE) and turn machines into Xen guests.<br> <a href="http://et.redhat.com/%7Erjones/virt-p2v" target="_blank">http://et.redhat.com/~rjones/virt-p2v</a><br> </font></span></blockquote></div><br>
* appliance: udev >= 176 now requires /dev to be a devtmpfs.Richard W.M. Jones2012-01-271-0/+3
| | | | | See this udev commit: https://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=220893b3cbdbf8932f95c44811b169a8f0d33939
* appliance: Switch to using 'iproute' ('ip' command) from 'net-tools' ↵Jiri Popelka2012-01-251-5/+9
| | | | | | | | | (RHBZ#784647). Change 'ifconfig' and 'netstat' commands to use 'ip' instead. 'iproute' was already included in the appliance, so this reduces the size of the appliance accordingly.
* Enable running the daemon under valgrind.Richard W.M. Jones2012-01-241-1/+9
| | | | | | | | | | | | | | | | | This commit allows you to run the daemon under valgrind. You have to enable it at configure time: ./configure --enable-valgrind-daemon This should *not* be done for production builds. When this feature is enabled, valgrind is added to the appliance and the daemon is run under valgrind. Log messages from valgrind are passed back over a virtio-serial channel into a file called 'valgrind.log.$PID' in the top build directory. Running 'make check', 'make extra-tests' etc causes many valgrind.log.* files to be created which must be examined by hand.
* New API: list-md-devices.Matthew Booth2011-11-111-0/+3
| | | | | | | Return a list of Linux MD devices detected in the guest. This API complements list_devices, list_partitions, list_lvs and list_dm_devices.
* appliance: udev-174 moves udevd to /lib/udev/udevd (instead of /sbin/udevd)Richard W.M. Jones2011-10-201-0/+5
|
* Ubuntu 11.10: Create /run and /run/lock if not already.Richard W.M. Jones2011-10-181-0/+1
| | | | In real machines these directories are a ramdisk.
* Create /sys directory if it doesn't exist already.Richard W.M. Jones2011-09-011-0/+1
| | | | Ubuntu 10.04 LTS packages don't create /sys.
* init: Remove timeout in udevadm settle command.Richard W.M. Jones2011-06-081-1/+1
| | | | | | | | | | The given timeout (10s) was too low if the appliance was running slowly, which caused a cascade of other failures during tests. Note that in udev-171 and above on Fedora, /sbin/start_udev no longer exists, so now we are using this manual method to start udevd.
* daemon: Remove -f (don't fork) option.Richard W.M. Jones2011-02-031-1/+1
| | | | This option was not being used.
* debian: Work around warning in Debian udev init script.Richard W.M. Jones2010-12-101-0/+5
| | | | | See also: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=606622
* appliance: Disable setting scheduler to noop.Richard Jones2010-09-131-1/+3
| | | | | | This is a workaround until https://bugzilla.redhat.com/show_bug.cgi?id=630583 is fixed (bug in Linux 2.6.36).
* ubuntu: /proc can be a symlinkRichard Jones2010-09-131-0/+1
| | | | | If it's a symlink then the succeeding mount commnd will fail. Remove it and make a /proc directory.
* appliance: init script does 'ls -lR /dev' (verbose only)Richard Jones2010-09-061-1/+1
| | | | | It's useful to see what files are in /dev subdirectories at boot, eg. for looking at virtio-serial ports.
* Shut down the appliance cleanlyMatthew Booth2010-08-261-1/+1
| | | | | | | | | | | | When guestfsd exits, or the user exits the virt-rescue shell, the init script exits which causes the kernel to panic. This isn't really a functional issue, as all useful work is done by this point. However, it does cause virt-rescue to display an unsightly error message. This patch causes the appliance to power off cleanly before the init script exits. Note it actually does a reboot rather than a poweroff. This is because ACPI is disabled in the appliance, meaning poweroff doesn't work, but qemu is configured not to restart on reboot.
* Call sync after guestfsd exitsMatthew Booth2010-08-261-21/+24
| | | | | | | | Core files are not reliably written to disk if guestfsd dumps core. This patch makes libguestfs do the same appliance cleanup for guestfsd and virt-rescue, which seems to fix the matter. It also removes a redundant sleep and additional sync when exiting virt-rescue.
* Don't print debug messages when not in verbose mode.Richard Jones2010-08-241-15/+17
| | | | Don't print them because no one's listening ...
* Use the noop scheduler inside the appliance.Richard Jones2010-06-071-0/+3
| | | | | | | | | In my limited tests, this seems to make a small but noticable difference, improving the performance of some straightforward read operations by a little over 10%. For more information see: http://kbase.redhat.com/faq/docs/DOC-5428
* ubuntu: Use direct udevd method to start udev on Ubuntu.Richard Jones2010-05-201-1/+1
| | | | | | | | | On Ubuntu, /etc/init.d/udev is a symlink to an upstart file, but running that causes the appliance to hang. Therefore detect if this is a symlink and fall through to the direct start of udevd. This shouldn't affect Debian because the file is not a symlink on standard Debian.
* Unify supermin appliance building using febootstrap 2.7Richard Jones2010-05-131-0/+2
|
* Use link-local addresses between appliance and host (RHBZ#588763).Richard Jones2010-05-041-2/+2
|
* Fix time and timezone to be correct within the appliance.Richard Jones2010-04-121-1/+8
|
* rescue: Pass $TERM from library into the virt-rescue appliance.Richard Jones2010-03-261-1/+1
| | | | | We set it on the kernel command line, then get it out from there when the rescue appliance boots.
* rescue: Sync disk on exit, and improve messaging.Richard Jones2010-03-261-1/+10
|
* appliance: Set $PATH instead of hard-coding paths to binaries everywhere.Richard Jones2010-03-261-1/+2
| | | | | | Change the appliance so PATH includes common directories. Thus we don't need to hard-code paths to binaries (eg. "/sbin/fdisk") everywhere.
* Use 'service' if installedGuido Günther2010-02-241-1/+10
| | | | | | | | | | | | | | | | | | | | | Hi, attached patch should make: http://git.debian.org/?p=pkg-libvirt/libguestfs.git;a=blob;f=debian/patches/0003-appliance-Use-service-udev-start-instead-of-running-.patch;h=c9e6b8489807d4fb1247cb6a8b6f9799bad2a09e;hb=d3a21b5b6850fc3c6e7903d0f5cafa3eb4197d49 http://git.debian.org/?p=pkg-libvirt/libguestfs.git;a=blob;f=debian/patches/0004-Ubuntu-Prefer-starting-udev-by-hand-instead-of-using.patch;h=64b65a971b186e6ab1c9351e94b46d6f5aa242e0;hb=d3a21b5b6850fc3c6e7903d0f5cafa3eb4197d49 superflous. If there's an init script it uses 'service' or falls back to calling the init script directly if it isn't there, otherwise it starts udev directly. Tested on Debian only so far. The patch is based on Rich's above two patches. Cheers, -- Guido From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org> Date: Tue, 23 Feb 2010 18:49:34 +0100 Subject: [PATCH] Check for service and use it if it's there Based on Richard's two patches for the Ubuntu build.
* appliance: Print uptime.Richard Jones2009-11-181-2/+4
| | | | | Print the uptime just before the init script runs the daemon, so we have a good idea of how long the kernel boot + init script takes to run.
* init: Check that start_udev succeededMatthew Booth2009-10-211-2/+2
| | | | | | | If start_udev fails for any reason, notice and fall through to manual /dev creation. Patch from Charles Duffy <charles@dyfis.net>
* Add 'virt-rescue' command.Richard Jones2009-09-231-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This command runs a "rescue appliance" against a virtual machine or disk image. This is useful for making ad-hoc interactive changes to virtual machines. $ virt-rescue --ro /dev/vg_trick/F11x64 Welcome to virt-rescue, the libguestfs rescue shell. Note: The contents of / are the rescue appliance. You have to mount the guest's partitions under /sysroot before you will be able to examine them. bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell ><rescue> mount /dev/vg_f11x64/lv_root /sysroot EXT4-fs (dm-0): barriers enabled kjournald2 starting: pid 269, dev dm-0:8, commit interval 5 seconds EXT4-fs (dm-0): internal journal on dm-0:8 EXT4-fs (dm-0): delayed allocation enabled EXT4-fs: file extents enabled EXT4-fs: mballoc enabled EXT4-fs (dm-0): mounted filesystem with ordered data mode ><rescue> ls /sysroot/ bin dev home lib64 media opt root selinux sys usr boot etc lib lost+found mnt proc sbin srv tmp var ><rescue> exit
* Tidy up appliance rescue code.Richard Jones2009-09-231-3/+7
| | | | | The appliance shouldn't run the daemon after we leave the rescue shell. It should just exit instead.
* If using SELinux, mount /selinux in the appliance.Richard Jones2009-08-121-0/+4
| | | | | | If selinux=1 on the Linux kernel command line, then we mount /selinux in the appliance. We will also bind-mount this directory into guests when we run commands.
* Add contents of /proc/mounts to the debugging information.Richard Jones2009-08-111-0/+1
|
* appliance: More debug added to /init.Richard Jones2009-08-061-0/+2
|
* appliance: Include more debug output in the /init script.Richard Jones2009-08-061-5/+12
| | | | | Output more debugging information from this script, to enhance the usefulness of LIBGUESTFS_DEBUG output.
* Improve virtio-blk performance (RHBZ#509383).Richard W.M. Jones2009-07-021-0/+3
|
* unconditionally load dm moduleGuido Günther2009-07-021-1/+1
| | | | needed for device mapper (LVM)
* Use udev if available (Guido Gunter).Guido Günther2009-06-301-19/+28
| | | | Added support for Fedora's udev (Richard Jones).
* Add whitespace to the init script (no functional change).Richard Jones2009-06-221-1/+10
|
* Issue MAKEDEV commands in a loop (RHBZ#507374).Richard Jones2009-06-221-2/+6
|
* Move init script into a separate file.Richard W.M. Jones2009-06-191-0/+28