From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9242B138F88 for ; Thu, 27 Feb 2014 18:28:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4ACACE0B8C; Thu, 27 Feb 2014 18:28:03 +0000 (UTC) Received: from mail-lb0-f195.google.com (mail-lb0-f195.google.com [209.85.217.195]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0D4AAE0B68 for ; Thu, 27 Feb 2014 18:28:01 +0000 (UTC) Received: by mail-lb0-f195.google.com with SMTP id w7so690086lbi.2 for ; Thu, 27 Feb 2014 10:28:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=Dv/nTSW/A0UoC6+YlZzKwMB9XJeTy65BGRmRwJsPj8E=; b=q4FdNBTJg3ielDrgqqW/ngP2bEDqcxKXJ1yhVpoFQY0qpW5v16P7hfcuntmr3jDTPy u3WBEgRTpWcMjJnLBec838jHLG3g+VY2eW66p/MpMSmGni7KDiADMKjTblMWsQLgmcMB pNn73jK9ts9NZVR6q/215qpyJqe2rqktT6u8aap7hudpCphhz3QuV+QVAGZkSR3DiUgx 2wewBlu/F8GlJRedsShntfRQir6E5aY3lsncy4AKNRY6Optlny0Pp9Pwt8QEIAudSmCq OYkIlvcZbhwPcRJm/4gzXjyGQQ6CVQeqHhDwdJHJGOgS812Qcfc27PFDeQW9s6k8669L v8Qw== 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 X-Received: by 10.112.166.68 with SMTP id ze4mr2402892lbb.58.1393525680578; Thu, 27 Feb 2014 10:28:00 -0800 (PST) Received: by 10.114.176.36 with HTTP; Thu, 27 Feb 2014 10:28:00 -0800 (PST) In-Reply-To: References: Date: Thu, 27 Feb 2014 12:28:00 -0600 Message-ID: Subject: Re: [gentoo-user] Modifying Suspend Script? From: =?UTF-8?B?Q2FuZWsgUGVsw6FleiBWYWxkw6lz?= To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: bd817233-4d19-49d6-9034-65f154ffcca2 X-Archives-Hash: 83e65a9ededd4d14377fe1b59f703a9b On Wed, Feb 26, 2014 at 8:35 PM, Lee wrote: > Hi, I always need to reconnect my laptop pcmcia wireless card to my WAP w= hen > awaking from suspend. Something similar happens with my bluetooth dongle; I need to stop the service, unload the kernel module, load it again, and start the service once more. > It would be nice if I could add two commands, ifconfig > and dhpcd, to the script which controls awaking from suspend. Anyone know > which file I can edit? Others have already gave you answers. I do not believe you use systemd; but for whomever else that does, I leave this here: systemd has a set of directories (one for sleep, another for hibernate, and a third one for "hybrid" modes), where you can drop any executable you want to be executed in any of those situations. From [1]: """ Immediately before entering system suspend and/or hibernation systemd-suspend.service (and the other mentioned units, respectively) will run all executables in /usr/lib/systemd/system-sleep/ and pass two arguments to them. The first argument will be "pre", the second either "suspend", "hibernate", or "hybrid-sleep" depending on the chosen action. Immediately after leaving system suspend and/or hibernation the same executables are run, but the first argument is now "post". All executables in this directory are executed in parallel, and execution of the action is not continued until all executables have finished. """ My bluetooth problem gets fixed with a little executable script in /usr/lib/systemd/system-sleep: #!/bin/bash case "$1" in "post") sleep 3 systemctl stop bluetooth.service rmmod rfcomm rmmod bnep rmmod btusb rmmod bluetooth modprobe bluetooth modprobe btusb modprobe bnep modprobe rfcomm systemctl start bluetooth.service ;; esac exit 0 Regards. [1] http://www.freedesktop.org/software/systemd/man/systemd-sleep.html --=20 Canek Pel=C3=A1ez Vald=C3=A9s Posgrado en Ciencia e Ingenier=C3=ADa de la Computaci=C3=B3n Universidad Nacional Aut=C3=B3noma de M=C3=A9xico