public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Florian Philipp <lists@binarywings.net>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Run command after root mounted ro?
Date: Wed, 10 Aug 2011 17:00:22 +0200	[thread overview]
Message-ID: <4E429D06.1090706@binarywings.net> (raw)
In-Reply-To: <4E41D912.5040509@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]

Am 10.08.2011 03:04, schrieb Daniel Frey:
> On 01/-10/37 11:59, Florian Philipp wrote:
>> Remounting root read-only is done by an init script called mount-ro
>> which is started in runlevel shutdown. Try to add a custom init script
>> to your /etc/init.d directory with the following content:
>>
>> #!/sbin/runscript
>> depend()
>> {
>>  after mount-ro
>> }
>> start()
>> {
>>  ebegin 'Shutting down mdadm'
>>  mdadm --wait-clean --scan
>>  eend $?
>> }
>>
>> Add it to the runlevel with `rc-update add <your-script> shutdown` and
>> don't forget to mark it executable.
>>
>> Disclaimer: I've not tried this (obviously) and if the script eats your
>> dog and wreaks your system, it is entirely your fault ;)
> 
> 
> Thanks, I tried this out, and while it does run after mounting ro, it
> just hangs. I've noticed that it's supposed to be monitoring
> /proc/mdstat but it was (presumably) unmounted long ago.
> 
> I guess I have to do some more experimenting.
> 
> Dan
> 
> 
> 

Try remounting proc in your new init script. You have to advice mount to
not try adding it to /etc/mtab since that would obviously fail.
mount --no-mtab -t proc proc /proc

Hope this helps,
Florian Philipp


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

      reply	other threads:[~2011-08-10 15:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-09 19:30 [gentoo-user] Run command after root mounted ro? Daniel Frey
2011-08-09 19:50 ` Florian Philipp
2011-08-10  1:04   ` Daniel Frey
2011-08-10 15:00     ` Florian Philipp [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E429D06.1090706@binarywings.net \
    --to=lists@binarywings.net \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox