~ubuntu-branches/debian/jessie/systemd/jessie

« back to all changes in this revision

Viewing changes to src/snapshot.c

  • Committer: Package Import Robot
  • Author(s): Tollef Fog Heen, Tollef Fog Heen, Michael Biebl
  • Date: 2012-04-03 19:59:17 UTC
  • mfrom: (1.1.10) (6.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20120403195917-l532urrbg4pkreas
Tags: 44-1
[ Tollef Fog Heen ]
* New upstream version.
  - Backport 3492207: journal: PAGE_SIZE is not known on ppc and other
    archs
  - Backport 5a2a2a1: journal: react with immediate rotation to a couple
    of more errors
  - Backport 693ce21: util: never follow symlinks in rm_rf_children()
    Fixes CVE-2012-1174, closes: #664364
* Drop output message from init-functions hook, it's pointless.
* Only rmdir /lib/init/rw if it exists.
* Explicitly order debian-fixup before sysinit.target to prevent a
  possible race condition with the creation of sockets.  Thanks to
  Michael Biebl for debugging this.
* Always restart the initctl socket on upgrades, to mask sysvinit
  removing it.

[ Michael Biebl ]
* Remove workaround for non-interactive sessions from pam config again.
* Create compat /dev/initctl symlink in case we are upgrading from a system
  running a newer version of sysvinit (using /run/initctl) and sysvinit is
  replaced with systemd-sysv during the upgrade. Closes: #663219
* Install new man pages.
* Build-Depend on valac (>= 0.12) instead of valac-0.12. Closes: #663323

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        Snapshot *s = SNAPSHOT(u);
37
37
 
38
38
        assert(s);
39
 
        assert(s->meta.load_state == UNIT_STUB);
 
39
        assert(UNIT(s)->load_state == UNIT_STUB);
40
40
 
41
 
        s->meta.ignore_on_isolate = true;
42
 
        s->meta.ignore_on_snapshot = true;
 
41
        UNIT(s)->ignore_on_isolate = true;
 
42
        UNIT(s)->ignore_on_snapshot = true;
43
43
}
44
44
 
45
45
static void snapshot_set_state(Snapshot *s, SnapshotState state) {
51
51
 
52
52
        if (state != old_state)
53
53
                log_debug("%s changed %s -> %s",
54
 
                          s->meta.id,
 
54
                          UNIT(s)->id,
55
55
                          snapshot_state_to_string(old_state),
56
56
                          snapshot_state_to_string(state));
57
57
 
62
62
        Snapshot *s = SNAPSHOT(u);
63
63
 
64
64
        assert(u);
65
 
        assert(u->meta.load_state == UNIT_STUB);
 
65
        assert(u->load_state == UNIT_STUB);
66
66
 
67
67
        /* Make sure that only snapshots created via snapshot_create()
68
68
         * can be loaded */
69
 
        if (!s->by_snapshot_create && s->meta.manager->n_reloading <= 0)
 
69
        if (!s->by_snapshot_create && UNIT(s)->manager->n_reloading <= 0)
70
70
                return -ENOENT;
71
71
 
72
 
        u->meta.load_state = UNIT_LOADED;
 
72
        u->load_state = UNIT_LOADED;
73
73
        return 0;
74
74
}
75
75
 
133
133
 
134
134
        unit_serialize_item(u, f, "state", snapshot_state_to_string(s->state));
135
135
        unit_serialize_item(u, f, "cleanup", yes_no(s->cleanup));
136
 
        SET_FOREACH(other, u->meta.dependencies[UNIT_WANTS], i)
137
 
                unit_serialize_item(u, f, "wants", other->meta.id);
 
136
        SET_FOREACH(other, u->dependencies[UNIT_WANTS], i)
 
137
                unit_serialize_item(u, f, "wants", other->id);
138
138
 
139
139
        return 0;
140
140
}
234
234
 
235
235
        SNAPSHOT(u)->by_snapshot_create = true;
236
236
        manager_dispatch_load_queue(m);
237
 
        assert(u->meta.load_state == UNIT_LOADED);
 
237
        assert(u->load_state == UNIT_LOADED);
238
238
 
239
239
        HASHMAP_FOREACH_KEY(other, k, m->units, i) {
240
240
 
241
 
                if (other->meta.ignore_on_snapshot)
 
241
                if (other->ignore_on_snapshot)
242
242
                        continue;
243
243
 
244
 
                if (k != other->meta.id)
 
244
                if (k != other->id)
245
245
                        continue;
246
246
 
247
247
                if (UNIT_VTABLE(other)->check_snapshot)
282
282
 
283
283
const UnitVTable snapshot_vtable = {
284
284
        .suffix = ".snapshot",
 
285
        .object_size = sizeof(Snapshot),
285
286
 
286
287
        .no_alias = true,
287
288
        .no_instances = true,