public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Allan Gottlieb <gottlieb@nyu.edu>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] Performing a backup during the boot sequence
Date: Tue, 25 May 2010 18:30:51 -0400	[thread overview]
Message-ID: <yu9aarnbomc.fsf@nyu.edu> (raw)

For quite a while I have used the following steps to perform a
"single-user backup"

1.  Boot to single user mode via the grub command
        kernel /boot/vmlinuz root=/dev/sda6 single

2.  Type in the root password.

3.  Execute a single command
       /usr/local/sbin/ajg-backup-init-3
    which does the backup and then executes
       init 3

4.  This gets me to multi-user mode.

I would like to automate this so that booting directly to multi-user
mode via
        kernel /boot/vmlinuz root=/dev/sda6

All I need to do is to execute the single command
       /usr/local/sbin/ajg-backup-init-3
at the right moment.
This didn't seem hard; I want it after everything in boot but before
everything currently in default.  So I was going to put it in
default with a "before *" in depend()

Reading the gentoo handbook chapter B4.d "Writing Init Scripts"
I find two comments criticizing this approach

1.  "You can also use the "*" glob [argument to before] to catch all
    services in the same runlevel, although this isn't advisable".

2.  "Note: Make sure that --exec actually calls a service and not just a
    shell script that launches services and exits -- that's what the
    init script is supposed to do."

I can see problems with multiple "before *" directives, but no other
script has one so I think I would be OK with my "before *".

Criticism 2 has me concerned since my backup routing is indeed a shell
script that exits.  Indeed, my backup is not really a service so I am
worried that I shouldn't be using an initscript at all.

Any advice/comments would be welcome.

thanks,
allan




             reply	other threads:[~2010-05-25 22:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25 22:30 Allan Gottlieb [this message]
2010-05-26 15:17 ` [gentoo-user] Performing a backup during the boot sequence Daniel Troeder
2010-05-26 16:38   ` Allan Gottlieb

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=yu9aarnbomc.fsf@nyu.edu \
    --to=gottlieb@nyu.edu \
    --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