Gentoo Archives: gentoo-user

From: Allan Gottlieb <gottlieb@×××.edu>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Performing a backup during the boot sequence
Date: Tue, 25 May 2010 22:31:28
1 For quite a while I have used the following steps to perform a
2 "single-user backup"
4 1. Boot to single user mode via the grub command
5 kernel /boot/vmlinuz root=/dev/sda6 single
7 2. Type in the root password.
9 3. Execute a single command
10 /usr/local/sbin/ajg-backup-init-3
11 which does the backup and then executes
12 init 3
14 4. This gets me to multi-user mode.
16 I would like to automate this so that booting directly to multi-user
17 mode via
18 kernel /boot/vmlinuz root=/dev/sda6
20 All I need to do is to execute the single command
21 /usr/local/sbin/ajg-backup-init-3
22 at the right moment.
23 This didn't seem hard; I want it after everything in boot but before
24 everything currently in default. So I was going to put it in
25 default with a "before *" in depend()
27 Reading the gentoo handbook chapter B4.d "Writing Init Scripts"
28 I find two comments criticizing this approach
30 1. "You can also use the "*" glob [argument to before] to catch all
31 services in the same runlevel, although this isn't advisable".
33 2. "Note: Make sure that --exec actually calls a service and not just a
34 shell script that launches services and exits -- that's what the
35 init script is supposed to do."
37 I can see problems with multiple "before *" directives, but no other
38 script has one so I think I would be OK with my "before *".
40 Criticism 2 has me concerned since my backup routing is indeed a shell
41 script that exits. Indeed, my backup is not really a service so I am
42 worried that I shouldn't be using an initscript at all.
44 Any advice/comments would be welcome.
46 thanks,
47 allan


Subject Author
Re: [gentoo-user] Performing a backup during the boot sequence Daniel Troeder <daniel@×××××××××.com>