mirror of
https://github.com/systemd/systemd
synced 2026-03-20 03:54:45 +01:00
Compare commits
No commits in common. "fac6511e4943f9a873f136c0bb3185d3cd8cbbfa" and "24c006d83d95479a2a0ed734f959b2bd8fcbcd3e" have entirely different histories.
fac6511e49
...
24c006d83d
50
NEWS
50
NEWS
@ -28,11 +28,6 @@ CHANGES WITH 249 in spe:
|
|||||||
specified root user exists already in the image. (Note that
|
specified root user exists already in the image. (Note that
|
||||||
--volatile=yes ensures it doesn't, though.)
|
--volatile=yes ensures it doesn't, though.)
|
||||||
|
|
||||||
* PID 1 may now show both the unit name and the unit description
|
|
||||||
strings in its status output during boot. This may be configured with
|
|
||||||
StatusUnitFormat=combined in system.conf or
|
|
||||||
systemd.status-unit-format=combined on the kernel command line.
|
|
||||||
|
|
||||||
* systemd-firstboot now also supports querying various system
|
* systemd-firstboot now also supports querying various system
|
||||||
parameters via the credential subsystems. Thus, as above this may be
|
parameters via the credential subsystems. Thus, as above this may be
|
||||||
used to initialize important system parameters on first boot of
|
used to initialize important system parameters on first boot of
|
||||||
@ -503,36 +498,35 @@ CHANGES WITH 249 in spe:
|
|||||||
and friends), all file systems will be mounted with MS_NOSUID by
|
and friends), all file systems will be mounted with MS_NOSUID by
|
||||||
default, unless the system is running with SELinux enabled.
|
default, unless the system is running with SELinux enabled.
|
||||||
|
|
||||||
Contributions from: Aakash Singh, adrian5, Albert Brox,
|
Contributions from: Aakash Singh, adrian5, Alexander Sverdlin,
|
||||||
Alexander Sverdlin, Alexander Tsoy, alexlzhu, Allen Webb,
|
alexlzhu, Allen Webb, Alvin Šipraga, Alyssa Ross, Anders Wenhaug,
|
||||||
Alvin Šipraga, Alyssa Ross, Anders Wenhaug, Andrea Pappacoda,
|
Andrea Pappacoda, Anita Zhang, asavah, Balint Reczey, Bertrand Jacquin,
|
||||||
Anita Zhang, asavah, Balint Reczey, Bertrand Jacquin, borna-blazevic,
|
borna-blazevic, caoxia2008cxx, Carlo Teubner, Christian Göttsche,
|
||||||
caoxia2008cxx, Carlo Teubner, Christian Göttsche, Christian Hesse,
|
Christian Hesse, Daniel Schaefer, Dan Streetman,
|
||||||
Daniel Schaefer, Dan Streetman, David Santamaría Rogado, David Tardon,
|
David Santamaría Rogado, David Tardon, Deepak Rawat,
|
||||||
Deepak Rawat, dgcampea, Dimitri John Ledkov, ei-ke, Emilio Herrera,
|
Dimitri John Ledkov, ei-ke, Emilio Herrera, Emil Renner Berthing,
|
||||||
Emil Renner Berthing, Eric Cook, Flos Lonicerae, Franck Bui,
|
Eric Cook, Flos Lonicerae, Franck Bui, Francois Gervais,
|
||||||
Francois Gervais, Frantisek Sumsal, Gibeom Gwon, gitm0, Hans de Goede,
|
Frantisek Sumsal, Gibeom Gwon, gitm0, Hans de Goede, Harsh Barsaiyan,
|
||||||
Harsh Barsaiyan, Henri Chain, Hristo Venev, Igor Zhbanov, imayoda,
|
Henri Chain, Hristo Venev, Igor Zhbanov, imayoda, Jakub Warczarek,
|
||||||
Jakub Warczarek, James Buren, Jan Janssen, Jan Macku, Jan Synacek,
|
James Buren, Jan Janssen, Jan Macku, Jan Synacek, Jason Francis,
|
||||||
Jason Francis, Jayanth Ananthapadmanaban, Jeremy Szu, Jérôme Carretero,
|
Jayanth Ananthapadmanaban, Jeremy Szu, Jérôme Carretero,
|
||||||
Jesse Stricker, jiangchuangang, Joerg Behrmann, Jóhann B. Guðmundsson,
|
Jesse Stricker, jiangchuangang, Joerg Behrmann, Jóhann B. Guðmundsson,
|
||||||
Jörg Deckert, Jörg Thalheim, Juergen Hoetzel, Julia Kartseva,
|
Jörg Deckert, Jörg Thalheim, Juergen Hoetzel, Julia Kartseva,
|
||||||
Kai-Heng Feng, Khem Raj, KoyamaSohei, laineantti, Lennart Poettering,
|
Kai-Heng Feng, Khem Raj, KoyamaSohei, Lennart Poettering,
|
||||||
LetzteInstanz, Luca Adrian L, Luca Boccassi, Lucas Magasweran,
|
LetzteInstanz, Luca Adrian L, Luca Boccassi, Lucas Magasweran,
|
||||||
Mantas Mikulėnas, Marco Antonio Mauro, Mark Wielaard, Masahiro Matsuya,
|
Mantas Mikulėnas, Marco Antonio Mauro, Mark Wielaard, Masahiro Matsuya,
|
||||||
Matt Johnston, Michael Catanzaro, Michal Koutný, Michal Sekletár,
|
Matt Johnston, Michael Catanzaro, Michal Koutný, Michal Sekletár,
|
||||||
Mike Crowe, Mike Kazantsev, Milan, Miroslav Suchý, Morten Linderud,
|
Mike Crowe, Mike Kazantsev, Milan, Miroslav Suchý, Morten Linderud,
|
||||||
nerdopolis, nl6720, Noah Meyerhans, Oleg Popov, Olle Lundberg,
|
nerdopolis, nl6720, Noah Meyerhans, Oleg Popov, Olle Lundberg,
|
||||||
Ondrej Kozina, Paweł Marciniak, Perry.Yuan, Peter Hutterer,
|
Ondrej Kozina, Perry.Yuan, Peter Hutterer, Peter Kjellerstedt,
|
||||||
Peter Kjellerstedt, Peter Morrow, Phaedrus Leeds, plattrap,
|
Peter Morrow, Phaedrus Leeds, plattrap, Roman Beranek, Roshan Shariff,
|
||||||
Raul Tambre, Roman Beranek, Roshan Shariff, Ryan Hendrickson,
|
Ryan Hendrickson, Samuel BF, scootergrisen, Sebastian Blunt,
|
||||||
Samuel BF, scootergrisen, Sebastian Blunt, Seong-ho Cho, Sergey Bugaev,
|
Seong-ho Cho, Sergey Bugaev, Sevan Janiyan, Sibo Dong, simmon,
|
||||||
Sevan Janiyan, Sibo Dong, simmon, Simon Watts, Srinidhi Kaushik,
|
Simon Watts, Srinidhi Kaushik, Štěpán Němec, Steve Bonds,
|
||||||
Štěpán Němec, Steve Bonds, Susant Sahani, sverdlin, syyhao1994,
|
Susant Sahani, sverdlin, syyhao1994, Takashi Sakamoto, Topi Miettinen,
|
||||||
Takashi Sakamoto, Topi Miettinen, tramsay, Uwe Kleine-König,
|
tramsay, Uwe Kleine-König, Viktor Mihajlovski, Vincent Dechenaux,
|
||||||
Viktor Mihajlovski, Vincent Dechenaux, Vito Caputo,
|
Vito Caputo, William A. Kennington III, Yangyang Shen, Yegor Alexeyev,
|
||||||
William A. Kennington III, Yangyang Shen, Yegor Alexeyev, Yi Gao,
|
Yi Gao, Yu Watanabe, Zbigniew Jędrzejewski-Szmek, zsien, наб
|
||||||
Yu Watanabe, Zbigniew Jędrzejewski-Szmek, zsien, наб
|
|
||||||
|
|
||||||
— Warsaw, 2021-06-25
|
— Warsaw, 2021-06-25
|
||||||
|
|
||||||
|
|||||||
@ -67,9 +67,9 @@ Welcome to <span style="color:blue">Fedora 20 (Heisenbug)</span>!
|
|||||||
Starting Recreate Volatile Files and Directories...
|
Starting Recreate Volatile Files and Directories...
|
||||||
Starting Trigger Flushing of Journal to Persistent Storage...
|
Starting Trigger Flushing of Journal to Persistent Storage...
|
||||||
[ <span style="color:green">OK</span> ] Started Recreate Volatile Files and Directories.
|
[ <span style="color:green">OK</span> ] Started Recreate Volatile Files and Directories.
|
||||||
Starting Record System Reboot/Shutdown in UTMP...
|
Starting Update UTMP about System Reboot/Shutdown...
|
||||||
[ <span style="color:green">OK</span> ] Started Trigger Flushing of Journal to Persistent Storage.
|
[ <span style="color:green">OK</span> ] Started Trigger Flushing of Journal to Persistent Storage.
|
||||||
[ <span style="color:green">OK</span> ] Started Record System Reboot/Shutdown in UTMP.
|
[ <span style="color:green">OK</span> ] Started Update UTMP about System Reboot/Shutdown.
|
||||||
[ <span style="color:green">OK</span> ] Reached target System Initialization.
|
[ <span style="color:green">OK</span> ] Reached target System Initialization.
|
||||||
[ <span style="color:green">OK</span> ] Reached target Timers.
|
[ <span style="color:green">OK</span> ] Reached target Timers.
|
||||||
[ <span style="color:green">OK</span> ] Listening on D-Bus System Message Bus Socket.
|
[ <span style="color:green">OK</span> ] Listening on D-Bus System Message Bus Socket.
|
||||||
|
|||||||
@ -257,17 +257,11 @@
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>StatusUnitFormat=</varname></term>
|
<term><varname>StatusUnitFormat=</varname></term>
|
||||||
|
|
||||||
<listitem><para>Takes <option>name</option>, <option>description</option> or
|
<listitem><para>Takes either <option>name</option> or <option>description</option> as the value. If
|
||||||
<option>combined</option> as the value. If <option>name</option>, the system manager will use unit
|
<option>name</option>, the system manager will use unit names in status messages, instead of the
|
||||||
names in status messages (e.g. <literal>systemd-journald.service</literal>), instead of the longer
|
longer and more informative descriptions set with <varname>Description=</varname>, see
|
||||||
and more informative descriptions set with <varname>Description=</varname> (e.g. <literal>Journal
|
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
|
||||||
Logging Service</literal>). If <option>combined</option>, the system manager will use both unit names
|
</para></listitem>
|
||||||
and descriptions in status messages (e.g. <literal>systemdmd-jouranld.service - Journal Logging
|
|
||||||
Service</literal>).</para>
|
|
||||||
|
|
||||||
<para>See
|
|
||||||
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
|
|
||||||
details about unit names and <varname>Description=</varname>.</para></listitem>
|
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|||||||
@ -561,19 +561,20 @@
|
|||||||
<variablelist class='unit-directives'>
|
<variablelist class='unit-directives'>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>Description=</varname></term>
|
<term><varname>Description=</varname></term>
|
||||||
<listitem><para>A short human readable title of the unit. This may be used by
|
<listitem><para>A human readable name for the unit. This is used by
|
||||||
<command>systemd</command> (and other UIs) as a user-visible label for the unit, so this string
|
<command>systemd</command> (and other UIs) as the label for the unit, so this string should
|
||||||
should identify the unit rather than describe it, despite the name. This string also shouldn't just
|
identify the unit rather than describe it, despite the name. <literal>Apache2 Web
|
||||||
repeat the unit name. <literal>Apache2 Web Server</literal> is a good example. Bad examples are
|
Server</literal> is a good example. Bad examples are <literal>high-performance light-weight
|
||||||
<literal>high-performance light-weight HTTP server</literal> (too generic) or
|
HTTP server</literal> (too generic) or <literal>Apache2</literal> (too specific and
|
||||||
<literal>Apache2</literal> (meaningless for people who do not know Apache, duplicates the unit
|
meaningless for people who do not know Apache). <command>systemd</command> will use this
|
||||||
name). <command>systemd</command> may use this string as a noun in status messages (<literal>Starting
|
string as a noun in status messages (<literal>Starting
|
||||||
<replaceable>description</replaceable>...</literal>, <literal>Started
|
<replaceable>description</replaceable>...</literal>, <literal>Started
|
||||||
<replaceable>description</replaceable>.</literal>, <literal>Reached target
|
<replaceable>description</replaceable>.</literal>, <literal>Reached target
|
||||||
<replaceable>description</replaceable>.</literal>, <literal>Failed to start
|
<replaceable>description</replaceable>.</literal>, <literal>Failed to start
|
||||||
<replaceable>description</replaceable>.</literal>), so it should be capitalized, and should not be a
|
<replaceable>description</replaceable>.</literal>), so it should be capitalized, and should
|
||||||
full sentence, or a phrase with a continuous verb. Bad examples include <literal>exiting the
|
not be a full sentence or a phrase with a continuous verb. Bad examples include
|
||||||
container</literal> or <literal>updating the database once per day.</literal>.</para>
|
<literal>exiting the container</literal> or <literal>updating the database once per
|
||||||
|
day.</literal>.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
|||||||
@ -840,11 +840,9 @@
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>systemd.status_unit_format=</varname></term>
|
<term><varname>systemd.status_unit_format=</varname></term>
|
||||||
|
|
||||||
<listitem><para>Takes <option>name</option>, <option>description</option> or
|
<listitem><para>Takes either <option>name</option> or <option>description</option> as the value. If
|
||||||
<option>combined</option> as the value. If <option>name</option>, the system manager will use unit
|
<option>name</option>, the system manager will use unit names in status messages. If specified,
|
||||||
names in status messages. If <option>combined</option>, the system manager will use unit names and
|
overrides the system manager configuration file option <option>StatusUnitFormat=</option>, see
|
||||||
description in status messages. When specified, overrides the system manager configuration file
|
|
||||||
option <option>StatusUnitFormat=</option>, see
|
|
||||||
<citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
|
<citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|||||||
@ -200,7 +200,7 @@ option('default-net-naming-scheme', type : 'combo',
|
|||||||
choices : ['latest', 'v238', 'v239', 'v240'],
|
choices : ['latest', 'v238', 'v239', 'v240'],
|
||||||
description : 'default net.naming-scheme= value')
|
description : 'default net.naming-scheme= value')
|
||||||
option('status-unit-format-default', type : 'combo',
|
option('status-unit-format-default', type : 'combo',
|
||||||
choices : ['description', 'name', 'combined'],
|
choices : ['description', 'name'],
|
||||||
description : 'use unit name or description in messages by default')
|
description : 'use unit name or description in messages by default')
|
||||||
option('time-epoch', type : 'integer', value : '-1',
|
option('time-epoch', type : 'integer', value : '-1',
|
||||||
description : 'time epoch for time clients')
|
description : 'time epoch for time clients')
|
||||||
|
|||||||
@ -220,7 +220,7 @@ static int verify_unit(Unit *u, bool check_man) {
|
|||||||
|
|
||||||
int verify_units(char **filenames, UnitFileScope scope, bool check_man, bool run_generators) {
|
int verify_units(char **filenames, UnitFileScope scope, bool check_man, bool run_generators) {
|
||||||
const ManagerTestRunFlags flags =
|
const ManagerTestRunFlags flags =
|
||||||
MANAGER_TEST_RUN_MINIMAL |
|
MANAGER_TEST_RUN_BASIC |
|
||||||
MANAGER_TEST_RUN_ENV_GENERATORS |
|
MANAGER_TEST_RUN_ENV_GENERATORS |
|
||||||
run_generators * MANAGER_TEST_RUN_GENERATORS;
|
run_generators * MANAGER_TEST_RUN_GENERATORS;
|
||||||
|
|
||||||
|
|||||||
@ -1262,19 +1262,26 @@ int parse_nsec(const char *t, nsec_t *nsec) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_timezones_from_zone1970_tab(char ***ret) {
|
int get_timezones(char ***ret) {
|
||||||
_cleanup_fclose_ FILE *f = NULL;
|
_cleanup_fclose_ FILE *f = NULL;
|
||||||
_cleanup_strv_free_ char **zones = NULL;
|
_cleanup_strv_free_ char **zones = NULL;
|
||||||
|
size_t n_zones = 0;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
assert(ret);
|
assert(ret);
|
||||||
|
|
||||||
|
zones = strv_new("UTC");
|
||||||
|
if (!zones)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
n_zones = 1;
|
||||||
|
|
||||||
f = fopen("/usr/share/zoneinfo/zone1970.tab", "re");
|
f = fopen("/usr/share/zoneinfo/zone1970.tab", "re");
|
||||||
if (!f)
|
if (f) {
|
||||||
return -errno;
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
_cleanup_free_ char *line = NULL, *cc = NULL, *co = NULL, *tz = NULL;
|
_cleanup_free_ char *line = NULL, *w = NULL;
|
||||||
|
char *p;
|
||||||
|
size_t k;
|
||||||
|
|
||||||
r = read_line(f, LONG_LINE_MAX, &line);
|
r = read_line(f, LONG_LINE_MAX, &line);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
@ -1282,102 +1289,43 @@ static int get_timezones_from_zone1970_tab(char ***ret) {
|
|||||||
if (r == 0)
|
if (r == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
const char *p = line;
|
p = strstrip(line);
|
||||||
|
|
||||||
/* Line format is:
|
if (isempty(p) || *p == '#')
|
||||||
* 'country codes' 'coordinates' 'timezone' 'comments' */
|
|
||||||
r = extract_many_words(&p, NULL, 0, &cc, &co, &tz, NULL);
|
|
||||||
if (r < 0)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Lines that start with # are comments. */
|
/* Skip over country code */
|
||||||
if (*cc == '#')
|
p += strcspn(p, WHITESPACE);
|
||||||
|
p += strspn(p, WHITESPACE);
|
||||||
|
|
||||||
|
/* Skip over coordinates */
|
||||||
|
p += strcspn(p, WHITESPACE);
|
||||||
|
p += strspn(p, WHITESPACE);
|
||||||
|
|
||||||
|
/* Found timezone name */
|
||||||
|
k = strcspn(p, WHITESPACE);
|
||||||
|
if (k <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
r = strv_extend(&zones, tz);
|
w = strndup(p, k);
|
||||||
if (r < 0)
|
if (!w)
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
*ret = TAKE_PTR(zones);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_timezones_from_tzdata_zi(char ***ret) {
|
|
||||||
_cleanup_fclose_ FILE *f = NULL;
|
|
||||||
_cleanup_strv_free_ char **zones = NULL;
|
|
||||||
int r;
|
|
||||||
|
|
||||||
f = fopen("/usr/share/zoneinfo/tzdata.zi", "re");
|
|
||||||
if (!f)
|
|
||||||
return -errno;
|
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
_cleanup_free_ char *line = NULL, *type = NULL, *f1 = NULL, *f2 = NULL;
|
|
||||||
|
|
||||||
r = read_line(f, LONG_LINE_MAX, &line);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
if (r == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
const char *p = line;
|
|
||||||
|
|
||||||
/* The only lines we care about are Zone and Link lines.
|
|
||||||
* Zone line format is:
|
|
||||||
* 'Zone' 'timezone' ...
|
|
||||||
* Link line format is:
|
|
||||||
* 'Link' 'target' 'alias'
|
|
||||||
* See 'man zic' for more detail. */
|
|
||||||
r = extract_many_words(&p, NULL, 0, &type, &f1, &f2, NULL);
|
|
||||||
if (r < 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
char *tz;
|
|
||||||
if (*type == 'Z' || *type == 'z')
|
|
||||||
/* Zone lines have timezone in field 1. */
|
|
||||||
tz = f1;
|
|
||||||
else if (*type == 'L' || *type == 'l')
|
|
||||||
/* Link lines have timezone in field 2. */
|
|
||||||
tz = f2;
|
|
||||||
else
|
|
||||||
/* Not a line we care about. */
|
|
||||||
continue;
|
|
||||||
|
|
||||||
r = strv_extend(&zones, tz);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
*ret = TAKE_PTR(zones);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int get_timezones(char ***ret) {
|
|
||||||
_cleanup_strv_free_ char **zones = NULL;
|
|
||||||
int r;
|
|
||||||
|
|
||||||
assert(ret);
|
|
||||||
|
|
||||||
r = get_timezones_from_tzdata_zi(&zones);
|
|
||||||
if (r == -ENOENT) {
|
|
||||||
log_debug_errno(r, "Could not get timezone data from tzdata.zi, using zone1970.tab: %m");
|
|
||||||
r = get_timezones_from_zone1970_tab(&zones);
|
|
||||||
if (r == -ENOENT)
|
|
||||||
log_debug_errno(r, "Could not get timezone data from zone1970.tab, using UTC: %m");
|
|
||||||
}
|
|
||||||
if (r < 0 && r != -ENOENT)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
/* Always include UTC */
|
|
||||||
r = strv_extend(&zones, "UTC");
|
|
||||||
if (r < 0)
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
if (!GREEDY_REALLOC(zones, n_zones + 2))
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
zones[n_zones++] = TAKE_PTR(w);
|
||||||
|
zones[n_zones] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
strv_sort(zones);
|
strv_sort(zones);
|
||||||
strv_uniq(zones);
|
strv_uniq(zones);
|
||||||
|
|
||||||
|
} else if (errno != ENOENT)
|
||||||
|
return -errno;
|
||||||
|
|
||||||
*ret = TAKE_PTR(zones);
|
*ret = TAKE_PTR(zones);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -84,7 +84,7 @@ static void unmount_autofs(Automount *a) {
|
|||||||
if (a->pipe_fd < 0)
|
if (a->pipe_fd < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
a->pipe_event_source = sd_event_source_disable_unref(a->pipe_event_source);
|
a->pipe_event_source = sd_event_source_unref(a->pipe_event_source);
|
||||||
a->pipe_fd = safe_close(a->pipe_fd);
|
a->pipe_fd = safe_close(a->pipe_fd);
|
||||||
|
|
||||||
/* If we reload/reexecute things we keep the mount point around */
|
/* If we reload/reexecute things we keep the mount point around */
|
||||||
@ -113,7 +113,7 @@ static void automount_done(Unit *u) {
|
|||||||
a->tokens = set_free(a->tokens);
|
a->tokens = set_free(a->tokens);
|
||||||
a->expire_tokens = set_free(a->expire_tokens);
|
a->expire_tokens = set_free(a->expire_tokens);
|
||||||
|
|
||||||
a->expire_event_source = sd_event_source_disable_unref(a->expire_event_source);
|
a->expire_event_source = sd_event_source_unref(a->expire_event_source);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int automount_add_trigger_dependencies(Automount *a) {
|
static int automount_add_trigger_dependencies(Automount *a) {
|
||||||
|
|||||||
@ -3200,7 +3200,7 @@ int manager_setup_cgroup(Manager *m) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 3. Allocate cgroup empty defer event source */
|
/* 3. Allocate cgroup empty defer event source */
|
||||||
m->cgroup_empty_event_source = sd_event_source_disable_unref(m->cgroup_empty_event_source);
|
m->cgroup_empty_event_source = sd_event_source_unref(m->cgroup_empty_event_source);
|
||||||
r = sd_event_add_defer(m->event, &m->cgroup_empty_event_source, on_cgroup_empty_event, m);
|
r = sd_event_add_defer(m->event, &m->cgroup_empty_event_source, on_cgroup_empty_event, m);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to create cgroup empty event source: %m");
|
return log_error_errno(r, "Failed to create cgroup empty event source: %m");
|
||||||
@ -3223,7 +3223,7 @@ int manager_setup_cgroup(Manager *m) {
|
|||||||
|
|
||||||
/* In the unified hierarchy we can get cgroup empty notifications via inotify. */
|
/* In the unified hierarchy we can get cgroup empty notifications via inotify. */
|
||||||
|
|
||||||
m->cgroup_inotify_event_source = sd_event_source_disable_unref(m->cgroup_inotify_event_source);
|
m->cgroup_inotify_event_source = sd_event_source_unref(m->cgroup_inotify_event_source);
|
||||||
safe_close(m->cgroup_inotify_fd);
|
safe_close(m->cgroup_inotify_fd);
|
||||||
|
|
||||||
m->cgroup_inotify_fd = inotify_init1(IN_NONBLOCK|IN_CLOEXEC);
|
m->cgroup_inotify_fd = inotify_init1(IN_NONBLOCK|IN_CLOEXEC);
|
||||||
@ -3303,15 +3303,15 @@ void manager_shutdown_cgroup(Manager *m, bool delete) {
|
|||||||
|
|
||||||
/* We can't really delete the group, since we are in it. But
|
/* We can't really delete the group, since we are in it. But
|
||||||
* let's trim it. */
|
* let's trim it. */
|
||||||
if (delete && m->cgroup_root && !FLAGS_SET(m->test_run_flags, MANAGER_TEST_RUN_MINIMAL))
|
if (delete && m->cgroup_root && m->test_run_flags != MANAGER_TEST_RUN_MINIMAL)
|
||||||
(void) cg_trim(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_root, false);
|
(void) cg_trim(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_root, false);
|
||||||
|
|
||||||
m->cgroup_empty_event_source = sd_event_source_disable_unref(m->cgroup_empty_event_source);
|
m->cgroup_empty_event_source = sd_event_source_unref(m->cgroup_empty_event_source);
|
||||||
|
|
||||||
m->cgroup_control_inotify_wd_unit = hashmap_free(m->cgroup_control_inotify_wd_unit);
|
m->cgroup_control_inotify_wd_unit = hashmap_free(m->cgroup_control_inotify_wd_unit);
|
||||||
m->cgroup_memory_inotify_wd_unit = hashmap_free(m->cgroup_memory_inotify_wd_unit);
|
m->cgroup_memory_inotify_wd_unit = hashmap_free(m->cgroup_memory_inotify_wd_unit);
|
||||||
|
|
||||||
m->cgroup_inotify_event_source = sd_event_source_disable_unref(m->cgroup_inotify_event_source);
|
m->cgroup_inotify_event_source = sd_event_source_unref(m->cgroup_inotify_event_source);
|
||||||
m->cgroup_inotify_fd = safe_close(m->cgroup_inotify_fd);
|
m->cgroup_inotify_fd = safe_close(m->cgroup_inotify_fd);
|
||||||
|
|
||||||
m->pin_cgroupfs_fd = safe_close(m->pin_cgroupfs_fd);
|
m->pin_cgroupfs_fd = safe_close(m->pin_cgroupfs_fd);
|
||||||
|
|||||||
@ -1037,7 +1037,7 @@ void bus_done_private(Manager *m) {
|
|||||||
|
|
||||||
m->private_buses = set_free(m->private_buses);
|
m->private_buses = set_free(m->private_buses);
|
||||||
|
|
||||||
m->private_listen_event_source = sd_event_source_disable_unref(m->private_listen_event_source);
|
m->private_listen_event_source = sd_event_source_unref(m->private_listen_event_source);
|
||||||
m->private_listen_fd = safe_close(m->private_listen_fd);
|
m->private_listen_fd = safe_close(m->private_listen_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
486
src/core/job.c
486
src/core/job.c
@ -88,7 +88,7 @@ void job_unlink(Job *j) {
|
|||||||
j->in_gc_queue = false;
|
j->in_gc_queue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
j->timer_event_source = sd_event_source_disable_unref(j->timer_event_source);
|
j->timer_event_source = sd_event_source_unref(j->timer_event_source);
|
||||||
}
|
}
|
||||||
|
|
||||||
Job* job_free(Job *j) {
|
Job* job_free(Job *j) {
|
||||||
@ -129,7 +129,7 @@ static void job_set_state(Job *j, JobState state) {
|
|||||||
j->unit->manager->n_running_jobs--;
|
j->unit->manager->n_running_jobs--;
|
||||||
|
|
||||||
if (j->unit->manager->n_running_jobs <= 0)
|
if (j->unit->manager->n_running_jobs <= 0)
|
||||||
j->unit->manager->jobs_in_progress_event_source = sd_event_source_disable_unref(j->unit->manager->jobs_in_progress_event_source);
|
j->unit->manager->jobs_in_progress_event_source = sd_event_source_unref(j->unit->manager->jobs_in_progress_event_source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -506,26 +506,52 @@ static void job_change_type(Job *j, JobType newtype) {
|
|||||||
j->type = newtype;
|
j->type = newtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char* job_start_message_format(Unit *u, JobType t) {
|
_pure_ static const char* job_get_begin_status_message_format(Unit *u, JobType t) {
|
||||||
|
const char *format;
|
||||||
|
|
||||||
assert(u);
|
assert(u);
|
||||||
assert(IN_SET(t, JOB_START, JOB_STOP, JOB_RELOAD));
|
|
||||||
|
|
||||||
if (t == JOB_RELOAD)
|
if (t == JOB_RELOAD)
|
||||||
return "Reloading %s...";
|
return "Reloading %s.";
|
||||||
else if (t == JOB_START)
|
|
||||||
return UNIT_VTABLE(u)->status_message_formats.starting_stopping[0] ?: "Starting %s...";
|
assert(IN_SET(t, JOB_START, JOB_STOP));
|
||||||
else
|
|
||||||
return UNIT_VTABLE(u)->status_message_formats.starting_stopping[1] ?: "Stopping %s...";
|
format = UNIT_VTABLE(u)->status_message_formats.starting_stopping[t == JOB_STOP];
|
||||||
|
if (format)
|
||||||
|
return format;
|
||||||
|
|
||||||
|
/* Return generic strings */
|
||||||
|
if (t == JOB_START)
|
||||||
|
return "Starting %s.";
|
||||||
|
else {
|
||||||
|
assert(t == JOB_STOP);
|
||||||
|
return "Stopping %s.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void job_emit_start_message(Unit *u, uint32_t job_id, JobType t) {
|
static void job_print_begin_status_message(Unit *u, JobType t) {
|
||||||
_cleanup_free_ char *free_ident = NULL;
|
const char *format;
|
||||||
const char *ident, *format;
|
|
||||||
|
assert(u);
|
||||||
|
|
||||||
|
/* Reload status messages have traditionally not been printed to console. */
|
||||||
|
if (!IN_SET(t, JOB_START, JOB_STOP))
|
||||||
|
return;
|
||||||
|
|
||||||
|
format = job_get_begin_status_message_format(u, t);
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL;
|
||||||
|
unit_status_printf(u, STATUS_TYPE_NORMAL, "", format);
|
||||||
|
REENABLE_WARNING;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void job_log_begin_status_message(Unit *u, uint32_t job_id, JobType t) {
|
||||||
|
const char *format, *mid;
|
||||||
|
char buf[LINE_MAX];
|
||||||
|
|
||||||
assert(u);
|
assert(u);
|
||||||
assert(t >= 0);
|
assert(t >= 0);
|
||||||
assert(t < _JOB_TYPE_MAX);
|
assert(t < _JOB_TYPE_MAX);
|
||||||
assert(u->id); /* We better don't try to run a unit that doesn't even have an id. */
|
|
||||||
|
|
||||||
if (!IN_SET(t, JOB_START, JOB_STOP, JOB_RELOAD))
|
if (!IN_SET(t, JOB_START, JOB_STOP, JOB_RELOAD))
|
||||||
return;
|
return;
|
||||||
@ -533,214 +559,42 @@ static void job_emit_start_message(Unit *u, uint32_t job_id, JobType t) {
|
|||||||
if (!unit_log_level_test(u, LOG_INFO))
|
if (!unit_log_level_test(u, LOG_INFO))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
format = job_start_message_format(u, t);
|
if (log_on_console()) /* Skip this if it would only go on the console anyway */
|
||||||
ident = unit_status_string(u, &free_ident);
|
return;
|
||||||
|
|
||||||
bool do_console = t != JOB_RELOAD;
|
/* We log status messages for all units and all operations. */
|
||||||
bool console_only = do_console && log_on_console(); /* Reload status messages have traditionally
|
|
||||||
* not been printed to the console. */
|
|
||||||
|
|
||||||
/* Print to the log first. */
|
format = job_get_begin_status_message_format(u, t);
|
||||||
if (!console_only) { /* Skip this if it would only go on the console anyway */
|
|
||||||
|
|
||||||
const char *mid =
|
DISABLE_WARNING_FORMAT_NONLITERAL;
|
||||||
t == JOB_START ? "MESSAGE_ID=" SD_MESSAGE_UNIT_STARTING_STR :
|
(void) snprintf(buf, sizeof buf, format, unit_status_string(u));
|
||||||
|
REENABLE_WARNING;
|
||||||
|
|
||||||
|
mid = t == JOB_START ? "MESSAGE_ID=" SD_MESSAGE_UNIT_STARTING_STR :
|
||||||
t == JOB_STOP ? "MESSAGE_ID=" SD_MESSAGE_UNIT_STOPPING_STR :
|
t == JOB_STOP ? "MESSAGE_ID=" SD_MESSAGE_UNIT_STOPPING_STR :
|
||||||
"MESSAGE_ID=" SD_MESSAGE_UNIT_RELOADING_STR;
|
"MESSAGE_ID=" SD_MESSAGE_UNIT_RELOADING_STR;
|
||||||
const char *msg_fmt = strjoina("MESSAGE=", format);
|
|
||||||
|
|
||||||
/* Note that we deliberately use LOG_MESSAGE() instead of LOG_UNIT_MESSAGE() here, since this
|
/* Note that we deliberately use LOG_MESSAGE() instead of
|
||||||
* is supposed to mimic closely what is written to screen using the status output, which is
|
* LOG_UNIT_MESSAGE() here, since this is supposed to mimic
|
||||||
* supposed to be high level friendly output. */
|
* closely what is written to screen using the status output,
|
||||||
|
* which is supposed the highest level, friendliest output
|
||||||
DISABLE_WARNING_FORMAT_NONLITERAL;
|
* possible, which means we should avoid the low-level unit
|
||||||
|
* name. */
|
||||||
log_unit_struct(u, LOG_INFO,
|
log_unit_struct(u, LOG_INFO,
|
||||||
msg_fmt, ident,
|
LOG_MESSAGE("%s", buf),
|
||||||
"JOB_ID=%" PRIu32, job_id,
|
"JOB_ID=%" PRIu32, job_id,
|
||||||
"JOB_TYPE=%s", job_type_to_string(t),
|
"JOB_TYPE=%s", job_type_to_string(t),
|
||||||
LOG_UNIT_INVOCATION_ID(u),
|
LOG_UNIT_INVOCATION_ID(u),
|
||||||
mid);
|
mid);
|
||||||
REENABLE_WARNING;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Log to the console second. */
|
|
||||||
if (do_console) {
|
|
||||||
DISABLE_WARNING_FORMAT_NONLITERAL;
|
|
||||||
unit_status_printf(u, STATUS_TYPE_NORMAL, "", format, ident);
|
|
||||||
REENABLE_WARNING;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char* job_done_message_format(Unit *u, JobType t, JobResult result) {
|
static void job_emit_begin_status_message(Unit *u, uint32_t job_id, JobType t) {
|
||||||
static const char* const generic_finished_start_job[_JOB_RESULT_MAX] = {
|
|
||||||
[JOB_DONE] = "Started %s.",
|
|
||||||
[JOB_TIMEOUT] = "Timed out starting %s.",
|
|
||||||
[JOB_FAILED] = "Failed to start %s.",
|
|
||||||
[JOB_DEPENDENCY] = "Dependency failed for %s.",
|
|
||||||
[JOB_ASSERT] = "Assertion failed for %s.",
|
|
||||||
[JOB_UNSUPPORTED] = "Starting of %s unsupported.",
|
|
||||||
[JOB_COLLECTED] = "Unnecessary job was removed for %s.",
|
|
||||||
[JOB_ONCE] = "Unit %s has been started before and cannot be started again.",
|
|
||||||
};
|
|
||||||
static const char* const generic_finished_stop_job[_JOB_RESULT_MAX] = {
|
|
||||||
[JOB_DONE] = "Stopped %s.",
|
|
||||||
[JOB_FAILED] = "Stopped %s with error.",
|
|
||||||
[JOB_TIMEOUT] = "Timed out stopping %s.",
|
|
||||||
};
|
|
||||||
static const char* const generic_finished_reload_job[_JOB_RESULT_MAX] = {
|
|
||||||
[JOB_DONE] = "Reloaded %s.",
|
|
||||||
[JOB_FAILED] = "Reload failed for %s.",
|
|
||||||
[JOB_TIMEOUT] = "Timed out reloading %s.",
|
|
||||||
};
|
|
||||||
/* When verify-active detects the unit is inactive, report it.
|
|
||||||
* Most likely a DEPEND warning from a requisiting unit will
|
|
||||||
* occur next and it's nice to see what was requisited. */
|
|
||||||
static const char* const generic_finished_verify_active_job[_JOB_RESULT_MAX] = {
|
|
||||||
[JOB_SKIPPED] = "%s is inactive.",
|
|
||||||
};
|
|
||||||
const char *format;
|
|
||||||
|
|
||||||
assert(u);
|
assert(u);
|
||||||
assert(t >= 0);
|
assert(t >= 0);
|
||||||
assert(t < _JOB_TYPE_MAX);
|
assert(t < _JOB_TYPE_MAX);
|
||||||
|
|
||||||
/* Show condition check message if the job did not actually do anything due to failed condition. */
|
job_log_begin_status_message(u, job_id, t);
|
||||||
if (t == JOB_START && result == JOB_DONE && !u->condition_result)
|
job_print_begin_status_message(u, t);
|
||||||
return "Condition check resulted in %s being skipped.";
|
|
||||||
|
|
||||||
if (IN_SET(t, JOB_START, JOB_STOP, JOB_RESTART)) {
|
|
||||||
const UnitStatusMessageFormats *formats = &UNIT_VTABLE(u)->status_message_formats;
|
|
||||||
if (formats->finished_job) {
|
|
||||||
format = formats->finished_job(u, t, result);
|
|
||||||
if (format)
|
|
||||||
return format;
|
|
||||||
}
|
|
||||||
|
|
||||||
format = (t == JOB_START ? formats->finished_start_job : formats->finished_stop_job)[result];
|
|
||||||
if (format)
|
|
||||||
return format;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return generic strings */
|
|
||||||
switch (t) {
|
|
||||||
case JOB_START:
|
|
||||||
return generic_finished_start_job[result];
|
|
||||||
case JOB_STOP:
|
|
||||||
case JOB_RESTART:
|
|
||||||
return generic_finished_stop_job[result];
|
|
||||||
case JOB_RELOAD:
|
|
||||||
return generic_finished_reload_job[result];
|
|
||||||
case JOB_VERIFY_ACTIVE:
|
|
||||||
return generic_finished_verify_active_job[result];
|
|
||||||
default:
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct {
|
|
||||||
int log_level;
|
|
||||||
const char *color, *word;
|
|
||||||
} job_done_messages[_JOB_RESULT_MAX] = {
|
|
||||||
[JOB_DONE] = { LOG_INFO, ANSI_OK_COLOR, " OK " },
|
|
||||||
[JOB_CANCELED] = { LOG_INFO, },
|
|
||||||
[JOB_TIMEOUT] = { LOG_ERR, ANSI_HIGHLIGHT_RED, " TIME " },
|
|
||||||
[JOB_FAILED] = { LOG_ERR, ANSI_HIGHLIGHT_RED, "FAILED" },
|
|
||||||
[JOB_DEPENDENCY] = { LOG_WARNING, ANSI_HIGHLIGHT_YELLOW, "DEPEND" },
|
|
||||||
[JOB_SKIPPED] = { LOG_NOTICE, ANSI_HIGHLIGHT, " INFO " },
|
|
||||||
[JOB_INVALID] = { LOG_INFO, },
|
|
||||||
[JOB_ASSERT] = { LOG_WARNING, ANSI_HIGHLIGHT_YELLOW, "ASSERT" },
|
|
||||||
[JOB_UNSUPPORTED] = { LOG_WARNING, ANSI_HIGHLIGHT_YELLOW, "UNSUPP" },
|
|
||||||
[JOB_COLLECTED] = { LOG_INFO, },
|
|
||||||
[JOB_ONCE] = { LOG_ERR, ANSI_HIGHLIGHT_RED, " ONCE " },
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char* job_done_mid(JobType type, JobResult result) {
|
|
||||||
switch (type) {
|
|
||||||
case JOB_START:
|
|
||||||
if (result == JOB_DONE)
|
|
||||||
return "MESSAGE_ID=" SD_MESSAGE_UNIT_STARTED_STR;
|
|
||||||
else
|
|
||||||
return "MESSAGE_ID=" SD_MESSAGE_UNIT_FAILED_STR;
|
|
||||||
|
|
||||||
case JOB_RELOAD:
|
|
||||||
return "MESSAGE_ID=" SD_MESSAGE_UNIT_RELOADED_STR;
|
|
||||||
|
|
||||||
case JOB_STOP:
|
|
||||||
case JOB_RESTART:
|
|
||||||
return "MESSAGE_ID=" SD_MESSAGE_UNIT_STOPPED_STR;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void job_emit_done_message(Unit *u, uint32_t job_id, JobType t, JobResult result) {
|
|
||||||
_cleanup_free_ char *free_ident = NULL;
|
|
||||||
const char *ident, *format;
|
|
||||||
|
|
||||||
assert(u);
|
|
||||||
assert(t >= 0);
|
|
||||||
assert(t < _JOB_TYPE_MAX);
|
|
||||||
|
|
||||||
if (!unit_log_level_test(u, job_done_messages[result].log_level))
|
|
||||||
return;
|
|
||||||
|
|
||||||
format = job_done_message_format(u, t, result);
|
|
||||||
if (!format)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ident = unit_status_string(u, &free_ident);
|
|
||||||
|
|
||||||
const char *status = job_done_messages[result].word;
|
|
||||||
bool do_console = t != JOB_RELOAD && status;
|
|
||||||
bool console_only = do_console && log_on_console();
|
|
||||||
|
|
||||||
if (t == JOB_START && result == JOB_DONE && !u->condition_result) {
|
|
||||||
/* No message on the console if the job did not actually do anything due to failed condition. */
|
|
||||||
if (console_only)
|
|
||||||
return;
|
|
||||||
else
|
|
||||||
do_console = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!console_only) { /* Skip printing if output goes to the console, and job_print_status_message()
|
|
||||||
* will actually print something to the console. */
|
|
||||||
|
|
||||||
const char *mid = job_done_mid(t, result); /* mid may be NULL. log_unit_struct() will ignore it. */
|
|
||||||
const char *msg_fmt = strjoina("MESSAGE=", format);
|
|
||||||
|
|
||||||
DISABLE_WARNING_FORMAT_NONLITERAL;
|
|
||||||
log_unit_struct(u, job_done_messages[result].log_level,
|
|
||||||
msg_fmt, ident,
|
|
||||||
"JOB_ID=%" PRIu32, job_id,
|
|
||||||
"JOB_TYPE=%s", job_type_to_string(t),
|
|
||||||
"JOB_RESULT=%s", job_result_to_string(result),
|
|
||||||
LOG_UNIT_INVOCATION_ID(u),
|
|
||||||
mid);
|
|
||||||
REENABLE_WARNING;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (do_console) {
|
|
||||||
if (log_get_show_color())
|
|
||||||
status = strjoina(job_done_messages[result].color,
|
|
||||||
status,
|
|
||||||
ANSI_NORMAL);
|
|
||||||
|
|
||||||
DISABLE_WARNING_FORMAT_NONLITERAL;
|
|
||||||
unit_status_printf(u,
|
|
||||||
result == JOB_DONE ? STATUS_TYPE_NORMAL : STATUS_TYPE_NOTICE,
|
|
||||||
status, format, ident);
|
|
||||||
REENABLE_WARNING;
|
|
||||||
|
|
||||||
if (t == JOB_START && result == JOB_FAILED) {
|
|
||||||
_cleanup_free_ char *quoted = NULL;
|
|
||||||
|
|
||||||
quoted = shell_maybe_quote(u->id, 0);
|
|
||||||
if (quoted)
|
|
||||||
manager_status_printf(u->manager, STATUS_TYPE_NORMAL, NULL,
|
|
||||||
"See 'systemctl status %s' for details.", quoted);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int job_perform_on_unit(Job **j) {
|
static int job_perform_on_unit(Job **j) {
|
||||||
@ -789,7 +643,7 @@ static int job_perform_on_unit(Job **j) {
|
|||||||
* 'active') we'll possibly skip the "Starting..." message. */
|
* 'active') we'll possibly skip the "Starting..." message. */
|
||||||
*j = manager_get_job(m, id);
|
*j = manager_get_job(m, id);
|
||||||
if (*j && r > 0)
|
if (*j && r > 0)
|
||||||
job_emit_start_message(u, id, t);
|
job_emit_begin_status_message(u, id, t);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@ -878,6 +732,224 @@ int job_run_and_invalidate(Job *j) {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_pure_ static const char *job_get_done_status_message_format(Unit *u, JobType t, JobResult result) {
|
||||||
|
|
||||||
|
static const char *const generic_finished_start_job[_JOB_RESULT_MAX] = {
|
||||||
|
[JOB_DONE] = "Started %s.",
|
||||||
|
[JOB_TIMEOUT] = "Timed out starting %s.",
|
||||||
|
[JOB_FAILED] = "Failed to start %s.",
|
||||||
|
[JOB_DEPENDENCY] = "Dependency failed for %s.",
|
||||||
|
[JOB_ASSERT] = "Assertion failed for %s.",
|
||||||
|
[JOB_UNSUPPORTED] = "Starting of %s not supported.",
|
||||||
|
[JOB_COLLECTED] = "Unnecessary job for %s was removed.",
|
||||||
|
[JOB_ONCE] = "Unit %s has been started before and cannot be started again."
|
||||||
|
};
|
||||||
|
static const char *const generic_finished_stop_job[_JOB_RESULT_MAX] = {
|
||||||
|
[JOB_DONE] = "Stopped %s.",
|
||||||
|
[JOB_FAILED] = "Stopped (with error) %s.",
|
||||||
|
[JOB_TIMEOUT] = "Timed out stopping %s.",
|
||||||
|
};
|
||||||
|
static const char *const generic_finished_reload_job[_JOB_RESULT_MAX] = {
|
||||||
|
[JOB_DONE] = "Reloaded %s.",
|
||||||
|
[JOB_FAILED] = "Reload failed for %s.",
|
||||||
|
[JOB_TIMEOUT] = "Timed out reloading %s.",
|
||||||
|
};
|
||||||
|
/* When verify-active detects the unit is inactive, report it.
|
||||||
|
* Most likely a DEPEND warning from a requisiting unit will
|
||||||
|
* occur next and it's nice to see what was requisited. */
|
||||||
|
static const char *const generic_finished_verify_active_job[_JOB_RESULT_MAX] = {
|
||||||
|
[JOB_SKIPPED] = "%s is not active.",
|
||||||
|
};
|
||||||
|
|
||||||
|
const char *format;
|
||||||
|
|
||||||
|
assert(u);
|
||||||
|
assert(t >= 0);
|
||||||
|
assert(t < _JOB_TYPE_MAX);
|
||||||
|
|
||||||
|
if (IN_SET(t, JOB_START, JOB_STOP, JOB_RESTART)) {
|
||||||
|
const UnitStatusMessageFormats *formats = &UNIT_VTABLE(u)->status_message_formats;
|
||||||
|
if (formats->finished_job) {
|
||||||
|
format = formats->finished_job(u, t, result);
|
||||||
|
if (format)
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
format = t == JOB_START ?
|
||||||
|
formats->finished_start_job[result] :
|
||||||
|
formats->finished_stop_job[result];
|
||||||
|
if (format)
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return generic strings */
|
||||||
|
if (t == JOB_START)
|
||||||
|
return generic_finished_start_job[result];
|
||||||
|
else if (IN_SET(t, JOB_STOP, JOB_RESTART))
|
||||||
|
return generic_finished_stop_job[result];
|
||||||
|
else if (t == JOB_RELOAD)
|
||||||
|
return generic_finished_reload_job[result];
|
||||||
|
else if (t == JOB_VERIFY_ACTIVE)
|
||||||
|
return generic_finished_verify_active_job[result];
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct {
|
||||||
|
const char *color, *word;
|
||||||
|
} job_print_done_status_messages[_JOB_RESULT_MAX] = {
|
||||||
|
[JOB_DONE] = { ANSI_OK_COLOR, " OK " },
|
||||||
|
[JOB_TIMEOUT] = { ANSI_HIGHLIGHT_RED, " TIME " },
|
||||||
|
[JOB_FAILED] = { ANSI_HIGHLIGHT_RED, "FAILED" },
|
||||||
|
[JOB_DEPENDENCY] = { ANSI_HIGHLIGHT_YELLOW, "DEPEND" },
|
||||||
|
[JOB_SKIPPED] = { ANSI_HIGHLIGHT, " INFO " },
|
||||||
|
[JOB_ASSERT] = { ANSI_HIGHLIGHT_YELLOW, "ASSERT" },
|
||||||
|
[JOB_UNSUPPORTED] = { ANSI_HIGHLIGHT_YELLOW, "UNSUPP" },
|
||||||
|
/* JOB_COLLECTED */
|
||||||
|
[JOB_ONCE] = { ANSI_HIGHLIGHT_RED, " ONCE " },
|
||||||
|
};
|
||||||
|
|
||||||
|
static void job_print_done_status_message(Unit *u, JobType t, JobResult result) {
|
||||||
|
const char *format;
|
||||||
|
const char *status;
|
||||||
|
|
||||||
|
assert(u);
|
||||||
|
assert(t >= 0);
|
||||||
|
assert(t < _JOB_TYPE_MAX);
|
||||||
|
|
||||||
|
/* Reload status messages have traditionally not been printed to console. */
|
||||||
|
if (t == JOB_RELOAD)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* No message if the job did not actually do anything due to failed condition. */
|
||||||
|
if (t == JOB_START && result == JOB_DONE && !u->condition_result)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!job_print_done_status_messages[result].word)
|
||||||
|
return;
|
||||||
|
|
||||||
|
format = job_get_done_status_message_format(u, t, result);
|
||||||
|
if (!format)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (log_get_show_color())
|
||||||
|
status = strjoina(job_print_done_status_messages[result].color,
|
||||||
|
job_print_done_status_messages[result].word,
|
||||||
|
ANSI_NORMAL);
|
||||||
|
else
|
||||||
|
status = job_print_done_status_messages[result].word;
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL;
|
||||||
|
unit_status_printf(u,
|
||||||
|
result == JOB_DONE ? STATUS_TYPE_NORMAL : STATUS_TYPE_NOTICE,
|
||||||
|
status, format);
|
||||||
|
REENABLE_WARNING;
|
||||||
|
|
||||||
|
if (t == JOB_START && result == JOB_FAILED) {
|
||||||
|
_cleanup_free_ char *quoted = NULL;
|
||||||
|
|
||||||
|
quoted = shell_maybe_quote(u->id, 0);
|
||||||
|
manager_status_printf(u->manager, STATUS_TYPE_NORMAL, NULL, "See 'systemctl status %s' for details.", strna(quoted));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void job_log_done_status_message(Unit *u, uint32_t job_id, JobType t, JobResult result) {
|
||||||
|
const char *format, *mid;
|
||||||
|
char buf[LINE_MAX];
|
||||||
|
static const int job_result_log_level[_JOB_RESULT_MAX] = {
|
||||||
|
[JOB_DONE] = LOG_INFO,
|
||||||
|
[JOB_CANCELED] = LOG_INFO,
|
||||||
|
[JOB_TIMEOUT] = LOG_ERR,
|
||||||
|
[JOB_FAILED] = LOG_ERR,
|
||||||
|
[JOB_DEPENDENCY] = LOG_WARNING,
|
||||||
|
[JOB_SKIPPED] = LOG_NOTICE,
|
||||||
|
[JOB_INVALID] = LOG_INFO,
|
||||||
|
[JOB_ASSERT] = LOG_WARNING,
|
||||||
|
[JOB_UNSUPPORTED] = LOG_WARNING,
|
||||||
|
[JOB_COLLECTED] = LOG_INFO,
|
||||||
|
[JOB_ONCE] = LOG_ERR,
|
||||||
|
};
|
||||||
|
|
||||||
|
assert(u);
|
||||||
|
assert(t >= 0);
|
||||||
|
assert(t < _JOB_TYPE_MAX);
|
||||||
|
|
||||||
|
/* Skip printing if output goes to the console, and job_print_status_message()
|
||||||
|
will actually print something to the console. */
|
||||||
|
if (log_on_console() && job_print_done_status_messages[result].word)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Show condition check message if the job did not actually do anything due to failed condition. */
|
||||||
|
if (t == JOB_START && result == JOB_DONE && !u->condition_result) {
|
||||||
|
log_unit_struct(u, LOG_INFO,
|
||||||
|
"MESSAGE=Condition check resulted in %s being skipped.", unit_status_string(u),
|
||||||
|
"JOB_ID=%" PRIu32, job_id,
|
||||||
|
"JOB_TYPE=%s", job_type_to_string(t),
|
||||||
|
"JOB_RESULT=%s", job_result_to_string(result),
|
||||||
|
LOG_UNIT_INVOCATION_ID(u),
|
||||||
|
"MESSAGE_ID=" SD_MESSAGE_UNIT_STARTED_STR);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!unit_log_level_test(u, job_result_log_level[result]))
|
||||||
|
return;
|
||||||
|
|
||||||
|
format = job_get_done_status_message_format(u, t, result);
|
||||||
|
if (!format)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* The description might be longer than the buffer, but that's OK,
|
||||||
|
* we'll just truncate it here. Note that we use snprintf() rather than
|
||||||
|
* xsprintf() on purpose here: we are fine with truncation and don't
|
||||||
|
* consider that an error. */
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL;
|
||||||
|
(void) snprintf(buf, sizeof(buf), format, unit_status_string(u));
|
||||||
|
REENABLE_WARNING;
|
||||||
|
|
||||||
|
switch (t) {
|
||||||
|
|
||||||
|
case JOB_START:
|
||||||
|
if (result == JOB_DONE)
|
||||||
|
mid = "MESSAGE_ID=" SD_MESSAGE_UNIT_STARTED_STR;
|
||||||
|
else
|
||||||
|
mid = "MESSAGE_ID=" SD_MESSAGE_UNIT_FAILED_STR;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case JOB_RELOAD:
|
||||||
|
mid = "MESSAGE_ID=" SD_MESSAGE_UNIT_RELOADED_STR;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case JOB_STOP:
|
||||||
|
case JOB_RESTART:
|
||||||
|
mid = "MESSAGE_ID=" SD_MESSAGE_UNIT_STOPPED_STR;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
log_unit_struct(u, job_result_log_level[result],
|
||||||
|
LOG_MESSAGE("%s", buf),
|
||||||
|
"JOB_ID=%" PRIu32, job_id,
|
||||||
|
"JOB_TYPE=%s", job_type_to_string(t),
|
||||||
|
"JOB_RESULT=%s", job_result_to_string(result),
|
||||||
|
LOG_UNIT_INVOCATION_ID(u));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
log_unit_struct(u, job_result_log_level[result],
|
||||||
|
LOG_MESSAGE("%s", buf),
|
||||||
|
"JOB_ID=%" PRIu32, job_id,
|
||||||
|
"JOB_TYPE=%s", job_type_to_string(t),
|
||||||
|
"JOB_RESULT=%s", job_result_to_string(result),
|
||||||
|
LOG_UNIT_INVOCATION_ID(u),
|
||||||
|
mid);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void job_emit_done_status_message(Unit *u, uint32_t job_id, JobType t, JobResult result) {
|
||||||
|
assert(u);
|
||||||
|
|
||||||
|
job_log_done_status_message(u, job_id, t, result);
|
||||||
|
job_print_done_status_message(u, t, result);
|
||||||
|
}
|
||||||
|
|
||||||
static void job_fail_dependencies(Unit *u, UnitDependencyAtom match_atom) {
|
static void job_fail_dependencies(Unit *u, UnitDependencyAtom match_atom) {
|
||||||
Unit *other;
|
Unit *other;
|
||||||
|
|
||||||
@ -913,7 +985,7 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive, bool alr
|
|||||||
|
|
||||||
/* If this job did nothing to the respective unit we don't log the status message */
|
/* If this job did nothing to the respective unit we don't log the status message */
|
||||||
if (!already)
|
if (!already)
|
||||||
job_emit_done_message(u, j->id, t, result);
|
job_emit_done_status_message(u, j->id, t, result);
|
||||||
|
|
||||||
/* Patch restart jobs so that they become normal start jobs */
|
/* Patch restart jobs so that they become normal start jobs */
|
||||||
if (result == JOB_DONE && t == JOB_RESTART) {
|
if (result == JOB_DONE && t == JOB_RESTART) {
|
||||||
@ -1264,7 +1336,7 @@ int job_coldplug(Job *j) {
|
|||||||
if (timeout_time == USEC_INFINITY)
|
if (timeout_time == USEC_INFINITY)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
j->timer_event_source = sd_event_source_disable_unref(j->timer_event_source);
|
j->timer_event_source = sd_event_source_unref(j->timer_event_source);
|
||||||
|
|
||||||
r = sd_event_add_time(
|
r = sd_event_add_time(
|
||||||
j->manager->event,
|
j->manager->event,
|
||||||
|
|||||||
@ -2219,7 +2219,7 @@ static int do_queue_default_job(
|
|||||||
} else
|
} else
|
||||||
log_info("Queued %s job for default target %s.",
|
log_info("Queued %s job for default target %s.",
|
||||||
job_type_to_string(job->type),
|
job_type_to_string(job->type),
|
||||||
unit_status_string(job->unit, NULL));
|
unit_status_string(job->unit));
|
||||||
|
|
||||||
m->default_unit_job_id = job->id;
|
m->default_unit_job_id = job->id;
|
||||||
|
|
||||||
|
|||||||
@ -240,18 +240,11 @@ static void manager_print_jobs_in_progress(Manager *m) {
|
|||||||
if (job_get_timeout(j, &x) > 0)
|
if (job_get_timeout(j, &x) > 0)
|
||||||
format_timespan(limit, sizeof(limit), x - j->begin_usec, 1*USEC_PER_SEC);
|
format_timespan(limit, sizeof(limit), x - j->begin_usec, 1*USEC_PER_SEC);
|
||||||
|
|
||||||
/* We want to use enough information for the user to identify previous lines talking about the same
|
|
||||||
* unit, but keep the message as short as possible. So if 'Starting foo.service' or 'Starting
|
|
||||||
* foo.service (Description)' were used, 'foo.service' is enough here. On the other hand, if we used
|
|
||||||
* 'Starting Description' before, then we shall also use 'Description' here. So we pass NULL as the
|
|
||||||
* second argument to unit_status_string(). */
|
|
||||||
const char *ident = unit_status_string(j->unit, NULL);
|
|
||||||
|
|
||||||
manager_status_printf(m, STATUS_TYPE_EPHEMERAL, cylon,
|
manager_status_printf(m, STATUS_TYPE_EPHEMERAL, cylon,
|
||||||
"%sA %s job is running for %s (%s / %s)",
|
"%sA %s job is running for %s (%s / %s)",
|
||||||
strempty(job_of_n),
|
strempty(job_of_n),
|
||||||
job_type_to_string(j->type),
|
job_type_to_string(j->type),
|
||||||
ident,
|
unit_status_string(j->unit),
|
||||||
time, limit);
|
time, limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,7 +287,7 @@ static int manager_dispatch_ask_password_fd(sd_event_source *source,
|
|||||||
static void manager_close_ask_password(Manager *m) {
|
static void manager_close_ask_password(Manager *m) {
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
m->ask_password_event_source = sd_event_source_disable_unref(m->ask_password_event_source);
|
m->ask_password_event_source = sd_event_source_unref(m->ask_password_event_source);
|
||||||
m->ask_password_inotify_fd = safe_close(m->ask_password_inotify_fd);
|
m->ask_password_inotify_fd = safe_close(m->ask_password_inotify_fd);
|
||||||
m->have_ask_password = -EINVAL;
|
m->have_ask_password = -EINVAL;
|
||||||
}
|
}
|
||||||
@ -363,7 +356,7 @@ static int manager_watch_idle_pipe(Manager *m) {
|
|||||||
static void manager_close_idle_pipe(Manager *m) {
|
static void manager_close_idle_pipe(Manager *m) {
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
m->idle_pipe_event_source = sd_event_source_disable_unref(m->idle_pipe_event_source);
|
m->idle_pipe_event_source = sd_event_source_unref(m->idle_pipe_event_source);
|
||||||
|
|
||||||
safe_close_pair(m->idle_pipe);
|
safe_close_pair(m->idle_pipe);
|
||||||
safe_close_pair(m->idle_pipe + 2);
|
safe_close_pair(m->idle_pipe + 2);
|
||||||
@ -377,7 +370,7 @@ static int manager_setup_time_change(Manager *m) {
|
|||||||
if (MANAGER_IS_TEST_RUN(m))
|
if (MANAGER_IS_TEST_RUN(m))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
m->time_change_event_source = sd_event_source_disable_unref(m->time_change_event_source);
|
m->time_change_event_source = sd_event_source_unref(m->time_change_event_source);
|
||||||
m->time_change_fd = safe_close(m->time_change_fd);
|
m->time_change_fd = safe_close(m->time_change_fd);
|
||||||
|
|
||||||
m->time_change_fd = time_change_fd();
|
m->time_change_fd = time_change_fd();
|
||||||
@ -877,7 +870,7 @@ int manager_new(UnitFileScope scope, ManagerTestRunFlags test_run_flags, Manager
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (FLAGS_SET(test_run_flags, MANAGER_TEST_RUN_MINIMAL)) {
|
if (test_run_flags == MANAGER_TEST_RUN_MINIMAL) {
|
||||||
m->cgroup_root = strdup("");
|
m->cgroup_root = strdup("");
|
||||||
if (!m->cgroup_root)
|
if (!m->cgroup_root)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -945,7 +938,7 @@ static int manager_setup_notify(Manager *m) {
|
|||||||
|
|
||||||
/* First free all secondary fields */
|
/* First free all secondary fields */
|
||||||
m->notify_socket = mfree(m->notify_socket);
|
m->notify_socket = mfree(m->notify_socket);
|
||||||
m->notify_event_source = sd_event_source_disable_unref(m->notify_event_source);
|
m->notify_event_source = sd_event_source_unref(m->notify_event_source);
|
||||||
|
|
||||||
fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
|
fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
@ -1033,7 +1026,7 @@ static int manager_setup_cgroups_agent(Manager *m) {
|
|||||||
_cleanup_close_ int fd = -1;
|
_cleanup_close_ int fd = -1;
|
||||||
|
|
||||||
/* First free all secondary fields */
|
/* First free all secondary fields */
|
||||||
m->cgroups_agent_event_source = sd_event_source_disable_unref(m->cgroups_agent_event_source);
|
m->cgroups_agent_event_source = sd_event_source_unref(m->cgroups_agent_event_source);
|
||||||
|
|
||||||
fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
|
fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
@ -1098,7 +1091,7 @@ static int manager_setup_user_lookup_fd(Manager *m) {
|
|||||||
|
|
||||||
/* Free all secondary fields */
|
/* Free all secondary fields */
|
||||||
safe_close_pair(m->user_lookup_fds);
|
safe_close_pair(m->user_lookup_fds);
|
||||||
m->user_lookup_event_source = sd_event_source_disable_unref(m->user_lookup_event_source);
|
m->user_lookup_event_source = sd_event_source_unref(m->user_lookup_event_source);
|
||||||
|
|
||||||
if (socketpair(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0, m->user_lookup_fds) < 0)
|
if (socketpair(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0, m->user_lookup_fds) < 0)
|
||||||
return log_error_errno(errno, "Failed to allocate user lookup socket: %m");
|
return log_error_errno(errno, "Failed to allocate user lookup socket: %m");
|
||||||
@ -3696,7 +3689,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
|
|||||||
if (safe_atoi(val, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
|
if (safe_atoi(val, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
|
||||||
log_notice("Failed to parse notify fd, ignoring: \"%s\"", val);
|
log_notice("Failed to parse notify fd, ignoring: \"%s\"", val);
|
||||||
else {
|
else {
|
||||||
m->notify_event_source = sd_event_source_disable_unref(m->notify_event_source);
|
m->notify_event_source = sd_event_source_unref(m->notify_event_source);
|
||||||
safe_close(m->notify_fd);
|
safe_close(m->notify_fd);
|
||||||
m->notify_fd = fdset_remove(fds, fd);
|
m->notify_fd = fdset_remove(fds, fd);
|
||||||
}
|
}
|
||||||
@ -3712,7 +3705,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
|
|||||||
if (safe_atoi(val, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
|
if (safe_atoi(val, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
|
||||||
log_notice("Failed to parse cgroups agent fd, ignoring.: %s", val);
|
log_notice("Failed to parse cgroups agent fd, ignoring.: %s", val);
|
||||||
else {
|
else {
|
||||||
m->cgroups_agent_event_source = sd_event_source_disable_unref(m->cgroups_agent_event_source);
|
m->cgroups_agent_event_source = sd_event_source_unref(m->cgroups_agent_event_source);
|
||||||
safe_close(m->cgroups_agent_fd);
|
safe_close(m->cgroups_agent_fd);
|
||||||
m->cgroups_agent_fd = fdset_remove(fds, fd);
|
m->cgroups_agent_fd = fdset_remove(fds, fd);
|
||||||
}
|
}
|
||||||
@ -3723,7 +3716,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
|
|||||||
if (sscanf(val, "%i %i", &fd0, &fd1) != 2 || fd0 < 0 || fd1 < 0 || fd0 == fd1 || !fdset_contains(fds, fd0) || !fdset_contains(fds, fd1))
|
if (sscanf(val, "%i %i", &fd0, &fd1) != 2 || fd0 < 0 || fd1 < 0 || fd0 == fd1 || !fdset_contains(fds, fd0) || !fdset_contains(fds, fd1))
|
||||||
log_notice("Failed to parse user lookup fd, ignoring: %s", val);
|
log_notice("Failed to parse user lookup fd, ignoring: %s", val);
|
||||||
else {
|
else {
|
||||||
m->user_lookup_event_source = sd_event_source_disable_unref(m->user_lookup_event_source);
|
m->user_lookup_event_source = sd_event_source_unref(m->user_lookup_event_source);
|
||||||
safe_close_pair(m->user_lookup_fds);
|
safe_close_pair(m->user_lookup_fds);
|
||||||
m->user_lookup_fds[0] = fdset_remove(fds, fd0);
|
m->user_lookup_fds[0] = fdset_remove(fds, fd0);
|
||||||
m->user_lookup_fds[1] = fdset_remove(fds, fd1);
|
m->user_lookup_fds[1] = fdset_remove(fds, fd1);
|
||||||
|
|||||||
@ -266,7 +266,7 @@ static void mount_done(Unit *u) {
|
|||||||
|
|
||||||
mount_unwatch_control_pid(m);
|
mount_unwatch_control_pid(m);
|
||||||
|
|
||||||
m->timer_event_source = sd_event_source_disable_unref(m->timer_event_source);
|
m->timer_event_source = sd_event_source_unref(m->timer_event_source);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int update_parameters_proc_self_mountinfo(
|
static int update_parameters_proc_self_mountinfo(
|
||||||
@ -718,7 +718,7 @@ static void mount_set_state(Mount *m, MountState state) {
|
|||||||
m->state = state;
|
m->state = state;
|
||||||
|
|
||||||
if (!MOUNT_STATE_WITH_PROCESS(state)) {
|
if (!MOUNT_STATE_WITH_PROCESS(state)) {
|
||||||
m->timer_event_source = sd_event_source_disable_unref(m->timer_event_source);
|
m->timer_event_source = sd_event_source_unref(m->timer_event_source);
|
||||||
mount_unwatch_control_pid(m);
|
mount_unwatch_control_pid(m);
|
||||||
m->control_command = NULL;
|
m->control_command = NULL;
|
||||||
m->control_command_id = _MOUNT_EXEC_COMMAND_INVALID;
|
m->control_command_id = _MOUNT_EXEC_COMMAND_INVALID;
|
||||||
@ -1787,7 +1787,7 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
|
|||||||
static void mount_shutdown(Manager *m) {
|
static void mount_shutdown(Manager *m) {
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
m->mount_event_source = sd_event_source_disable_unref(m->mount_event_source);
|
m->mount_event_source = sd_event_source_unref(m->mount_event_source);
|
||||||
|
|
||||||
mnt_unref_monitor(m->mount_monitor);
|
mnt_unref_monitor(m->mount_monitor);
|
||||||
m->mount_monitor = NULL;
|
m->mount_monitor = NULL;
|
||||||
@ -2127,7 +2127,7 @@ static int mount_clean(Unit *u, ExecCleanMask mask) {
|
|||||||
fail:
|
fail:
|
||||||
log_unit_warning_errno(u, r, "Failed to initiate cleaning: %m");
|
log_unit_warning_errno(u, r, "Failed to initiate cleaning: %m");
|
||||||
m->clean_result = MOUNT_FAILURE_RESOURCES;
|
m->clean_result = MOUNT_FAILURE_RESOURCES;
|
||||||
m->timer_event_source = sd_event_source_disable_unref(m->timer_event_source);
|
m->timer_event_source = sd_event_source_unref(m->timer_event_source);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -275,7 +275,7 @@ static bool mount_entry_read_only(const MountEntry *p) {
|
|||||||
static bool mount_entry_noexec(const MountEntry *p) {
|
static bool mount_entry_noexec(const MountEntry *p) {
|
||||||
assert(p);
|
assert(p);
|
||||||
|
|
||||||
return p->noexec || IN_SET(p->mode, NOEXEC, INACCESSIBLE, SYSFS, PROCFS);
|
return p->noexec || IN_SET(p->mode, NOEXEC, INACCESSIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool mount_entry_exec(const MountEntry *p) {
|
static bool mount_entry_exec(const MountEntry *p) {
|
||||||
|
|||||||
@ -167,7 +167,7 @@ fail:
|
|||||||
void path_spec_unwatch(PathSpec *s) {
|
void path_spec_unwatch(PathSpec *s) {
|
||||||
assert(s);
|
assert(s);
|
||||||
|
|
||||||
s->event_source = sd_event_source_disable_unref(s->event_source);
|
s->event_source = sd_event_source_unref(s->event_source);
|
||||||
s->inotify_fd = safe_close(s->inotify_fd);
|
s->inotify_fd = safe_close(s->inotify_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ static void scope_done(Unit *u) {
|
|||||||
s->controller = mfree(s->controller);
|
s->controller = mfree(s->controller);
|
||||||
s->controller_track = sd_bus_track_unref(s->controller_track);
|
s->controller_track = sd_bus_track_unref(s->controller_track);
|
||||||
|
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int scope_arm_timer(Scope *s, usec_t usec) {
|
static int scope_arm_timer(Scope *s, usec_t usec) {
|
||||||
@ -92,7 +92,7 @@ static void scope_set_state(Scope *s, ScopeState state) {
|
|||||||
s->state = state;
|
s->state = state;
|
||||||
|
|
||||||
if (!IN_SET(state, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL))
|
if (!IN_SET(state, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL))
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
|
|
||||||
if (IN_SET(state, SCOPE_DEAD, SCOPE_FAILED)) {
|
if (IN_SET(state, SCOPE_DEAD, SCOPE_FAILED)) {
|
||||||
unit_unwatch_all_pids(UNIT(s));
|
unit_unwatch_all_pids(UNIT(s));
|
||||||
|
|||||||
@ -196,7 +196,7 @@ void service_close_socket_fd(Service *s) {
|
|||||||
static void service_stop_watchdog(Service *s) {
|
static void service_stop_watchdog(Service *s) {
|
||||||
assert(s);
|
assert(s);
|
||||||
|
|
||||||
s->watchdog_event_source = sd_event_source_disable_unref(s->watchdog_event_source);
|
s->watchdog_event_source = sd_event_source_unref(s->watchdog_event_source);
|
||||||
s->watchdog_timestamp = DUAL_TIMESTAMP_NULL;
|
s->watchdog_timestamp = DUAL_TIMESTAMP_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -395,8 +395,8 @@ static void service_done(Unit *u) {
|
|||||||
|
|
||||||
service_stop_watchdog(s);
|
service_stop_watchdog(s);
|
||||||
|
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
s->exec_fd_event_source = sd_event_source_disable_unref(s->exec_fd_event_source);
|
s->exec_fd_event_source = sd_event_source_unref(s->exec_fd_event_source);
|
||||||
|
|
||||||
service_release_resources(u);
|
service_release_resources(u);
|
||||||
}
|
}
|
||||||
@ -1055,7 +1055,7 @@ static void service_set_state(Service *s, ServiceState state) {
|
|||||||
SERVICE_FINAL_WATCHDOG, SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL,
|
SERVICE_FINAL_WATCHDOG, SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL,
|
||||||
SERVICE_AUTO_RESTART,
|
SERVICE_AUTO_RESTART,
|
||||||
SERVICE_CLEANING))
|
SERVICE_CLEANING))
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
|
|
||||||
if (!IN_SET(state,
|
if (!IN_SET(state,
|
||||||
SERVICE_START, SERVICE_START_POST,
|
SERVICE_START, SERVICE_START_POST,
|
||||||
@ -1091,7 +1091,7 @@ static void service_set_state(Service *s, ServiceState state) {
|
|||||||
service_close_socket_fd(s);
|
service_close_socket_fd(s);
|
||||||
|
|
||||||
if (state != SERVICE_START)
|
if (state != SERVICE_START)
|
||||||
s->exec_fd_event_source = sd_event_source_disable_unref(s->exec_fd_event_source);
|
s->exec_fd_event_source = sd_event_source_unref(s->exec_fd_event_source);
|
||||||
|
|
||||||
if (!IN_SET(state, SERVICE_START_POST, SERVICE_RUNNING, SERVICE_RELOAD))
|
if (!IN_SET(state, SERVICE_START_POST, SERVICE_RUNNING, SERVICE_RELOAD))
|
||||||
service_stop_watchdog(s);
|
service_stop_watchdog(s);
|
||||||
@ -1351,7 +1351,7 @@ static int service_allocate_exec_fd_event_source(
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_unit_error_errno(UNIT(s), r, "Failed to adjust priority of exec_fd event source: %m");
|
return log_unit_error_errno(UNIT(s), r, "Failed to adjust priority of exec_fd event source: %m");
|
||||||
|
|
||||||
(void) sd_event_source_set_description(source, "service exec_fd");
|
(void) sd_event_source_set_description(source, "service event_fd");
|
||||||
|
|
||||||
r = sd_event_source_set_io_fd_own(source, true);
|
r = sd_event_source_set_io_fd_own(source, true);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
@ -1433,8 +1433,6 @@ static int service_spawn(
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
assert(!s->exec_fd_event_source);
|
|
||||||
|
|
||||||
if (flags & EXEC_IS_CONTROL) {
|
if (flags & EXEC_IS_CONTROL) {
|
||||||
/* If this is a control process, mask the permissions/chroot application if this is requested. */
|
/* If this is a control process, mask the permissions/chroot application if this is requested. */
|
||||||
if (s->permissions_start_only)
|
if (s->permissions_start_only)
|
||||||
@ -1460,6 +1458,8 @@ static int service_spawn(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!FLAGS_SET(flags, EXEC_IS_CONTROL) && s->type == SERVICE_EXEC) {
|
if (!FLAGS_SET(flags, EXEC_IS_CONTROL) && s->type == SERVICE_EXEC) {
|
||||||
|
assert(!s->exec_fd_event_source);
|
||||||
|
|
||||||
r = service_allocate_exec_fd(s, &exec_fd_source, &exec_params.exec_fd);
|
r = service_allocate_exec_fd(s, &exec_fd_source, &exec_params.exec_fd);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
@ -3019,7 +3019,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
|
|||||||
if (safe_atoi(value, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
|
if (safe_atoi(value, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
|
||||||
log_unit_debug(u, "Failed to parse exec-fd value: %s", value);
|
log_unit_debug(u, "Failed to parse exec-fd value: %s", value);
|
||||||
else {
|
else {
|
||||||
s->exec_fd_event_source = sd_event_source_disable_unref(s->exec_fd_event_source);
|
s->exec_fd_event_source = sd_event_source_unref(s->exec_fd_event_source);
|
||||||
|
|
||||||
fd = fdset_remove(fds, fd);
|
fd = fdset_remove(fds, fd);
|
||||||
if (service_allocate_exec_fd_event_source(s, fd, &s->exec_fd_event_source) < 0)
|
if (service_allocate_exec_fd_event_source(s, fd, &s->exec_fd_event_source) < 0)
|
||||||
@ -3216,7 +3216,7 @@ static int service_dispatch_exec_io(sd_event_source *source, int fd, uint32_t ev
|
|||||||
}
|
}
|
||||||
if (n == 0) { /* EOF → the event we are waiting for */
|
if (n == 0) { /* EOF → the event we are waiting for */
|
||||||
|
|
||||||
s->exec_fd_event_source = sd_event_source_disable_unref(s->exec_fd_event_source);
|
s->exec_fd_event_source = sd_event_source_unref(s->exec_fd_event_source);
|
||||||
|
|
||||||
if (s->exec_fd_hot) { /* Did the child tell us to expect EOF now? */
|
if (s->exec_fd_hot) { /* Did the child tell us to expect EOF now? */
|
||||||
log_unit_debug(UNIT(s), "Got EOF on exec-fd");
|
log_unit_debug(UNIT(s), "Got EOF on exec-fd");
|
||||||
@ -3384,11 +3384,6 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
|
|||||||
else
|
else
|
||||||
clean_mode = EXIT_CLEAN_DAEMON;
|
clean_mode = EXIT_CLEAN_DAEMON;
|
||||||
|
|
||||||
if (s->main_pid == pid)
|
|
||||||
/* Clean up the exec_fd event source. The source owns its end of the pipe, so this will close
|
|
||||||
* that too. */
|
|
||||||
s->exec_fd_event_source = sd_event_source_disable_unref(s->exec_fd_event_source);
|
|
||||||
|
|
||||||
if (is_clean_exit(code, status, clean_mode, &s->success_status))
|
if (is_clean_exit(code, status, clean_mode, &s->success_status))
|
||||||
f = SERVICE_SUCCESS;
|
f = SERVICE_SUCCESS;
|
||||||
else if (code == CLD_EXITED)
|
else if (code == CLD_EXITED)
|
||||||
@ -4420,7 +4415,7 @@ static int service_clean(Unit *u, ExecCleanMask mask) {
|
|||||||
fail:
|
fail:
|
||||||
log_unit_warning_errno(u, r, "Failed to initiate cleaning: %m");
|
log_unit_warning_errno(u, r, "Failed to initiate cleaning: %m");
|
||||||
s->clean_result = SERVICE_FAILURE_RESOURCES;
|
s->clean_result = SERVICE_FAILURE_RESOURCES;
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4433,10 +4428,12 @@ static int service_can_clean(Unit *u, ExecCleanMask *ret) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const char *service_finished_job(Unit *u, JobType t, JobResult result) {
|
static const char *service_finished_job(Unit *u, JobType t, JobResult result) {
|
||||||
if (t == JOB_START &&
|
if (t == JOB_START && result == JOB_DONE) {
|
||||||
result == JOB_DONE &&
|
Service *s = SERVICE(u);
|
||||||
SERVICE(u)->type == SERVICE_ONESHOT)
|
|
||||||
|
if (s->type == SERVICE_ONESHOT)
|
||||||
return "Finished %s.";
|
return "Finished %s.";
|
||||||
|
}
|
||||||
|
|
||||||
/* Fall back to generic */
|
/* Fall back to generic */
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -4595,6 +4592,10 @@ const UnitVTable service_vtable = {
|
|||||||
.exit_status = service_exit_status,
|
.exit_status = service_exit_status,
|
||||||
|
|
||||||
.status_message_formats = {
|
.status_message_formats = {
|
||||||
|
.starting_stopping = {
|
||||||
|
[0] = "Starting %s...",
|
||||||
|
[1] = "Stopping %s...",
|
||||||
|
},
|
||||||
.finished_start_job = {
|
.finished_start_job = {
|
||||||
[JOB_FAILED] = "Failed to start %s.",
|
[JOB_FAILED] = "Failed to start %s.",
|
||||||
},
|
},
|
||||||
|
|||||||
@ -123,7 +123,6 @@ int status_printf(const char *status, ShowStatusFlags flags, const char *format,
|
|||||||
static const char* const status_unit_format_table[_STATUS_UNIT_FORMAT_MAX] = {
|
static const char* const status_unit_format_table[_STATUS_UNIT_FORMAT_MAX] = {
|
||||||
[STATUS_UNIT_FORMAT_NAME] = "name",
|
[STATUS_UNIT_FORMAT_NAME] = "name",
|
||||||
[STATUS_UNIT_FORMAT_DESCRIPTION] = "description",
|
[STATUS_UNIT_FORMAT_DESCRIPTION] = "description",
|
||||||
[STATUS_UNIT_FORMAT_COMBINED] = "combined",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DEFINE_STRING_TABLE_LOOKUP(status_unit_format, StatusUnitFormat);
|
DEFINE_STRING_TABLE_LOOKUP(status_unit_format, StatusUnitFormat);
|
||||||
|
|||||||
@ -25,7 +25,6 @@ typedef enum ShowStatusFlags {
|
|||||||
typedef enum StatusUnitFormat {
|
typedef enum StatusUnitFormat {
|
||||||
STATUS_UNIT_FORMAT_NAME,
|
STATUS_UNIT_FORMAT_NAME,
|
||||||
STATUS_UNIT_FORMAT_DESCRIPTION,
|
STATUS_UNIT_FORMAT_DESCRIPTION,
|
||||||
STATUS_UNIT_FORMAT_COMBINED,
|
|
||||||
_STATUS_UNIT_FORMAT_MAX,
|
_STATUS_UNIT_FORMAT_MAX,
|
||||||
_STATUS_UNIT_FORMAT_INVALID = -EINVAL,
|
_STATUS_UNIT_FORMAT_INVALID = -EINVAL,
|
||||||
} StatusUnitFormat;
|
} StatusUnitFormat;
|
||||||
|
|||||||
@ -180,14 +180,6 @@ static int slice_load(Unit *u) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (!u->description) {
|
|
||||||
_cleanup_free_ char *tmp = NULL;
|
|
||||||
|
|
||||||
r = unit_name_to_path(u->id, &tmp);
|
|
||||||
if (r >= 0) /* Failure is ignored… */
|
|
||||||
u->description = strjoin("Slice ", tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
return slice_verify(s);
|
return slice_verify(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -174,7 +174,7 @@ static void socket_done(Unit *u) {
|
|||||||
|
|
||||||
s->fdname = mfree(s->fdname);
|
s->fdname = mfree(s->fdname);
|
||||||
|
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int socket_arm_timer(Socket *s, usec_t usec) {
|
static int socket_arm_timer(Socket *s, usec_t usec) {
|
||||||
@ -934,7 +934,7 @@ static void socket_close_fds(Socket *s) {
|
|||||||
|
|
||||||
was_open = p->fd >= 0;
|
was_open = p->fd >= 0;
|
||||||
|
|
||||||
p->event_source = sd_event_source_disable_unref(p->event_source);
|
p->event_source = sd_event_source_unref(p->event_source);
|
||||||
p->fd = safe_close(p->fd);
|
p->fd = safe_close(p->fd);
|
||||||
socket_cleanup_fd_list(p);
|
socket_cleanup_fd_list(p);
|
||||||
|
|
||||||
@ -1834,7 +1834,7 @@ static void socket_set_state(Socket *s, SocketState state) {
|
|||||||
SOCKET_FINAL_SIGKILL,
|
SOCKET_FINAL_SIGKILL,
|
||||||
SOCKET_CLEANING)) {
|
SOCKET_CLEANING)) {
|
||||||
|
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
socket_unwatch_control_pid(s);
|
socket_unwatch_control_pid(s);
|
||||||
s->control_command = NULL;
|
s->control_command = NULL;
|
||||||
s->control_command_id = _SOCKET_EXEC_COMMAND_INVALID;
|
s->control_command_id = _SOCKET_EXEC_COMMAND_INVALID;
|
||||||
@ -2048,7 +2048,7 @@ static int socket_chown(Socket *s, pid_t *_pid) {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3416,7 +3416,7 @@ static int socket_clean(Unit *u, ExecCleanMask mask) {
|
|||||||
fail:
|
fail:
|
||||||
log_unit_warning_errno(u, r, "Failed to initiate cleaning: %m");
|
log_unit_warning_errno(u, r, "Failed to initiate cleaning: %m");
|
||||||
s->clean_result = SOCKET_FAILURE_RESOURCES;
|
s->clean_result = SOCKET_FAILURE_RESOURCES;
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3543,6 +3543,10 @@ const UnitVTable socket_vtable = {
|
|||||||
.bus_commit_properties = bus_socket_commit_properties,
|
.bus_commit_properties = bus_socket_commit_properties,
|
||||||
|
|
||||||
.status_message_formats = {
|
.status_message_formats = {
|
||||||
|
/*.starting_stopping = {
|
||||||
|
[0] = "Starting socket %s...",
|
||||||
|
[1] = "Stopping socket %s...",
|
||||||
|
},*/
|
||||||
.finished_start_job = {
|
.finished_start_job = {
|
||||||
[JOB_DONE] = "Listening on %s.",
|
[JOB_DONE] = "Listening on %s.",
|
||||||
[JOB_FAILED] = "Failed to listen on %s.",
|
[JOB_FAILED] = "Failed to listen on %s.",
|
||||||
|
|||||||
@ -179,7 +179,7 @@ static void swap_done(Unit *u) {
|
|||||||
|
|
||||||
swap_unwatch_control_pid(s);
|
swap_unwatch_control_pid(s);
|
||||||
|
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int swap_arm_timer(Swap *s, usec_t usec) {
|
static int swap_arm_timer(Swap *s, usec_t usec) {
|
||||||
@ -549,7 +549,7 @@ static void swap_set_state(Swap *s, SwapState state) {
|
|||||||
s->state = state;
|
s->state = state;
|
||||||
|
|
||||||
if (!SWAP_STATE_WITH_PROCESS(state)) {
|
if (!SWAP_STATE_WITH_PROCESS(state)) {
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
swap_unwatch_control_pid(s);
|
swap_unwatch_control_pid(s);
|
||||||
s->control_command = NULL;
|
s->control_command = NULL;
|
||||||
s->control_command_id = _SWAP_EXEC_COMMAND_INVALID;
|
s->control_command_id = _SWAP_EXEC_COMMAND_INVALID;
|
||||||
@ -710,7 +710,7 @@ static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@ -1368,7 +1368,7 @@ static int swap_following_set(Unit *u, Set **_set) {
|
|||||||
static void swap_shutdown(Manager *m) {
|
static void swap_shutdown(Manager *m) {
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
m->swap_event_source = sd_event_source_disable_unref(m->swap_event_source);
|
m->swap_event_source = sd_event_source_unref(m->swap_event_source);
|
||||||
m->proc_swaps = safe_fclose(m->proc_swaps);
|
m->proc_swaps = safe_fclose(m->proc_swaps);
|
||||||
m->swaps_by_devnode = hashmap_free(m->swaps_by_devnode);
|
m->swaps_by_devnode = hashmap_free(m->swaps_by_devnode);
|
||||||
}
|
}
|
||||||
@ -1576,7 +1576,7 @@ static int swap_clean(Unit *u, ExecCleanMask mask) {
|
|||||||
fail:
|
fail:
|
||||||
log_unit_warning_errno(u, r, "Failed to initiate cleaning: %m");
|
log_unit_warning_errno(u, r, "Failed to initiate cleaning: %m");
|
||||||
s->clean_result = SWAP_FAILURE_RESOURCES;
|
s->clean_result = SWAP_FAILURE_RESOURCES;
|
||||||
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
|
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -65,8 +65,8 @@ static void timer_done(Unit *u) {
|
|||||||
|
|
||||||
timer_free_values(t);
|
timer_free_values(t);
|
||||||
|
|
||||||
t->monotonic_event_source = sd_event_source_disable_unref(t->monotonic_event_source);
|
t->monotonic_event_source = sd_event_source_unref(t->monotonic_event_source);
|
||||||
t->realtime_event_source = sd_event_source_disable_unref(t->realtime_event_source);
|
t->realtime_event_source = sd_event_source_unref(t->realtime_event_source);
|
||||||
|
|
||||||
free(t->stamp_path);
|
free(t->stamp_path);
|
||||||
}
|
}
|
||||||
@ -296,8 +296,8 @@ static void timer_set_state(Timer *t, TimerState state) {
|
|||||||
t->state = state;
|
t->state = state;
|
||||||
|
|
||||||
if (state != TIMER_WAITING) {
|
if (state != TIMER_WAITING) {
|
||||||
t->monotonic_event_source = sd_event_source_disable_unref(t->monotonic_event_source);
|
t->monotonic_event_source = sd_event_source_unref(t->monotonic_event_source);
|
||||||
t->realtime_event_source = sd_event_source_disable_unref(t->realtime_event_source);
|
t->realtime_event_source = sd_event_source_unref(t->realtime_event_source);
|
||||||
t->next_elapse_monotonic_or_boottime = USEC_INFINITY;
|
t->next_elapse_monotonic_or_boottime = USEC_INFINITY;
|
||||||
t->next_elapse_realtime = USEC_INFINITY;
|
t->next_elapse_realtime = USEC_INFINITY;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -419,8 +419,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi
|
|||||||
unit_status_printf(delete->unit,
|
unit_status_printf(delete->unit,
|
||||||
STATUS_TYPE_NOTICE,
|
STATUS_TYPE_NOTICE,
|
||||||
status,
|
status,
|
||||||
"Ordering cycle found, skipping %s",
|
"Ordering cycle found, skipping %s");
|
||||||
unit_status_string(delete->unit, NULL));
|
|
||||||
transaction_delete_unit(tr, delete->unit);
|
transaction_delete_unit(tr, delete->unit);
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1331,7 +1331,7 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* unit_description(Unit *u) {
|
const char *unit_description(Unit *u) {
|
||||||
assert(u);
|
assert(u);
|
||||||
|
|
||||||
if (u->description)
|
if (u->description)
|
||||||
@ -1340,30 +1340,13 @@ const char* unit_description(Unit *u) {
|
|||||||
return strna(u->id);
|
return strna(u->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* unit_status_string(Unit *u, char **combined) {
|
const char *unit_status_string(Unit *u) {
|
||||||
assert(u);
|
assert(u);
|
||||||
assert(u->id);
|
|
||||||
|
|
||||||
/* Return u->id, u->description, or "{u->id} - {u->description}".
|
if (u->manager->status_unit_format == STATUS_UNIT_FORMAT_NAME && u->id)
|
||||||
* Versions with u->description are only used if it is set.
|
|
||||||
* The last option is used if configured and the caller provided 'combined' pointer. */
|
|
||||||
|
|
||||||
if (!u->description ||
|
|
||||||
streq(u->description, u->id) ||
|
|
||||||
u->manager->status_unit_format == STATUS_UNIT_FORMAT_NAME ||
|
|
||||||
(u->manager->status_unit_format == STATUS_UNIT_FORMAT_COMBINED && !combined))
|
|
||||||
return u->id;
|
return u->id;
|
||||||
|
|
||||||
if (u->description && u->manager->status_unit_format == STATUS_UNIT_FORMAT_COMBINED && combined) {
|
return unit_description(u);
|
||||||
char *t = strjoin(u->id, " - ", u->description);
|
|
||||||
if (t) {
|
|
||||||
*combined = t;
|
|
||||||
return t;
|
|
||||||
} else
|
|
||||||
log_oom();
|
|
||||||
}
|
|
||||||
|
|
||||||
return u->description;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Common implementation for multiple backends */
|
/* Common implementation for multiple backends */
|
||||||
@ -1747,16 +1730,15 @@ static bool unit_test_assert(Unit *u) {
|
|||||||
return u->assert_result;
|
return u->assert_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void unit_status_printf(Unit *u, StatusType status_type, const char *status, const char *format, const char *ident) {
|
void unit_status_printf(Unit *u, StatusType status_type, const char *status, const char *unit_status_msg_format) {
|
||||||
if (log_get_show_color()) {
|
const char *d;
|
||||||
if (u->manager->status_unit_format == STATUS_UNIT_FORMAT_COMBINED && strchr(ident, ' '))
|
|
||||||
ident = strjoina(ANSI_HIGHLIGHT, u->id, ANSI_NORMAL, " - ", u->description);
|
d = unit_status_string(u);
|
||||||
else
|
if (log_get_show_color())
|
||||||
ident = strjoina(ANSI_HIGHLIGHT, ident, ANSI_NORMAL);
|
d = strjoina(ANSI_HIGHLIGHT, d, ANSI_NORMAL);
|
||||||
}
|
|
||||||
|
|
||||||
DISABLE_WARNING_FORMAT_NONLITERAL;
|
DISABLE_WARNING_FORMAT_NONLITERAL;
|
||||||
manager_status_printf(u->manager, status_type, status, format, ident);
|
manager_status_printf(u->manager, status_type, status, unit_status_msg_format, d);
|
||||||
REENABLE_WARNING;
|
REENABLE_WARNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2946,7 +2928,7 @@ void unit_dequeue_rewatch_pids(Unit *u) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
log_warning_errno(r, "Failed to disable event source for tidying watched PIDs, ignoring: %m");
|
log_warning_errno(r, "Failed to disable event source for tidying watched PIDs, ignoring: %m");
|
||||||
|
|
||||||
u->rewatch_pids_event_source = sd_event_source_disable_unref(u->rewatch_pids_event_source);
|
u->rewatch_pids_event_source = sd_event_source_unref(u->rewatch_pids_event_source);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool unit_job_is_applicable(Unit *u, JobType j) {
|
bool unit_job_is_applicable(Unit *u, JobType j) {
|
||||||
|
|||||||
@ -765,7 +765,7 @@ int unit_set_slice(Unit *u, Unit *slice, UnitDependencyMask mask);
|
|||||||
int unit_set_default_slice(Unit *u);
|
int unit_set_default_slice(Unit *u);
|
||||||
|
|
||||||
const char *unit_description(Unit *u) _pure_;
|
const char *unit_description(Unit *u) _pure_;
|
||||||
const char *unit_status_string(Unit *u, char **combined);
|
const char *unit_status_string(Unit *u) _pure_;
|
||||||
|
|
||||||
bool unit_has_name(const Unit *u, const char *name);
|
bool unit_has_name(const Unit *u, const char *name);
|
||||||
|
|
||||||
@ -820,7 +820,7 @@ int unit_add_blockdev_dependency(Unit *u, const char *what, UnitDependencyMask m
|
|||||||
int unit_coldplug(Unit *u);
|
int unit_coldplug(Unit *u);
|
||||||
void unit_catchup(Unit *u);
|
void unit_catchup(Unit *u);
|
||||||
|
|
||||||
void unit_status_printf(Unit *u, StatusType status_type, const char *status, const char *format, const char *ident) _printf_(4, 0);
|
void unit_status_printf(Unit *u, StatusType status_type, const char *status, const char *unit_status_msg_format) _printf_(4, 0);
|
||||||
|
|
||||||
bool unit_need_daemon_reload(Unit *u);
|
bool unit_need_daemon_reload(Unit *u);
|
||||||
|
|
||||||
|
|||||||
@ -85,11 +85,6 @@ DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(event_source_type, int);
|
|||||||
SOURCE_DEFER, \
|
SOURCE_DEFER, \
|
||||||
SOURCE_INOTIFY)
|
SOURCE_INOTIFY)
|
||||||
|
|
||||||
/* This is used to assert that we didn't pass an unexpected source type to event_source_time_prioq_put().
|
|
||||||
* Time sources and ratelimited sources can be passed, so effectively this is the same as the
|
|
||||||
* EVENT_SOURCE_CAN_RATE_LIMIT() macro. */
|
|
||||||
#define EVENT_SOURCE_USES_TIME_PRIOQ(t) EVENT_SOURCE_CAN_RATE_LIMIT(t)
|
|
||||||
|
|
||||||
struct sd_event {
|
struct sd_event {
|
||||||
unsigned n_ref;
|
unsigned n_ref;
|
||||||
|
|
||||||
@ -1203,7 +1198,6 @@ static int event_source_time_prioq_put(
|
|||||||
|
|
||||||
assert(s);
|
assert(s);
|
||||||
assert(d);
|
assert(d);
|
||||||
assert(EVENT_SOURCE_USES_TIME_PRIOQ(s->type));
|
|
||||||
|
|
||||||
r = prioq_put(d->earliest, s, &s->earliest_index);
|
r = prioq_put(d->earliest, s, &s->earliest_index);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
@ -2980,7 +2974,6 @@ static int event_arm_timer(
|
|||||||
d->needs_rearm = false;
|
d->needs_rearm = false;
|
||||||
|
|
||||||
a = prioq_peek(d->earliest);
|
a = prioq_peek(d->earliest);
|
||||||
assert(!a || EVENT_SOURCE_USES_TIME_PRIOQ(a->type));
|
|
||||||
if (!a || a->enabled == SD_EVENT_OFF || time_event_source_next(a) == USEC_INFINITY) {
|
if (!a || a->enabled == SD_EVENT_OFF || time_event_source_next(a) == USEC_INFINITY) {
|
||||||
|
|
||||||
if (d->fd < 0)
|
if (d->fd < 0)
|
||||||
@ -2998,8 +2991,7 @@ static int event_arm_timer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
b = prioq_peek(d->latest);
|
b = prioq_peek(d->latest);
|
||||||
assert(!b || EVENT_SOURCE_USES_TIME_PRIOQ(b->type));
|
assert_se(b && b->enabled != SD_EVENT_OFF);
|
||||||
assert(b && b->enabled != SD_EVENT_OFF);
|
|
||||||
|
|
||||||
t = sleep_between(e, time_event_source_next(a), time_event_source_latest(b));
|
t = sleep_between(e, time_event_source_next(a), time_event_source_latest(b));
|
||||||
if (d->next == t)
|
if (d->next == t)
|
||||||
@ -3079,8 +3071,6 @@ static int process_timer(
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
s = prioq_peek(d->earliest);
|
s = prioq_peek(d->earliest);
|
||||||
assert(!s || EVENT_SOURCE_USES_TIME_PRIOQ(s->type));
|
|
||||||
|
|
||||||
if (!s || time_event_source_next(s) > n)
|
if (!s || time_event_source_next(s) > n)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3641,8 +3631,6 @@ static int dispatch_exit(sd_event *e) {
|
|||||||
assert(e);
|
assert(e);
|
||||||
|
|
||||||
p = prioq_peek(e->exit);
|
p = prioq_peek(e->exit);
|
||||||
assert(!p || p->type == SOURCE_EXIT);
|
|
||||||
|
|
||||||
if (!p || event_source_is_offline(p)) {
|
if (!p || event_source_is_offline(p)) {
|
||||||
e->state = SD_EVENT_FINISHED;
|
e->state = SD_EVENT_FINISHED;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -29,6 +29,10 @@ SUBSYSTEM=="graphics", KERNEL=="fb[0-9]", IMPORT{cmdline}="nomodeset", TAG+="mas
|
|||||||
SUBSYSTEM=="pci", ENV{ID_PCI_CLASS_FROM_DATABASE}=="Display controller", \
|
SUBSYSTEM=="pci", ENV{ID_PCI_CLASS_FROM_DATABASE}=="Display controller", \
|
||||||
ENV{DRIVER}=="", IMPORT{cmdline}="nomodeset", TAG+="seat", TAG+="master-of-seat"
|
ENV{DRIVER}=="", IMPORT{cmdline}="nomodeset", TAG+="seat", TAG+="master-of-seat"
|
||||||
|
|
||||||
|
# eXtreme Graphic Innovation Z7/Z9 (XG20 core), a rather ancient graphic chip,
|
||||||
|
# doesn't have a DRM driver and fallback to vesafb.
|
||||||
|
SUBSYSTEM=="pci", ATTR{vendor}=="0x18ca", ATTR{device}=="0x0020", TAG+="master-of-seat"
|
||||||
|
|
||||||
SUBSYSTEM=="drm", KERNEL=="card[0-9]*", TAG+="seat", TAG+="master-of-seat"
|
SUBSYSTEM=="drm", KERNEL=="card[0-9]*", TAG+="seat", TAG+="master-of-seat"
|
||||||
|
|
||||||
# Allow individual USB ports to be assigned to a seat
|
# Allow individual USB ports to be assigned to a seat
|
||||||
|
|||||||
@ -655,7 +655,7 @@ static int session_start_scope(Session *s, sd_bus_message *properties, sd_bus_er
|
|||||||
if (!scope)
|
if (!scope)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
description = strjoina("Session ", s->id, " of User ", s->user->user_record->user_name);
|
description = strjoina("Session ", s->id, " of user ", s->user->user_record->user_name);
|
||||||
|
|
||||||
r = manager_start_scope(
|
r = manager_start_scope(
|
||||||
s->manager,
|
s->manager,
|
||||||
|
|||||||
@ -36,12 +36,12 @@ static int static_address_on_conflict(Link *link, Address *address) {
|
|||||||
assert(address);
|
assert(address);
|
||||||
|
|
||||||
if (address_get(link, address, NULL) < 0) {
|
if (address_get(link, address, NULL) < 0) {
|
||||||
log_link_warning(link, "Cannot configure requested address "IPV4_ADDRESS_FMT_STR", as an address conflict was detected.",
|
log_link_warning(link, "Cannot configure requested address "IPV4_ADDRESS_FMT_STR", as an address conflict is detected.",
|
||||||
IPV4_ADDRESS_FMT_VAL(address->in_addr.in));
|
IPV4_ADDRESS_FMT_VAL(address->in_addr.in));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_link_warning(link, "Dropping address "IPV4_ADDRESS_FMT_STR", as an address conflict was detected.",
|
log_link_warning(link, "Dropping address "IPV4_ADDRESS_FMT_STR", as an address conflict is detected.",
|
||||||
IPV4_ADDRESS_FMT_VAL(address->in_addr.in));
|
IPV4_ADDRESS_FMT_VAL(address->in_addr.in));
|
||||||
|
|
||||||
r = address_remove(address, link);
|
r = address_remove(address, link);
|
||||||
@ -66,7 +66,7 @@ static int dhcp4_address_on_conflict(Link *link) {
|
|||||||
/* Unlikely, but during probing the address, the lease may be lost. */
|
/* Unlikely, but during probing the address, the lease may be lost. */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
log_link_warning(link, "Dropping DHCPv4 lease, as an address conflict was detected.");
|
log_link_warning(link, "Dropping DHCPv4 lease, as an address conflict is detected.");
|
||||||
r = dhcp4_lease_lost(link);
|
r = dhcp4_lease_lost(link);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_link_warning_errno(link, r, "Failed to drop DHCPv4 lease: %m");
|
return log_link_warning_errno(link, r, "Failed to drop DHCPv4 lease: %m");
|
||||||
|
|||||||
@ -1998,7 +1998,7 @@ static int link_update_master(Link *link, sd_netlink_message *message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int link_update_hardware_address(Link *link, sd_netlink_message *message) {
|
static int link_update_hardware_address(Link *link, sd_netlink_message *message) {
|
||||||
struct hw_addr_data addr;
|
struct hw_addr_data old;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
assert(link);
|
assert(link);
|
||||||
@ -2008,27 +2008,26 @@ static int link_update_hardware_address(Link *link, sd_netlink_message *message)
|
|||||||
if (r < 0 && r != -ENODATA)
|
if (r < 0 && r != -ENODATA)
|
||||||
return log_link_debug_errno(link, r, "rtnl: failed to read broadcast address: %m");
|
return log_link_debug_errno(link, r, "rtnl: failed to read broadcast address: %m");
|
||||||
|
|
||||||
r = netlink_message_read_hw_addr(message, IFLA_ADDRESS, &addr);
|
old = link->hw_addr;
|
||||||
|
r = netlink_message_read_hw_addr(message, IFLA_ADDRESS, &link->hw_addr);
|
||||||
if (r == -ENODATA)
|
if (r == -ENODATA)
|
||||||
return 0;
|
return 0;
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_link_debug_errno(link, r, "rtnl: failed to read hardware address: %m");
|
return log_link_debug_errno(link, r, "rtnl: failed to read hardware address: %m");
|
||||||
|
|
||||||
if (hw_addr_equal(&link->hw_addr, &addr))
|
if (hw_addr_equal(&link->hw_addr, &old))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (hw_addr_is_null(&link->hw_addr))
|
if (hw_addr_is_null(&old))
|
||||||
log_link_debug(link, "Saved hardware address: %s", HW_ADDR_TO_STR(&addr));
|
log_link_debug(link, "Saved hardware address: %s", HW_ADDR_TO_STR(&link->hw_addr));
|
||||||
else {
|
else {
|
||||||
log_link_debug(link, "Hardware address is changed: %s → %s",
|
log_link_debug(link, "Hardware address is changed: %s → %s",
|
||||||
HW_ADDR_TO_STR(&link->hw_addr), HW_ADDR_TO_STR(&addr));
|
HW_ADDR_TO_STR(&old), HW_ADDR_TO_STR(&link->hw_addr));
|
||||||
|
|
||||||
if (hashmap_get(link->manager->links_by_hw_addr, &link->hw_addr) == link)
|
if (hashmap_get(link->manager->links_by_hw_addr, &old) == link)
|
||||||
hashmap_remove(link->manager->links_by_hw_addr, &link->hw_addr);
|
hashmap_remove(link->manager->links_by_hw_addr, &old);
|
||||||
}
|
}
|
||||||
|
|
||||||
link->hw_addr = addr;
|
|
||||||
|
|
||||||
if (!hw_addr_is_null(&link->hw_addr)) {
|
if (!hw_addr_is_null(&link->hw_addr)) {
|
||||||
r = hashmap_ensure_put(&link->manager->links_by_hw_addr, &hw_addr_hash_ops, &link->hw_addr, link);
|
r = hashmap_ensure_put(&link->manager->links_by_hw_addr, &hw_addr_hash_ops, &link->hw_addr, link);
|
||||||
if (r == -EEXIST && streq_ptr(link->kind, "bond"))
|
if (r == -EEXIST && streq_ptr(link->kind, "bond"))
|
||||||
|
|||||||
@ -8,6 +8,6 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Bluetooth Support
|
Description=Bluetooth
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
StopWhenUnneeded=yes
|
StopWhenUnneeded=yes
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Exit the Container
|
Description=Exit the container
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=systemd-exit.service
|
Requires=systemd-exit.service
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Late Boot Services
|
Description=Final Step
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
RefuseManualStart=yes
|
RefuseManualStart=yes
|
||||||
|
|||||||
@ -8,6 +8,6 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Preparation for Logins
|
Description=Login Prompts (Pre)
|
||||||
Documentation=man:systemd.special(7) man:systemd-getty-generator(8)
|
Documentation=man:systemd.special(7) man:systemd-getty-generator(8)
|
||||||
Documentation=http://0pointer.de/blog/projects/serial-console.html
|
Documentation=http://0pointer.de/blog/projects/serial-console.html
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=System Halt
|
Description=Halt
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=systemd-halt.service
|
Requires=systemd-halt.service
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=System Hibernation
|
Description=Hibernate
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=systemd-hibernate.service
|
Requires=systemd-hibernate.service
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Create List of Static Device Nodes
|
Description=Create list of static device nodes for the current kernel
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Before=sysinit.target systemd-tmpfiles-setup-dev.service
|
Before=sysinit.target systemd-tmpfiles-setup-dev.service
|
||||||
ConditionCapability=CAP_SYS_MODULE
|
ConditionCapability=CAP_SYS_MODULE
|
||||||
|
|||||||
@ -8,6 +8,6 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Preparation for Local File Systems
|
Description=Local File Systems (Pre)
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
RefuseManualStart=yes
|
RefuseManualStart=yes
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Preparation for Network
|
Description=Network (Pre)
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
Documentation=https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
|
Documentation=https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
|
||||||
RefuseManualStart=yes
|
RefuseManualStart=yes
|
||||||
|
|||||||
@ -8,5 +8,5 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Path Units
|
Description=Paths
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=System Power Off
|
Description=Power-Off
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=systemd-poweroff.service
|
Requires=systemd-poweroff.service
|
||||||
|
|||||||
@ -8,6 +8,6 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Printer Support
|
Description=Printer
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
StopWhenUnneeded=yes
|
StopWhenUnneeded=yes
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=System Reboot
|
Description=Reboot
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=systemd-reboot.service
|
Requires=systemd-reboot.service
|
||||||
|
|||||||
@ -8,6 +8,6 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Preparation for Remote File Systems
|
Description=Remote File Systems (Pre)
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
RefuseManualStart=yes
|
RefuseManualStart=yes
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=System Shutdown
|
Description=Shutdown
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
RefuseManualStart=yes
|
RefuseManualStart=yes
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Slice Units
|
Description=Slices
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
Wants=-.slice system.slice
|
Wants=-.slice system.slice
|
||||||
After=-.slice system.slice
|
After=-.slice system.slice
|
||||||
|
|||||||
@ -8,5 +8,5 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Socket Units
|
Description=Sockets
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
|
|||||||
@ -8,5 +8,5 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Swaps
|
Description=Swap
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=System Halt
|
Description=Halt
|
||||||
Documentation=man:systemd-halt.service(8)
|
Documentation=man:systemd-halt.service(8)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=shutdown.target umount.target final.target
|
Requires=shutdown.target umount.target final.target
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Network Configuration
|
Description=Network Service
|
||||||
Documentation=man:systemd-networkd.service(8)
|
Documentation=man:systemd-networkd.service(8)
|
||||||
ConditionCapability=CAP_NET_ADMIN
|
ConditionCapability=CAP_NET_ADMIN
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=System Power Off
|
Description=Power-Off
|
||||||
Documentation=man:systemd-poweroff.service(8)
|
Documentation=man:systemd-poweroff.service(8)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=shutdown.target umount.target final.target
|
Requires=shutdown.target umount.target final.target
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=System Reboot
|
Description=Reboot
|
||||||
Documentation=man:systemd-reboot.service(8)
|
Documentation=man:systemd-reboot.service(8)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=shutdown.target umount.target final.target
|
Requires=shutdown.target umount.target final.target
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=System Suspend
|
Description=Suspend
|
||||||
Documentation=man:systemd-suspend.service(8)
|
Documentation=man:systemd-suspend.service(8)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=sleep.target
|
Requires=sleep.target
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Record Runlevel Change in UTMP
|
Description=Update UTMP about System Runlevel Changes
|
||||||
Documentation=man:systemd-update-utmp-runlevel.service(8) man:utmp(5)
|
Documentation=man:systemd-update-utmp-runlevel.service(8) man:utmp(5)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
RequiresMountsFor=/var/log/wtmp
|
RequiresMountsFor=/var/log/wtmp
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Record System Boot/Shutdown in UTMP
|
Description=Update UTMP about System Boot/Shutdown
|
||||||
Documentation=man:systemd-update-utmp.service(8) man:utmp(5)
|
Documentation=man:systemd-update-utmp.service(8) man:utmp(5)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
RequiresMountsFor=/var/log/wtmp
|
RequiresMountsFor=/var/log/wtmp
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Timer Units
|
Description=Timers
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
|
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Temporary Directory /tmp
|
Description=Temporary Directory (/tmp)
|
||||||
Documentation=https://systemd.io/TEMPORARY_DIRECTORIES
|
Documentation=https://systemd.io/TEMPORARY_DIRECTORIES
|
||||||
Documentation=man:file-hierarchy(7)
|
Documentation=man:file-hierarchy(7)
|
||||||
Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
|
Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user