1 |
For quite a while I have used the following steps to perform a |
2 |
"single-user backup" |
3 |
|
4 |
1. Boot to single user mode via the grub command |
5 |
kernel /boot/vmlinuz root=/dev/sda6 single |
6 |
|
7 |
2. Type in the root password. |
8 |
|
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 |
13 |
|
14 |
4. This gets me to multi-user mode. |
15 |
|
16 |
I would like to automate this so that booting directly to multi-user |
17 |
mode via |
18 |
kernel /boot/vmlinuz root=/dev/sda6 |
19 |
|
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() |
26 |
|
27 |
Reading the gentoo handbook chapter B4.d "Writing Init Scripts" |
28 |
I find two comments criticizing this approach |
29 |
|
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". |
32 |
|
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." |
36 |
|
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 *". |
39 |
|
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. |
43 |
|
44 |
Any advice/comments would be welcome. |
45 |
|
46 |
thanks, |
47 |
allan |