]>
Commit | Line | Data |
---|---|---|
7dc0704b DM |
1 | Index: new/src/lib/destroy.c |
2 | =================================================================== | |
508802f8 DM |
3 | --- new.orig/src/lib/destroy.c 2012-09-28 09:05:45.000000000 +0200 |
4 | +++ new/src/lib/destroy.c 2012-09-28 09:41:49.000000000 +0200 | |
5 | @@ -271,7 +271,7 @@ | |
7dc0704b DM |
6 | logger(0, 0, "Destroying container private area: %s", fs->private); |
7 | if ((ret = vps_destroy_dir(veid, fs->private))) | |
8 | return ret; | |
9 | - move_config(veid, BACKUP); | |
10 | + move_config(veid, DESTR_ALL); | |
211c83e2 DM |
11 | if (destroy_dumpfile(veid, cpt != NULL ? cpt->dumpdir : NULL) < 0) |
12 | logger(-1, errno, "Warning: failed to remove dump file"); | |
7dc0704b | 13 | if (rmdir(fs->root) < 0) |
7dc0704b DM |
14 | Index: new/include/util.h |
15 | =================================================================== | |
508802f8 DM |
16 | --- new.orig/include/util.h 2012-09-28 09:05:45.000000000 +0200 |
17 | +++ new/include/util.h 2012-09-28 09:41:49.000000000 +0200 | |
18 | @@ -24,6 +24,7 @@ | |
7dc0704b DM |
19 | |
20 | #define BACKUP 0 | |
21 | #define DESTR 1 | |
22 | +#define DESTR_ALL 2 | |
23 | ||
24 | #define PROCMEM "/proc/meminfo" | |
25 | #define PROCTHR "/proc/sys/kernel/threads-max" | |
26 | Index: new/src/lib/util.c | |
27 | =================================================================== | |
508802f8 DM |
28 | --- new.orig/src/lib/util.c 2012-09-28 09:05:45.000000000 +0200 |
29 | +++ new/src/lib/util.c 2012-09-28 09:41:49.000000000 +0200 | |
30 | @@ -613,7 +613,14 @@ | |
7dc0704b DM |
31 | |
32 | snprintf(conf, sizeof(conf), VPS_CONF_DIR "%d.%s", veid, prefix); | |
33 | snprintf(newconf, sizeof(newconf), "%s." DESTR_PREFIX, conf); | |
34 | - action == BACKUP ? rename(conf, newconf) : unlink(newconf); | |
35 | + if (action == BACKUP) { | |
36 | + rename(conf, newconf); | |
37 | + } else if (action == DESTR_ALL) { | |
38 | + unlink(conf); | |
39 | + unlink(newconf); | |
40 | + } else if (action == DESTR) { | |
41 | + unlink(newconf); | |
42 | + } | |
43 | } | |
44 | ||
45 | /* Renames or removes CT config and various CT scripts. |