]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Remove snapshot unit type 1841/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 8 Nov 2015 13:12:54 +0000 (14:12 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 11 Nov 2015 00:33:06 +0000 (19:33 -0500)
Snapshots were never useful or used for anything. Many systemd
developers that I spoke to at systemd.conf2015, didn't even know they
existed, so it is fairly safe to assume that this type can be deleted
without harm.

The fundamental problem with snapshots is that the state of the system
is dynamic, devices come and go, users log in and out, timers fire...
and restoring all units to some state from the past would "undo"
those changes, which isn't really possible.

Tested by creating a snapshot, running the new binary, and checking
that the transition did not cause errors, and the snapshot is gone,
and snapshots cannot be created anymore.

New systemctl says:
Unknown operation snapshot.
Old systemctl says:
Failed to create snapshot: Support for snapshots has been removed.

IgnoreOnSnaphost settings are warned about and ignored:
Support for option IgnoreOnSnapshot= has been removed and it is ignored

http://lists.freedesktop.org/archives/systemd-devel/2015-November/034872.html

27 files changed:
Makefile-man.am
Makefile.am
man/systemctl.xml
man/systemd.snapshot.xml [deleted file]
man/systemd.unit.xml
man/systemd.xml
po/POTFILES.skip
shell-completion/bash/systemctl.in
shell-completion/zsh/_sd_unit_files
shell-completion/zsh/_systemctl.in
src/basic/unit-name.c
src/basic/unit-name.h
src/core/dbus-manager.c
src/core/dbus-snapshot.c [deleted file]
src/core/dbus-snapshot.h [deleted file]
src/core/dbus-unit.c
src/core/device.c
src/core/load-fragment-gperf.gperf.m4
src/core/manager.h
src/core/scope.c
src/core/service.c
src/core/snapshot.c [deleted file]
src/core/snapshot.h [deleted file]
src/core/unit.c
src/core/unit.h
src/systemctl/systemctl.c
src/test/test-tables.c

index 56aa0fff1bc8ed5db493786758feeaa10c70304f..c792c8932499feee2c6c5ecb1bb885abc8f73e53 100644 (file)
@@ -136,7 +136,6 @@ MANPAGES += \
        man/systemd.scope.5 \
        man/systemd.service.5 \
        man/systemd.slice.5 \
-       man/systemd.snapshot.5 \
        man/systemd.socket.5 \
        man/systemd.special.7 \
        man/systemd.swap.5 \
@@ -2413,7 +2412,6 @@ EXTRA_DIST += \
        man/systemd.scope.xml \
        man/systemd.service.xml \
        man/systemd.slice.xml \
-       man/systemd.snapshot.xml \
        man/systemd.socket.xml \
        man/systemd.special.xml \
        man/systemd.swap.xml \
index cec07fac27e6142637f99932b25f3850ebf16f8f..7f75e1ec98cc0d0732f98bc33861bd1ae4d7069e 100644 (file)
@@ -1138,8 +1138,6 @@ libcore_la_SOURCES = \
        src/core/bus-policy.h \
        src/core/target.c \
        src/core/target.h \
-       src/core/snapshot.c \
-       src/core/snapshot.h \
        src/core/device.c \
        src/core/device.h \
        src/core/mount.c \
@@ -1178,8 +1176,6 @@ libcore_la_SOURCES = \
        src/core/dbus-busname.h \
        src/core/dbus-target.c \
        src/core/dbus-target.h \
-       src/core/dbus-snapshot.c \
-       src/core/dbus-snapshot.h \
        src/core/dbus-device.c \
        src/core/dbus-device.h \
        src/core/dbus-mount.c \
index 2fe24fd139391616f4d2980f248dfd6c6a811ed1..173c463d12ae09e5028b4d2ea254d1c0d309f9fa 100644 (file)
@@ -1341,46 +1341,6 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
       </variablelist>
     </refsect2>
 
-    <refsect2>
-      <title>Snapshot Commands</title>
-
-      <variablelist>
-        <varlistentry>
-          <term><command>snapshot <optional><replaceable>NAME</replaceable></optional></command></term>
-
-          <listitem>
-            <para>Create a snapshot. If a snapshot name is specified,
-            the new snapshot will be named after it. If none is
-            specified, an automatic snapshot name is generated. In
-            either case, the snapshot name used is printed to standard
-            output, unless <option>--quiet</option> is specified.
-            </para>
-
-            <para>A snapshot refers to a saved state of the systemd
-            manager. It is implemented itself as a unit that is
-            generated dynamically with this command and has dependencies
-            on all units active at the time. At a later time, the user
-            may return to this state by using the
-            <command>isolate</command> command on the snapshot unit.
-            </para>
-
-            <para>Snapshots are only useful for saving and restoring
-            which units are running or are stopped, they do not
-            save/restore any other state. Snapshots are dynamic and lost
-            on reboot.</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term><command>delete <replaceable>PATTERN</replaceable>...</command></term>
-
-          <listitem>
-            <para>Remove a snapshot previously created with
-            <command>snapshot</command>.</para>
-          </listitem>
-        </varlistentry>
-      </variablelist>
-    </refsect2>
-
     <refsect2>
       <title>Environment Commands</title>
 
diff --git a/man/systemd.snapshot.xml b/man/systemd.snapshot.xml
deleted file mode 100644 (file)
index 96069c3..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version='1.0'?> <!--*-nxml-*-->
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
-  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
-
-<!--
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
--->
-
-<refentry id="systemd.snapshot">
-  <refentryinfo>
-    <title>systemd.snapshot</title>
-    <productname>systemd</productname>
-
-    <authorgroup>
-      <author>
-        <contrib>Developer</contrib>
-        <firstname>Lennart</firstname>
-        <surname>Poettering</surname>
-        <email>lennart@poettering.net</email>
-      </author>
-    </authorgroup>
-  </refentryinfo>
-
-  <refmeta>
-    <refentrytitle>systemd.snapshot</refentrytitle>
-    <manvolnum>5</manvolnum>
-  </refmeta>
-
-  <refnamediv>
-    <refname>systemd.snapshot</refname>
-    <refpurpose>Snapshot unit configuration</refpurpose>
-  </refnamediv>
-
-  <refsynopsisdiv>
-    <para><filename><replaceable>snapshot</replaceable>.snapshot</filename></para>
-  </refsynopsisdiv>
-
-  <refsect1>
-    <title>Description</title>
-
-    <para>Snapshot units are not configured via unit configuration
-    files. Nonetheless they are named similar to filenames. A unit
-    whose name ends in <literal>.snapshot</literal> refers to a
-    dynamic snapshot of the systemd runtime state.</para>
-
-    <para>Snapshots are not configured on disk but created dynamically
-    via <command>systemctl snapshot</command> (see
-    <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
-    for details) or an equivalent command. When created, they will
-    automatically get dependencies on the currently activated units.
-    They act as saved runtime state of the systemd manager. Later on,
-    the user may choose to return to the saved state via
-    <command>systemctl isolate</command>. They are useful to roll back
-    to a defined state after temporarily starting/stopping services or
-    similar.</para>
-  </refsect1>
-
-  <refsect1>
-      <title>See Also</title>
-      <para>
-        <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-        <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-        <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
-        <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
-      </para>
-  </refsect1>
-
-</refentry>
index 5c74318fec7b34a4894eced2d9a6455f3e0b926a..caba7ea69d098810735c706e0dd8b5f836eabd3d 100644 (file)
@@ -60,7 +60,6 @@
     <filename><replaceable>target</replaceable>.target</filename>,
     <filename><replaceable>path</replaceable>.path</filename>,
     <filename><replaceable>timer</replaceable>.timer</filename>,
-    <filename><replaceable>snapshot</replaceable>.snapshot</filename>,
     <filename><replaceable>slice</replaceable>.slice</filename>,
     <filename><replaceable>scope</replaceable>.scope</filename></para>
 
@@ -90,7 +89,7 @@
     swap file or partition, a start-up target, a watched file system
     path, a timer controlled and supervised by
     <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-    a temporary system state snapshot, a resource management slice or
+    a resource management slice or
     a group of externally created processes. The syntax is inspired by
     <ulink
     url="http://standards.freedesktop.org/desktop-entry-spec/latest/">XDG
     <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
     <citerefentry><refentrytitle>systemd.path</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
     <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
-    <citerefentry><refentrytitle>systemd.snapshot</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
-    <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+    <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
     <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
     </para>
 
         <option>false</option>.</para></listitem>
       </varlistentry>
 
-      <varlistentry>
-        <term><varname>IgnoreOnSnapshot=</varname></term>
-
-        <listitem><para>Takes a boolean argument. If
-        <option>true</option>, this unit will not be included in
-        snapshots. Defaults to <option>true</option> for device and
-        snapshot units, <option>false</option> for the
-        others.</para></listitem>
-      </varlistentry>
-
       <varlistentry>
         <term><varname>StopWhenUnneeded=</varname></term>
 
@@ -1431,7 +1419,6 @@ PrivateTmp=yes</programlisting>
       <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd.path</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
-      <citerefentry><refentrytitle>systemd.snapshot</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
index 08ce99d0ccd5baf133572e117a44f85d6d79db00..6de18f8294c6db374a645ba90269bd0b8fcffcc9 100644 (file)
       boot-up. See
       <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
 
-      <listitem><para>Snapshot units can be used to temporarily save
-      the state of the set of systemd units, which later may be
-      restored by activating the saved snapshot unit. For more
-      information, see
-      <citerefentry><refentrytitle>systemd.snapshot</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
-
       <listitem><para>Timer units are useful for triggering activation
       of other units based on timers. You may find details in
       <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
index 51254ec5333f2394a9b099ab9cae34f23b569e9a..b56a9984c4ce655db1c8b4cceea48658c92358c8 100644 (file)
@@ -6,7 +6,6 @@ src/core/dbus-mount.c
 src/core/dbus-path.c
 src/core/dbus-service.c
 src/core/dbus-slice.c
-src/core/dbus-snapshot.c
 src/core/dbus-socket.c
 src/core/dbus-swap.c
 src/core/dbus-target.c
index f9a4f2265ee31aa394033fa8de357c6e4e12c468..d80d8f02a810479bf736c39646690270eefd3038 100644 (file)
@@ -174,14 +174,12 @@ _systemctl () {
          [TARGET_AND_UNITS]='add-wants add-requires'
              [MASKED_UNITS]='unmask'
                      [JOBS]='cancel'
-                [SNAPSHOTS]='delete'
                      [ENVS]='set-environment unset-environment'
                [STANDALONE]='daemon-reexec daemon-reload default
                              emergency exit halt hibernate hybrid-sleep kexec list-jobs
                              list-sockets list-timers list-units list-unit-files poweroff
                              reboot rescue show-environment suspend get-default
                              is-system-running'
-                     [NAME]='snapshot'
                      [FILE]='link switch-root'
                   [TARGETS]='set-default'
         )
@@ -259,16 +257,12 @@ _systemctl () {
                 fi
                 compopt -o filenames
 
-        elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[NAME]}; then
+        elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
                 comps=''
 
         elif __contains_word "$verb" ${VERBS[JOBS]}; then
                 comps=$( __systemctl $mode list-jobs | { while read -r a b; do echo " $a"; done; } )
 
-        elif __contains_word "$verb" ${VERBS[SNAPSHOTS]}; then
-                comps=$( __systemctl $mode list-units --type snapshot --full --all \
-                        | { while read -r a b; do echo " $a"; done; } )
-
         elif __contains_word "$verb" ${VERBS[ENVS]}; then
                 comps=$( __systemctl $mode show-environment \
                     | while read -r line; do echo " ${line%%=*}=";done )
index 4778a0420d0d270823b65fa3ee2a6db452ace9a1..3e7a4ee803db5ccddedcaea7d67e95f01d84f837 100644 (file)
@@ -5,5 +5,5 @@ _sd_unit_files() {
     files=( '*:files:->files' )
 
     _description files expl 'unit file'
-    _files "$expl[@]" -g '*.(automount|busname|device|mount|path|service|snapshot|socket|swap|target|timer)'
+    _files "$expl[@]" -g '*.(automount|busname|device|mount|path|service|socket|swap|target|timer)'
 }
index 96f51a0ee0c0e5316e5846d2e83bfa818444b755..58c88c9d982dd28c3c31c6f13b86d181b7edba94 100644 (file)
@@ -43,8 +43,6 @@
     "is-enabled:Check whether unit files are enabled"
     "list-jobs:List jobs"
     "cancel:Cancel all, one, or more jobs"
-    "snapshot:Create a snapshot"
-    "delete:Remove one or more snapshots"
     "show-environment:Dump environment"
     "set-environment:Set one or more environment variables"
     "unset-environment:Unset one or more environment variables"
@@ -268,14 +266,6 @@ done
       _message "no jobs found"
 }
 
-# Completion functions for SNAPSHOTS
-(( $+functions[_systemctl_delete] )) || _systemctl_delete()
-{
-  _wanted systemd-snapshots expl snapshot \
-    compadd "$@" - ${${(f)"$(__systemctl list-units --type snapshot --all)"}%% *} ||
-      _message "no snapshots found"
-}
-
 # Completion functions for TARGETS
 (( $+functions[_systemctl_set-default] )) || _systemctl_set-default()
 {
@@ -310,7 +300,6 @@ done
 #    [STANDALONE]='daemon-reexec daemon-reload default
 #                  emergency exit halt kexec list-jobs list-units
 #                  list-unit-files poweroff reboot rescue show-environment'
-#         [NAME]='snapshot'
 
 _systemctl_caching_policy()
 {
index 710421508c991135cb66aea80a69fbe36832dc82..5007ecf1a4c477964d18dc20c2e672f7baa95332 100644 (file)
@@ -597,7 +597,6 @@ const char* unit_dbus_interface_from_type(UnitType t) {
                 [UNIT_SOCKET] = "org.freedesktop.systemd1.Socket",
                 [UNIT_BUSNAME] = "org.freedesktop.systemd1.BusName",
                 [UNIT_TARGET] = "org.freedesktop.systemd1.Target",
-                [UNIT_SNAPSHOT] = "org.freedesktop.systemd1.Snapshot",
                 [UNIT_DEVICE] = "org.freedesktop.systemd1.Device",
                 [UNIT_MOUNT] = "org.freedesktop.systemd1.Mount",
                 [UNIT_AUTOMOUNT] = "org.freedesktop.systemd1.Automount",
@@ -819,7 +818,6 @@ static const char* const unit_type_table[_UNIT_TYPE_MAX] = {
         [UNIT_SOCKET] = "socket",
         [UNIT_BUSNAME] = "busname",
         [UNIT_TARGET] = "target",
-        [UNIT_SNAPSHOT] = "snapshot",
         [UNIT_DEVICE] = "device",
         [UNIT_MOUNT] = "mount",
         [UNIT_AUTOMOUNT] = "automount",
@@ -950,13 +948,6 @@ static const char* const slice_state_table[_SLICE_STATE_MAX] = {
 
 DEFINE_STRING_TABLE_LOOKUP(slice_state, SliceState);
 
-static const char* const snapshot_state_table[_SNAPSHOT_STATE_MAX] = {
-        [SNAPSHOT_DEAD] = "dead",
-        [SNAPSHOT_ACTIVE] = "active"
-};
-
-DEFINE_STRING_TABLE_LOOKUP(snapshot_state, SnapshotState);
-
 static const char* const socket_state_table[_SOCKET_STATE_MAX] = {
         [SOCKET_DEAD] = "dead",
         [SOCKET_START_PRE] = "start-pre",
index 65b55d955464e47ab97992c80fbb419563f98706..5f6d8299c5d718a5ae7bed9bcba105941947f9a8 100644 (file)
@@ -32,7 +32,6 @@ typedef enum UnitType {
         UNIT_SOCKET,
         UNIT_BUSNAME,
         UNIT_TARGET,
-        UNIT_SNAPSHOT,
         UNIT_DEVICE,
         UNIT_MOUNT,
         UNIT_AUTOMOUNT,
@@ -165,13 +164,6 @@ typedef enum SliceState {
         _SLICE_STATE_INVALID = -1
 } SliceState;
 
-typedef enum SnapshotState {
-        SNAPSHOT_DEAD,
-        SNAPSHOT_ACTIVE,
-        _SNAPSHOT_STATE_MAX,
-        _SNAPSHOT_STATE_INVALID = -1
-} SnapshotState;
-
 typedef enum SocketState {
         SOCKET_DEAD,
         SOCKET_START_PRE,
@@ -366,9 +358,6 @@ ServiceState service_state_from_string(const char *s) _pure_;
 const char* slice_state_to_string(SliceState i) _const_;
 SliceState slice_state_from_string(const char *s) _pure_;
 
-const char* snapshot_state_to_string(SnapshotState i) _const_;
-SnapshotState snapshot_state_from_string(const char *s) _pure_;
-
 const char* socket_state_to_string(SocketState i) _const_;
 SocketState socket_state_from_string(const char *s) _pure_;
 
index 1f9f25093d39e525db0787046ff3bbfd463adcd7..eaa0fb2b376d2a02b5bab3a4404902511a16e454 100644 (file)
@@ -31,7 +31,6 @@
 #include "dbus-execute.h"
 #include "dbus-job.h"
 #include "dbus-manager.h"
-#include "dbus-snapshot.h"
 #include "dbus-unit.h"
 #include "dbus.h"
 #include "env-util.h"
@@ -1101,66 +1100,8 @@ static int method_dump(sd_bus_message *message, void *userdata, sd_bus_error *er
         return sd_bus_reply_method_return(message, "s", dump);
 }
 
-static int method_create_snapshot(sd_bus_message *message, void *userdata, sd_bus_error *error) {
-        _cleanup_free_ char *path = NULL;
-        Manager *m = userdata;
-        const char *name;
-        int cleanup;
-        Snapshot *s = NULL;
-        int r;
-
-        assert(message);
-        assert(m);
-
-        r = mac_selinux_access_check(message, "start", error);
-        if (r < 0)
-                return r;
-
-        r = sd_bus_message_read(message, "sb", &name, &cleanup);
-        if (r < 0)
-                return r;
-
-        if (isempty(name))
-                name = NULL;
-
-        r = bus_verify_manage_units_async(m, message, error);
-        if (r < 0)
-                return r;
-        if (r == 0)
-                return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
-
-        r = snapshot_create(m, name, cleanup, error, &s);
-        if (r < 0)
-                return r;
-
-        path = unit_dbus_path(UNIT(s));
-        if (!path)
-                return -ENOMEM;
-
-        return sd_bus_reply_method_return(message, "o", path);
-}
-
-static int method_remove_snapshot(sd_bus_message *message, void *userdata, sd_bus_error *error) {
-        Manager *m = userdata;
-        const char *name;
-        Unit *u;
-        int r;
-
-        assert(message);
-        assert(m);
-
-        r = sd_bus_message_read(message, "s", &name);
-        if (r < 0)
-                return r;
-
-        u = manager_get_unit(m, name);
-        if (!u)
-                return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s does not exist.", name);
-
-        if (u->type != UNIT_SNAPSHOT)
-                return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s is not a snapshot", name);
-
-        return bus_snapshot_method_remove(message, u, error);
+static int method_refuse_snapshot(sd_bus_message *message, void *userdata, sd_bus_error *error) {
+        return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Support for snapshots has been removed.");
 }
 
 static int method_reload(sd_bus_message *message, void *userdata, sd_bus_error *error) {
@@ -2042,8 +1983,8 @@ const sd_bus_vtable bus_manager_vtable[] = {
         SD_BUS_METHOD("Subscribe", NULL, NULL, method_subscribe, SD_BUS_VTABLE_UNPRIVILEGED),
         SD_BUS_METHOD("Unsubscribe", NULL, NULL, method_unsubscribe, SD_BUS_VTABLE_UNPRIVILEGED),
         SD_BUS_METHOD("Dump", NULL, "s", method_dump, SD_BUS_VTABLE_UNPRIVILEGED),
-        SD_BUS_METHOD("CreateSnapshot", "sb", "o", method_create_snapshot, SD_BUS_VTABLE_UNPRIVILEGED),
-        SD_BUS_METHOD("RemoveSnapshot", "s", NULL, method_remove_snapshot, SD_BUS_VTABLE_UNPRIVILEGED),
+        SD_BUS_METHOD("CreateSnapshot", "sb", "o", method_refuse_snapshot, SD_BUS_VTABLE_UNPRIVILEGED),
+        SD_BUS_METHOD("RemoveSnapshot", "s", NULL, method_refuse_snapshot, SD_BUS_VTABLE_UNPRIVILEGED),
         SD_BUS_METHOD("Reload", NULL, NULL, method_reload, SD_BUS_VTABLE_UNPRIVILEGED),
         SD_BUS_METHOD("Reexecute", NULL, NULL, method_reexecute, SD_BUS_VTABLE_UNPRIVILEGED),
         SD_BUS_METHOD("Exit", NULL, NULL, method_exit, 0),
diff --git a/src/core/dbus-snapshot.c b/src/core/dbus-snapshot.c
deleted file mode 100644 (file)
index cfe44c9..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include "selinux-access.h"
-#include "unit.h"
-#include "dbus.h"
-#include "snapshot.h"
-#include "dbus-snapshot.h"
-
-int bus_snapshot_method_remove(sd_bus_message *message, void *userdata, sd_bus_error *error) {
-        Snapshot *s = userdata;
-        int r;
-
-        assert(message);
-        assert(s);
-
-        r = mac_selinux_unit_access_check(UNIT(s), message, "stop", error);
-        if (r < 0)
-                return r;
-
-        r = bus_verify_manage_units_async(UNIT(s)->manager, message, error);
-        if (r < 0)
-                return r;
-        if (r == 0)
-                return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
-
-        snapshot_remove(s);
-
-        return sd_bus_reply_method_return(message, NULL);
-}
-
-const sd_bus_vtable bus_snapshot_vtable[] = {
-        SD_BUS_VTABLE_START(0),
-        SD_BUS_PROPERTY("Cleanup", "b", bus_property_get_bool, offsetof(Snapshot, cleanup), SD_BUS_VTABLE_PROPERTY_CONST),
-        SD_BUS_METHOD("Remove", NULL, NULL, bus_snapshot_method_remove, SD_BUS_VTABLE_UNPRIVILEGED),
-        SD_BUS_VTABLE_END
-};
diff --git a/src/core/dbus-snapshot.h b/src/core/dbus-snapshot.h
deleted file mode 100644 (file)
index 9288f44..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-#pragma once
-
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include "sd-bus.h"
-
-extern const sd_bus_vtable bus_snapshot_vtable[];
-
-int bus_snapshot_method_remove(sd_bus_message *message, void *userdata, sd_bus_error *error);
index 6320cd1aa95f57e6f4e5457507aac28ce6ed523b..827e13497ae813e2874875a84eec6c35ac62a14a 100644 (file)
@@ -671,7 +671,6 @@ const sd_bus_vtable bus_unit_vtable[] = {
         SD_BUS_PROPERTY("DefaultDependencies", "b", bus_property_get_bool, offsetof(Unit, default_dependencies), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("OnFailureJobMode", "s", property_get_job_mode, offsetof(Unit, on_failure_job_mode), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("IgnoreOnIsolate", "b", bus_property_get_bool, offsetof(Unit, ignore_on_isolate), SD_BUS_VTABLE_PROPERTY_CONST),
-        SD_BUS_PROPERTY("IgnoreOnSnapshot", "b", bus_property_get_bool, offsetof(Unit, ignore_on_snapshot), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("NeedDaemonReload", "b", property_get_need_daemon_reload, 0, SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("JobTimeoutUSec", "t", bus_property_get_usec, offsetof(Unit, job_timeout), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("JobTimeoutAction", "s", property_get_failure_action, offsetof(Unit, job_timeout_action), SD_BUS_VTABLE_PROPERTY_CONST),
index 23ee7aee7ef7213ce30f3fb88c1f1976c2d3d9c9..6b16521305d0b37e9209f8b890fc4fd84ce14ae6 100644 (file)
@@ -117,7 +117,6 @@ static void device_init(Unit *u) {
         u->job_timeout = u->manager->default_timeout_start_usec;
 
         u->ignore_on_isolate = true;
-        u->ignore_on_snapshot = true;
 }
 
 static void device_done(Unit *u) {
index 75388659e30c8d5deeb7a3417bd4ab4f47089c59..75b11ee4f237f25cbad36385941e683e0f6963da 100644 (file)
@@ -158,7 +158,7 @@ Unit.DefaultDependencies,        config_parse_bool,                  0,
 Unit.OnFailureJobMode,           config_parse_job_mode,              0,                             offsetof(Unit, on_failure_job_mode)
 Unit.OnFailureIsolate,           config_parse_job_mode_isolate,      0,                             offsetof(Unit, on_failure_job_mode)
 Unit.IgnoreOnIsolate,            config_parse_bool,                  0,                             offsetof(Unit, ignore_on_isolate)
-Unit.IgnoreOnSnapshot,           config_parse_bool,                  0,                             offsetof(Unit, ignore_on_snapshot)
+Unit.IgnoreOnSnapshot,           config_parse_warn_compat,           DISABLED_LEGACY,               0
 Unit.JobTimeoutSec,              config_parse_sec,                   0,                             offsetof(Unit, job_timeout)
 Unit.JobTimeoutAction,           config_parse_failure_action,        0,                             offsetof(Unit, job_timeout_action)
 Unit.JobTimeoutRebootArgument,   config_parse_string,                0,                             offsetof(Unit, job_timeout_reboot_arg)
index 38d2770e974eae4ead4c042f6326cfac67ff8cac..21307bb51774db4589c3dbdb7b4d0ed2db09191c 100644 (file)
@@ -141,8 +141,6 @@ struct Manager {
 
         sd_event_source *jobs_in_progress_event_source;
 
-        unsigned n_snapshots;
-
         LookupPaths lookup_paths;
         Set *unit_path_cache;
 
index 6bacb226e8887d2a9cdc97a54774b88356d7c430..c83530a1b05cff8cfe4f13be80082f6ec2a1f6cf 100644 (file)
@@ -54,7 +54,6 @@ static void scope_init(Unit *u) {
         s->timeout_stop_usec = u->manager->default_timeout_stop_usec;
 
         UNIT(s)->ignore_on_isolate = true;
-        UNIT(s)->ignore_on_snapshot = true;
 }
 
 static void scope_done(Unit *u) {
index 586eddd99a860a58e5b8f9f5be83dbbe44cd3439..74bbadd3ffeb8a316b8f288e87268547866ef8b7 100644 (file)
@@ -2365,14 +2365,6 @@ static bool service_check_gc(Unit *u) {
         return false;
 }
 
-_pure_ static bool service_check_snapshot(Unit *u) {
-        Service *s = SERVICE(u);
-
-        assert(s);
-
-        return s->socket_fd < 0;
-}
-
 static int service_retry_pid_file(Service *s) {
         int r;
 
@@ -3294,7 +3286,6 @@ const UnitVTable service_vtable = {
         .sub_state_to_string = service_sub_state_to_string,
 
         .check_gc = service_check_gc,
-        .check_snapshot = service_check_snapshot,
 
         .sigchld_event = service_sigchld_event,
 
diff --git a/src/core/snapshot.c b/src/core/snapshot.c
deleted file mode 100644 (file)
index ba3135f..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include <errno.h>
-
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "dbus-snapshot.h"
-#include "parse-util.h"
-#include "parse-util.h"
-#include "snapshot.h"
-#include "string-util.h"
-#include "unit-name.h"
-#include "unit.h"
-
-static const UnitActiveState state_translation_table[_SNAPSHOT_STATE_MAX] = {
-        [SNAPSHOT_DEAD] = UNIT_INACTIVE,
-        [SNAPSHOT_ACTIVE] = UNIT_ACTIVE
-};
-
-static void snapshot_init(Unit *u) {
-        Snapshot *s = SNAPSHOT(u);
-
-        assert(s);
-        assert(UNIT(s)->load_state == UNIT_STUB);
-
-        UNIT(s)->ignore_on_isolate = true;
-        UNIT(s)->ignore_on_snapshot = true;
-        UNIT(s)->allow_isolate = true;
-}
-
-static void snapshot_set_state(Snapshot *s, SnapshotState state) {
-        SnapshotState old_state;
-        assert(s);
-
-        old_state = s->state;
-        s->state = state;
-
-        if (state != old_state)
-                log_unit_debug(UNIT(s), "Changed %s -> %s", snapshot_state_to_string(old_state), snapshot_state_to_string(state));
-
-        unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], true);
-}
-
-static int snapshot_load(Unit *u) {
-        Snapshot *s = SNAPSHOT(u);
-
-        assert(u);
-        assert(u->load_state == UNIT_STUB);
-
-        /* Make sure that only snapshots created via snapshot_create()
-         * can be loaded */
-        if (!u->transient && UNIT(s)->manager->n_reloading <= 0)
-                return -ENOENT;
-
-        u->load_state = UNIT_LOADED;
-        return 0;
-}
-
-static int snapshot_coldplug(Unit *u) {
-        Snapshot *s = SNAPSHOT(u);
-
-        assert(s);
-        assert(s->state == SNAPSHOT_DEAD);
-
-        if (s->deserialized_state != s->state)
-                snapshot_set_state(s, s->deserialized_state);
-
-        return 0;
-}
-
-static void snapshot_dump(Unit *u, FILE *f, const char *prefix) {
-        Snapshot *s = SNAPSHOT(u);
-
-        assert(s);
-        assert(f);
-
-        fprintf(f,
-                "%sSnapshot State: %s\n"
-                "%sClean Up: %s\n",
-                prefix, snapshot_state_to_string(s->state),
-                prefix, yes_no(s->cleanup));
-}
-
-static int snapshot_start(Unit *u) {
-        Snapshot *s = SNAPSHOT(u);
-
-        assert(s);
-        assert(s->state == SNAPSHOT_DEAD);
-
-        snapshot_set_state(s, SNAPSHOT_ACTIVE);
-
-        if (s->cleanup)
-                unit_add_to_cleanup_queue(u);
-
-        return 1;
-}
-
-static int snapshot_stop(Unit *u) {
-        Snapshot *s = SNAPSHOT(u);
-
-        assert(s);
-        assert(s->state == SNAPSHOT_ACTIVE);
-
-        snapshot_set_state(s, SNAPSHOT_DEAD);
-        return 1;
-}
-
-static int snapshot_serialize(Unit *u, FILE *f, FDSet *fds) {
-        Snapshot *s = SNAPSHOT(u);
-        Unit *other;
-        Iterator i;
-
-        assert(s);
-        assert(f);
-        assert(fds);
-
-        unit_serialize_item(u, f, "state", snapshot_state_to_string(s->state));
-        unit_serialize_item(u, f, "cleanup", yes_no(s->cleanup));
-        SET_FOREACH(other, u->dependencies[UNIT_WANTS], i)
-                unit_serialize_item(u, f, "wants", other->id);
-
-        return 0;
-}
-
-static int snapshot_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) {
-        Snapshot *s = SNAPSHOT(u);
-        int r;
-
-        assert(u);
-        assert(key);
-        assert(value);
-        assert(fds);
-
-        if (streq(key, "state")) {
-                SnapshotState state;
-
-                state = snapshot_state_from_string(value);
-                if (state < 0)
-                        log_unit_debug(u, "Failed to parse state value: %s", value);
-                else
-                        s->deserialized_state = state;
-
-        } else if (streq(key, "cleanup")) {
-
-                r = parse_boolean(value);
-                if (r < 0)
-                        log_unit_debug(u, "Failed to parse cleanup value: %s", value);
-                else
-                        s->cleanup = r;
-
-        } else if (streq(key, "wants")) {
-
-                r = unit_add_two_dependencies_by_name(u, UNIT_AFTER, UNIT_WANTS, value, NULL, true);
-                if (r < 0)
-                        return r;
-        } else
-                log_unit_debug(u, "Unknown serialization key: %s", key);
-
-        return 0;
-}
-
-_pure_ static UnitActiveState snapshot_active_state(Unit *u) {
-        assert(u);
-
-        return state_translation_table[SNAPSHOT(u)->state];
-}
-
-_pure_ static const char *snapshot_sub_state_to_string(Unit *u) {
-        assert(u);
-
-        return snapshot_state_to_string(SNAPSHOT(u)->state);
-}
-
-int snapshot_create(Manager *m, const char *name, bool cleanup, sd_bus_error *e, Snapshot **_s) {
-        _cleanup_free_ char *n = NULL;
-        Unit *other, *u = NULL;
-        Iterator i;
-        int r;
-        const char *k;
-
-        assert(m);
-        assert(_s);
-
-        if (name) {
-                if (!unit_name_is_valid(name, UNIT_NAME_PLAIN))
-                        return sd_bus_error_setf(e, SD_BUS_ERROR_INVALID_ARGS, "Unit name %s is not valid.", name);
-
-                if (!endswith(name, ".snapshot"))
-                        return sd_bus_error_setf(e, SD_BUS_ERROR_INVALID_ARGS, "Unit name %s lacks snapshot suffix.", name);
-
-                if (manager_get_unit(m, name))
-                        return sd_bus_error_setf(e, BUS_ERROR_UNIT_EXISTS, "Snapshot %s exists already.", name);
-
-        } else {
-
-                for (;;) {
-                        if (asprintf(&n, "snapshot-%u.snapshot", ++ m->n_snapshots) < 0)
-                                return -ENOMEM;
-
-                        if (!manager_get_unit(m, n)) {
-                                name = n;
-                                break;
-                        }
-
-                        n = mfree(n);
-                }
-        }
-
-        r = manager_load_unit_prepare(m, name, NULL, e, &u);
-        if (r < 0)
-                goto fail;
-
-        u->transient = true;
-        manager_dispatch_load_queue(m);
-        assert(u->load_state == UNIT_LOADED);
-
-        HASHMAP_FOREACH_KEY(other, k, m->units, i) {
-
-                if (other->ignore_on_snapshot ||
-                    other->transient)
-                        continue;
-
-                if (k != other->id)
-                        continue;
-
-                if (UNIT_VTABLE(other)->check_snapshot)
-                        if (!UNIT_VTABLE(other)->check_snapshot(other))
-                            continue;
-
-                if (!UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other)))
-                        continue;
-
-                r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_WANTS, other, true);
-                if (r < 0)
-                        goto fail;
-        }
-
-        SNAPSHOT(u)->cleanup = cleanup;
-        *_s = SNAPSHOT(u);
-
-        log_unit_info(u, "Created snapshot.");
-
-        return 0;
-
-fail:
-        if (u)
-                unit_add_to_cleanup_queue(u);
-
-        return r;
-}
-
-void snapshot_remove(Snapshot *s) {
-        assert(s);
-
-        log_unit_info(UNIT(s), "Removing snapshot.");
-
-        unit_add_to_cleanup_queue(UNIT(s));
-}
-
-const UnitVTable snapshot_vtable = {
-        .object_size = sizeof(Snapshot),
-
-        .no_alias = true,
-        .no_instances = true,
-        .no_gc = true,
-
-        .init = snapshot_init,
-        .load = snapshot_load,
-
-        .coldplug = snapshot_coldplug,
-
-        .dump = snapshot_dump,
-
-        .start = snapshot_start,
-        .stop = snapshot_stop,
-
-        .serialize = snapshot_serialize,
-        .deserialize_item = snapshot_deserialize_item,
-
-        .active_state = snapshot_active_state,
-        .sub_state_to_string = snapshot_sub_state_to_string,
-
-        .bus_vtable = bus_snapshot_vtable
-};
diff --git a/src/core/snapshot.h b/src/core/snapshot.h
deleted file mode 100644 (file)
index bd52dea..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-#pragma once
-
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-typedef struct Snapshot Snapshot;
-
-#include "unit.h"
-
-struct Snapshot {
-        Unit meta;
-
-        SnapshotState state, deserialized_state;
-
-        bool cleanup;
-};
-
-extern const UnitVTable snapshot_vtable;
-
-int snapshot_create(Manager *m, const char *name, bool cleanup, sd_bus_error *e, Snapshot **s);
-void snapshot_remove(Snapshot *s);
index 6c130d4cd16eaf99f4bae081602842ec52445338..4def96b0c11e9aa3ad582b09fa1672d6a6d14c6d 100644 (file)
@@ -63,7 +63,6 @@ const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX] = {
         [UNIT_SOCKET] = &socket_vtable,
         [UNIT_BUSNAME] = &busname_vtable,
         [UNIT_TARGET] = &target_vtable,
-        [UNIT_SNAPSHOT] = &snapshot_vtable,
         [UNIT_DEVICE] = &device_vtable,
         [UNIT_MOUNT] = &mount_vtable,
         [UNIT_AUTOMOUNT] = &automount_vtable,
@@ -998,15 +997,13 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
                         "%s\tRefuseManualStop: %s\n"
                         "%s\tDefaultDependencies: %s\n"
                         "%s\tOnFailureJobMode: %s\n"
-                        "%s\tIgnoreOnIsolate: %s\n"
-                        "%s\tIgnoreOnSnapshot: %s\n",
+                        "%s\tIgnoreOnIsolate: %s\n",
                         prefix, yes_no(u->stop_when_unneeded),
                         prefix, yes_no(u->refuse_manual_start),
                         prefix, yes_no(u->refuse_manual_stop),
                         prefix, yes_no(u->default_dependencies),
                         prefix, job_mode_to_string(u->on_failure_job_mode),
-                        prefix, yes_no(u->ignore_on_isolate),
-                        prefix, yes_no(u->ignore_on_snapshot));
+                        prefix, yes_no(u->ignore_on_isolate));
 
                 if (UNIT_VTABLE(u)->dump)
                         UNIT_VTABLE(u)->dump(u, f, prefix2);
index 6f775c5ce100a539119336b080cb28879ffe0060..6455f201b4d3639b67cad446a78821e8bfd19904 100644 (file)
@@ -203,9 +203,6 @@ struct Unit {
         /* Ignore this unit when isolating */
         bool ignore_on_isolate;
 
-        /* Ignore this unit when snapshotting */
-        bool ignore_on_snapshot;
-
         /* Did the last condition check succeed? */
         bool condition_result;
         bool assert_result;
@@ -248,7 +245,6 @@ typedef enum UnitSetPropertiesMode {
 #include "socket.h"
 #include "busname.h"
 #include "target.h"
-#include "snapshot.h"
 #include "device.h"
 #include "automount.h"
 #include "swap.h"
@@ -343,9 +339,6 @@ struct UnitVTable {
          * shall release its runtime resources */
         void (*release_resources)(Unit *u);
 
-        /* Return true when this unit is suitable for snapshotting */
-        bool (*check_snapshot)(Unit *u);
-
         /* Invoked on every child that died */
         void (*sigchld_event)(Unit *u, pid_t pid, int code, int status);
 
@@ -443,7 +436,6 @@ DEFINE_CAST(SERVICE, Service);
 DEFINE_CAST(SOCKET, Socket);
 DEFINE_CAST(BUSNAME, BusName);
 DEFINE_CAST(TARGET, Target);
-DEFINE_CAST(SNAPSHOT, Snapshot);
 DEFINE_CAST(DEVICE, Device);
 DEFINE_CAST(MOUNT, Mount);
 DEFINE_CAST(AUTOMOUNT, Automount);
index 70871cf3e64a32431685f875c6e7ee2334497113..3918d7e79b61800e973017aaddd15d3a5ab7c7f7 100644 (file)
@@ -4905,102 +4905,6 @@ static int set_property(int argc, char *argv[], void *userdata) {
         return 0;
 }
 
-static int snapshot(int argc, char *argv[], void *userdata) {
-        _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
-        _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-        _cleanup_free_ char *n = NULL, *id = NULL;
-        const char *path;
-        sd_bus *bus;
-        int r;
-
-        polkit_agent_open_if_enabled();
-
-        if (argc > 1) {
-                r = unit_name_mangle_with_suffix(argv[1], UNIT_NAME_NOGLOB, ".snapshot", &n);
-                if (r < 0)
-                        return log_error_errno(r, "Failed to generate unit name: %m");
-        } else {
-                n = strdup("");
-                if (!n)
-                        return log_oom();
-        }
-
-        r = acquire_bus(BUS_MANAGER, &bus);
-        if (r < 0)
-                return r;
-
-        r = sd_bus_call_method(
-                        bus,
-                        "org.freedesktop.systemd1",
-                        "/org/freedesktop/systemd1",
-                        "org.freedesktop.systemd1.Manager",
-                        "CreateSnapshot",
-                        &error,
-                        &reply,
-                        "sb", n, false);
-        if (r < 0)
-                return log_error_errno(r, "Failed to create snapshot: %s", bus_error_message(&error, r));
-
-        r = sd_bus_message_read(reply, "o", &path);
-        if (r < 0)
-                return bus_log_parse_error(r);
-
-        r = sd_bus_get_property_string(
-                        bus,
-                        "org.freedesktop.systemd1",
-                        path,
-                        "org.freedesktop.systemd1.Unit",
-                        "Id",
-                        &error,
-                        &id);
-        if (r < 0)
-                return log_error_errno(r, "Failed to get ID of snapshot: %s", bus_error_message(&error, r));
-
-        if (!arg_quiet)
-                puts(id);
-
-        return 0;
-}
-
-static int delete_snapshot(int argc, char *argv[], void *userdata) {
-        _cleanup_strv_free_ char **names = NULL;
-        sd_bus *bus;
-        char **name;
-        int r;
-
-        polkit_agent_open_if_enabled();
-
-        r = acquire_bus(BUS_MANAGER, &bus);
-        if (r < 0)
-                return r;
-
-        r = expand_names(bus, strv_skip(argv, 1), ".snapshot", &names);
-        if (r < 0)
-                return log_error_errno(r, "Failed to expand names: %m");
-
-        STRV_FOREACH(name, names) {
-                _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
-                int q;
-
-                q = sd_bus_call_method(
-                                bus,
-                                "org.freedesktop.systemd1",
-                                "/org/freedesktop/systemd1",
-                                "org.freedesktop.systemd1.Manager",
-                                "RemoveSnapshot",
-                                &error,
-                                NULL,
-                                "s", *name);
-                if (q < 0) {
-                        log_error_errno(q, "Failed to remove snapshot %s: %s", *name, bus_error_message(&error, q));
-                        if (r == 0)
-                                r = q;
-                }
-        }
-
-        return r;
-}
-
 static int daemon_reload(int argc, char *argv[], void *userdata) {
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         const char *method;
@@ -6381,9 +6285,6 @@ static void systemctl_help(void) {
                "Job Commands:\n"
                "  list-jobs [PATTERN...]          List jobs\n"
                "  cancel [JOB...]                 Cancel all, one, or more jobs\n\n"
-               "Snapshot Commands:\n"
-               "  snapshot [NAME]                 Create a snapshot\n"
-               "  delete NAME...                  Remove one or more snapshots\n\n"
                "Environment Commands:\n"
                "  show-environment                Dump environment\n"
                "  set-environment NAME=VALUE...   Set one or more environment variables\n"
@@ -6525,11 +6426,6 @@ static void help_states(void) {
         for (i = 0; i < _SLICE_STATE_MAX; i++)
                 puts(slice_state_to_string(i));
 
-        if (!arg_no_legend)
-                puts("\nAvailable snapshot unit substates:");
-        for (i = 0; i < _SNAPSHOT_STATE_MAX; i++)
-                puts(snapshot_state_to_string(i));
-
         if (!arg_no_legend)
                 puts("\nAvailable socket unit substates:");
         for (i = 0; i < _SOCKET_STATE_MAX; i++)
@@ -7460,8 +7356,6 @@ static int systemctl_main(int argc, char *argv[]) {
                 { "cat",                   2,        VERB_ANY, 0,            cat               },
                 { "status",                VERB_ANY, VERB_ANY, 0,            show              },
                 { "help",                  VERB_ANY, VERB_ANY, 0,            show              },
-                { "snapshot",              VERB_ANY, 2,        0,            snapshot          },
-                { "delete",                2,        VERB_ANY, 0,            delete_snapshot   },
                 { "daemon-reload",         VERB_ANY, 1,        0,            daemon_reload     },
                 { "daemon-reexec",         VERB_ANY, 1,        0,            daemon_reload     },
                 { "show-environment",      VERB_ANY, 1,        0,            show_environment  },
index ed4abdbf12e2d627ca50b0e7e1d72a070594db13..da27cde3dabfd5735f682a4ad33bbcaf25cfb39f 100644 (file)
@@ -39,7 +39,6 @@
 #include "scope.h"
 #include "service.h"
 #include "slice.h"
-#include "snapshot.h"
 #include "socket-util.h"
 #include "socket.h"
 #include "swap.h"
@@ -98,7 +97,6 @@ int main(int argc, char **argv) {
         test_table(service_state, SERVICE_STATE);
         test_table(service_type, SERVICE_TYPE);
         test_table(slice_state, SLICE_STATE);
-        test_table(snapshot_state, SNAPSHOT_STATE);
         test_table(socket_address_bind_ipv6_only, SOCKET_ADDRESS_BIND_IPV6_ONLY);
         test_table(socket_exec_command, SOCKET_EXEC_COMMAND);
         test_table(socket_result, SOCKET_RESULT);