From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OULWH-0002sU-Ph for garchives@archives.gentoo.org; Thu, 01 Jul 2010 15:17:43 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E97E5E0A45; Thu, 1 Jul 2010 15:17:16 +0000 (UTC) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) by pigeon.gentoo.org (Postfix) with ESMTP id A9C6AE0A45 for ; Thu, 1 Jul 2010 15:17:16 +0000 (UTC) Received: by fxm19 with SMTP id 19so1523159fxm.40 for ; Thu, 01 Jul 2010 08:17:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=zlIKznM7kQa2vrmXU5U5lx96Nz7DzNb+YGcpN54DWlo=; b=ikLMO1oRM8NCNhCw7fS6/6+BWqL3LhE3i5mEN3dS+rcbNZHefvsn66hvOQymsg2RuV EdRCI24Zg/C5BsLc+D9BqmtkFIdKttusMYpEINn7zAPB/c4y1UwgkmpQDM2s2onexDnD xerX2Pe6I2+dGSaEJVhB6HM3VMwhroSfGgEGE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Dr6me9ul01eklKQffyHwrxvalFvs53V9gvs2GLX5QJQpU9NvSw4sooyNGBel4SJQoc DpgNWCOvwGT17Ar0gXKs5v2aWQhMfN69Z8NCW98PsMjfAu7UolY9Cw10La6MaYgARszp 0exc9tWl+174vLmFbTAvCNpIC8536qhKCSIr0= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.204.33.88 with SMTP id g24mr7773397bkd.186.1277997435904; Thu, 01 Jul 2010 08:17:15 -0700 (PDT) Received: by 10.204.56.20 with HTTP; Thu, 1 Jul 2010 08:17:15 -0700 (PDT) In-Reply-To: <20100701151624.11bd166f@zaphod.digimed.co.uk> References: <20100701151624.11bd166f@zaphod.digimed.co.uk> Date: Thu, 1 Jul 2010 17:17:15 +0200 Message-ID: Subject: Re: [gentoo-user] activating swap by udev event From: SpaceCake To: gentoo-user@lists.gentoo.org Content-Type: multipart/alternative; boundary=00032555f4ee30e1d0048a54f7cc X-Archives-Salt: e77d0405-421a-4b31-9e25-900dd188a23b X-Archives-Hash: d1480372f004e4d256f81705d87c7fb9 --00032555f4ee30e1d0048a54f7cc Content-Type: text/plain; charset=ISO-8859-1 I've never created udev rule so the usal way does not tell me too much :) I've checked the net for examples but it looks like very complicated for me :) My usb stick looks like this Bus 007 Device 015: ID 058f:6387 Alcor Micro Corp. Transcend JetFlash Flash Drive Can you share with me some example how can I use this info on udev rules? Thanks Laszlo 2010/7/1 Neil Bothwick > On Thu, 1 Jul 2010 15:49:08 +0200, SpaceCake wrote: > > > I would like to increase the speed of my machine by putting some swap > > on a fast pendrive. It is working manually by starting a script > > > > swapon -s > > swapon -p -1 /dev/sdb1 > > swapoff /dev/sda6 > > swapon -p -2 /dev/sda6 > > swapon -s > > > > but, I would like to make it automatic by creating an udev rule, so > > when I plug in that device the swap space is automatically activated > > and the priority is changed. > > Create the udev rule in the usual way and add > > RUN="/path/to/your/script" > > You must use a full path when running a program from a udev rule and the > program should exit quickly as udev blocks while it is running. > > > -- > Neil Bothwick > > What colour is a chameleon on a mirror? > --00032555f4ee30e1d0048a54f7cc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I've never created udev rule so the usal way does not tell me too much = :) I've checked the net for examples but it looks like very complicated= for me :)

My usb stick looks like this

Bus 007 Device 015: I= D 058f:6387 Alcor Micro Corp. Transcend JetFlash Flash Drive

Can you share with me some example how can I use this info on udev rule= s?

Thanks
Laszlo


2010/7/1 N= eil Bothwick <ne= il@digimed.co.uk>
On Thu, 1 Jul 2010 15:49:08 +0200, SpaceCake wrote:

> I would like to increase the speed of my machine by putting some swap<= br> > on a fast pendrive. It is working manually by starting a script
>
> swapon -s
> swapon -p -1 /dev/sdb1
> swapoff /dev/sda6
> swapon -p -2 /dev/sda6
> swapon -s
>
> but, I would like to make it automatic by creating an udev rule, so > when I plug in that device the swap space is automatically activated > and the priority is changed.

Create the udev rule in the usual way and add

RUN=3D"/path/to/your/script"

You must use a full path when running a program from a udev rule and the program should exit quickly as udev blocks while it is running.


--
Neil Bothwick

What colour is a chameleon on a mirror?

--00032555f4ee30e1d0048a54f7cc--