chiark / gitweb /
Remove src/basic/special.h, as all defines in there are systemd-only.
authorSven Eden <yamakuzure@gmx.net>
Tue, 7 Feb 2017 05:50:04 +0000 (06:50 +0100)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:23:13 +0000 (10:23 +0100)
src/basic/cgroup-util.c
src/basic/special.h [deleted file]
src/core/cgroup.c
src/login/logind-dbus.c
src/login/logind-user.c
src/login/logind-utmp.c

index 95f6faf81acad490069f4aa267616b86051de804..f8386f01c62a17e79440754b9f1bdf7463e0c714 100644 (file)
@@ -37,7 +37,7 @@
 #include "path-util.h"
 #include "unit-name.h"
 #include "fileio.h"
-#include "special.h"
+// #include "special.h"
 #include "mkdir.h"
 #include "login-util.h"
 #include "cgroup-util.h"
@@ -1155,7 +1155,7 @@ int cg_mangle_path(const char *path, char **result) {
 }
 
 int cg_get_root_path(char **path) {
-        char *p, *e;
+        char *p; //, *e;
         int r;
 
         assert(path);
@@ -1164,6 +1164,8 @@ int cg_get_root_path(char **path) {
         if (r < 0)
                 return r;
 
+/// elogind does not support systemd scopes and slices
+#if 0
         e = endswith(p, "/" SPECIAL_INIT_SCOPE);
         if (!e)
                 e = endswith(p, "/" SPECIAL_SYSTEM_SLICE); /* legacy */
@@ -1171,6 +1173,7 @@ int cg_get_root_path(char **path) {
                 e = endswith(p, "/system"); /* even more legacy */
         if (e)
                 *e = 0;
+#endif // 0
 
         *path = p;
         return 0;
diff --git a/src/basic/special.h b/src/basic/special.h
deleted file mode 100644 (file)
index fe377fb..0000000
+++ /dev/null
@@ -1,120 +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/>.
-***/
-
-#define SPECIAL_DEFAULT_TARGET "default.target"
-
-/* Shutdown targets */
-#define SPECIAL_UMOUNT_TARGET "umount.target"
-/* This is not really intended to be started by directly. This is
- * mostly so that other targets (reboot/halt/poweroff) can depend on
- * it to bring all services down that want to be brought down on
- * system shutdown. */
-#define SPECIAL_SHUTDOWN_TARGET "shutdown.target"
-// #define SPECIAL_HALT_TARGET "halt.target"
-// #define SPECIAL_POWEROFF_TARGET "poweroff.target"
-// #define SPECIAL_REBOOT_TARGET "reboot.target"
-// #define SPECIAL_KEXEC_TARGET "kexec.target"
-#define SPECIAL_EXIT_TARGET "exit.target"
-// #define SPECIAL_SUSPEND_TARGET "suspend.target"
-// #define SPECIAL_HIBERNATE_TARGET "hibernate.target"
-// #define SPECIAL_HYBRID_SLEEP_TARGET "hybrid-sleep.target"
-
-/* Special boot targets */
-#define SPECIAL_RESCUE_TARGET "rescue.target"
-#define SPECIAL_EMERGENCY_TARGET "emergency.target"
-#define SPECIAL_MULTI_USER_TARGET "multi-user.target"
-#define SPECIAL_GRAPHICAL_TARGET "graphical.target"
-
-/* Early boot targets */
-#define SPECIAL_SYSINIT_TARGET "sysinit.target"
-#define SPECIAL_SOCKETS_TARGET "sockets.target"
-#define SPECIAL_BUSNAMES_TARGET "busnames.target"
-#define SPECIAL_TIMERS_TARGET "timers.target"
-#define SPECIAL_PATHS_TARGET "paths.target"
-#define SPECIAL_LOCAL_FS_TARGET "local-fs.target"
-#define SPECIAL_LOCAL_FS_PRE_TARGET "local-fs-pre.target"
-#define SPECIAL_INITRD_FS_TARGET "initrd-fs.target"
-#define SPECIAL_INITRD_ROOT_FS_TARGET "initrd-root-fs.target"
-#define SPECIAL_REMOTE_FS_TARGET "remote-fs.target"       /* LSB's $remote_fs */
-#define SPECIAL_REMOTE_FS_PRE_TARGET "remote-fs-pre.target"
-#define SPECIAL_SWAP_TARGET "swap.target"
-#define SPECIAL_NETWORK_ONLINE_TARGET "network-online.target"
-#define SPECIAL_TIME_SYNC_TARGET "time-sync.target"       /* LSB's $time */
-#define SPECIAL_BASIC_TARGET "basic.target"
-
-/* LSB compatibility */
-#define SPECIAL_NETWORK_TARGET "network.target"           /* LSB's $network */
-#define SPECIAL_NSS_LOOKUP_TARGET "nss-lookup.target"     /* LSB's $named */
-#define SPECIAL_RPCBIND_TARGET "rpcbind.target"           /* LSB's $portmap */
-
-/*
- * Rules regarding adding further high level targets like the above:
- *
- * - Be conservative, only add more of these when we really need
- *   them. We need strong usecases for further additions.
- *
- * - When there can be multiple implementations running side-by-side,
- *   it needs to be a .target unit which can pull in all
- *   implementations.
- *
- * - If something can be implemented with socket activation, and
- *   without, it needs to be a .target unit, so that it can pull in
- *   the appropriate unit.
- *
- * - Otherwise, it should be a .service unit.
- *
- * - In some cases it is OK to have both a .service and a .target
- *   unit, i.e. if there can be multiple parallel implementations, but
- *   only one is the "system" one. Example: syslog.
- *
- * Or to put this in other words: .service symlinks can be used to
- * arbitrate between multiple implementations if there can be only one
- * of a kind. .target units can be used to support multiple
- * implementations that can run side-by-side.
- */
-
-/* Magic early boot services */
-#define SPECIAL_FSCK_SERVICE "systemd-fsck@.service"
-#define SPECIAL_QUOTACHECK_SERVICE "systemd-quotacheck.service"
-#define SPECIAL_QUOTAON_SERVICE "quotaon.service"
-#define SPECIAL_REMOUNT_FS_SERVICE "systemd-remount-fs.service"
-
-/* Services systemd relies on */
-#define SPECIAL_DBUS_SERVICE "dbus.service"
-#define SPECIAL_DBUS_SOCKET "dbus.socket"
-#define SPECIAL_JOURNALD_SOCKET "systemd-journald.socket"
-#define SPECIAL_JOURNALD_SERVICE "systemd-journald.service"
-
-/* Magic init signals */
-#define SPECIAL_KBREQUEST_TARGET "kbrequest.target"
-#define SPECIAL_SIGPWR_TARGET "sigpwr.target"
-#define SPECIAL_CTRL_ALT_DEL_TARGET "ctrl-alt-del.target"
-
-/* Where we add all our system units, users and machines by default */
-#define SPECIAL_SYSTEM_SLICE "system.slice"
-#define SPECIAL_USER_SLICE "user.slice"
-#define SPECIAL_MACHINE_SLICE "machine.slice"
-#define SPECIAL_ROOT_SLICE "-.slice"
-
-/* The scope unit systemd itself lives in. */
-#define SPECIAL_INIT_SCOPE "init.scope"
index 9b0339aae9e1050385e79f2b97b3468ae10c9d4f..b517415ced6c7802d27e74d9ed99b3c1e3291e06 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "process-util.h"
 #include "path-util.h"
-#include "special.h"
+// #include "special.h"
 #include "cgroup-util.h"
 #include "cgroup.h"
 
@@ -1233,6 +1233,8 @@ int manager_setup_cgroup(Manager *m) {
         if (r < 0)
                 return log_error_errno(r, "Cannot determine cgroup we are running in: %m");
 
+/// elogind does not support systemd scopes and slices
+#if 0
         /* Chop off the init scope, if we are already located in it */
         e = endswith(m->cgroup_root, "/" SPECIAL_INIT_SCOPE);
 
@@ -1247,6 +1249,7 @@ int manager_setup_cgroup(Manager *m) {
         }
         if (e)
                 *e = 0;
+#endif // 0
 
         /* And make sure to store away the root value without trailing
          * slash, even for the root dir, so that we can easily prepend
@@ -1313,9 +1316,15 @@ int manager_setup_cgroup(Manager *m) {
                                 log_debug("Release agent already installed.");
                 }
 
+/// elogind is not meant to run in systemd init scope
+#if 0
                 /* 4. Make sure we are in the special "init.scope" unit in the root slice. */
                 scope_path = strjoina(m->cgroup_root, "/" SPECIAL_INIT_SCOPE);
                 r = cg_create_and_attach(ELOGIND_CGROUP_CONTROLLER, scope_path, 0);
+#else
+                scope_path = strjoina(m->cgroup_root, "/elogind");
+                r = cg_create_and_attach(ELOGIND_CGROUP_CONTROLLER, scope_path, 0);
+#endif // 0
                 if (r < 0)
                         return log_error_errno(r, "Failed to create %s control group: %m", scope_path);
 
index b0c15e25332bc5065cf8c5fefc8c31fd1b98ec67..ef0c13bc0f3064ada8c86fdf83530465145b236f 100644 (file)
@@ -28,7 +28,7 @@
 #include "strv.h"
 #include "mkdir.h"
 #include "path-util.h"
-#include "special.h"
+// #include "special.h"
 #include "sleep-config.h"
 #include "fileio-label.h"
 #include "unit-name.h"
index 2733117c641977de41cf08f74e52a7d886eb2d2e..54c2108356bdae9043c2c0f860eb7abe953ba7bc 100644 (file)
@@ -30,7 +30,7 @@
 #include "hashmap.h"
 #include "fileio.h"
 #include "path-util.h"
-#include "special.h"
+// #include "special.h"
 #include "unit-name.h"
 #include "bus-util.h"
 #include "bus-error.h"
@@ -409,26 +409,26 @@ static int user_start_slice(User *u) {
                 char lu[DECIMAL_STR_MAX(uid_t) + 1], *slice;
                 sprintf(lu, UID_FMT, u->uid);
 
-                r = slice_build_subslice(SPECIAL_USER_SLICE, lu, &slice);
+                r = slice_build_subslice("user", lu, &slice);
                 if (r < 0)
                         return r;
 
 /// elogind : Do not try to use dbus to ask systemd
 #if 0
                 r = manager_start_unit(u->manager, slice, &error, &job);
-#endif // 0
                 if (r < 0) {
                         log_error("Failed to start user slice: %s", bus_error_message(&error, r));
                         free(slice);
                 } else {
+#endif // 0
                         u->slice = slice;
 
 /// elogind does not support slice jobs
 #if 0
                         free(u->slice_job);
                         u->slice_job = job;
-#endif // 0
                 }
+#endif // 0
         }
 
         if (u->slice)
index 1e13ff01de75c460aa0e915c0f8b46848d118a0e..faa4fc73394848d2dc59e522590f5b6fb7530cd6 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "sd-messages.h"
 #include "strv.h"
-#include "special.h"
+// #include "special.h"
 #include "unit-name.h"
 #include "audit.h"
 #include "bus-util.h"