mirror of
https://github.com/systemd/systemd.git
synced 2025-01-03 05:18:09 +03:00
core: --user -- add basic.target an sort against it like --system does
This commit is contained in:
parent
fcc81ea361
commit
fccd44ec3a
@ -460,6 +460,7 @@ nodist_systemunit_DATA = \
|
|||||||
units/systemd-nspawn@.service
|
units/systemd-nspawn@.service
|
||||||
|
|
||||||
dist_userunit_DATA = \
|
dist_userunit_DATA = \
|
||||||
|
units/user/basic.target \
|
||||||
units/user/default.target \
|
units/user/default.target \
|
||||||
units/user/exit.target
|
units/user/exit.target
|
||||||
|
|
||||||
|
@ -1138,28 +1138,10 @@ static int service_add_default_dependencies(Service *s) {
|
|||||||
* majority of services. */
|
* majority of services. */
|
||||||
|
|
||||||
/* First, pull in base system */
|
/* First, pull in base system */
|
||||||
if (UNIT(s)->manager->running_as == SYSTEMD_SYSTEM) {
|
r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES,
|
||||||
r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES,
|
SPECIAL_BASIC_TARGET, NULL, true);
|
||||||
SPECIAL_BASIC_TARGET, NULL, true);
|
if (r < 0)
|
||||||
if (r < 0)
|
return r;
|
||||||
return r;
|
|
||||||
|
|
||||||
} else if (UNIT(s)->manager->running_as == SYSTEMD_USER) {
|
|
||||||
r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES,
|
|
||||||
SPECIAL_SOCKETS_TARGET, NULL, true);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES,
|
|
||||||
SPECIAL_TIMERS_TARGET, NULL, true);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES,
|
|
||||||
SPECIAL_PATHS_TARGET, NULL, true);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Second, activate normal shutdown */
|
/* Second, activate normal shutdown */
|
||||||
r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS,
|
r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS,
|
||||||
|
13
units/user/basic.target
Normal file
13
units/user/basic.target
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# This file is part of systemd.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Basic System
|
||||||
|
Documentation=man:systemd.special(7)
|
||||||
|
Wants=sockets.target timers.target paths.target
|
||||||
|
After=sockets.target timers.target paths.target
|
||||||
|
RefuseManualStart=yes
|
@ -8,4 +8,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Default
|
Description=Default
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
|
Requires=basic.target
|
||||||
|
After=basic.target
|
||||||
AllowIsolate=yes
|
AllowIsolate=yes
|
||||||
|
Loading…
Reference in New Issue
Block a user