Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
steam
systemd
Commits
2791a8f8
Commit
2791a8f8
authored
Mar 17, 2011
by
Lennart Poettering
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unit: serialize condition test results
parent
d59d0a2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
8 deletions
+27
-8
TODO
TODO
+6
-8
src/unit.c
src/unit.c
+21
-0
No files found.
TODO
View file @
2791a8f8
...
...
@@ -22,19 +22,13 @@ F15:
* 0595f9a1c182a84581749823ef47c5f292e545f9 is borked, freezes shutdown
* capability_bounding_set_drop not used.
* recreate private socket on SIGUSR2
* serialize condition execution information
* capability_bounding_set_drop not used
* rework syslog.service being up logic in PID 1
* rsyslog.service should hook itself into syslog.target?
* syslog.target should be pulled in by multi-user.target
* don't strip facility from kmsg log messages as soon as that is possible.
* syslog.target should be pulled in by multi-user.target?
* pull in .service from meta .targers AND vice versa too. i.e. syslog.target ←→ rsyslog.service, rpcbind similarly
...
...
@@ -42,6 +36,10 @@ F15:
Features:
* don't strip facility from kmsg log messages as soon as that is possible.
* recreate private socket on SIGUSR2
* optionally create watched directories in .path units
* Support --test based on current system state
...
...
src/unit.c
View file @
2791a8f8
...
...
@@ -647,6 +647,13 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
condition_dump_list
(
u
->
meta
.
conditions
,
f
,
prefix
);
if
(
dual_timestamp_is_set
(
&
u
->
meta
.
condition_timestamp
))
fprintf
(
f
,
"%s
\t
Condition Timestamp: %s
\n
"
"%s
\t
Condition Result: %s
\n
"
,
prefix
,
strna
(
format_timestamp
(
timestamp1
,
sizeof
(
timestamp1
),
u
->
meta
.
condition_timestamp
.
realtime
)),
prefix
,
yes_no
(
u
->
meta
.
condition_result
));
for
(
d
=
0
;
d
<
_UNIT_DEPENDENCY_MAX
;
d
++
)
{
Unit
*
other
;
...
...
@@ -2080,6 +2087,10 @@ int unit_serialize(Unit *u, FILE *f, FDSet *fds) {
dual_timestamp_serialize
(
f
,
"active-enter-timestamp"
,
&
u
->
meta
.
active_enter_timestamp
);
dual_timestamp_serialize
(
f
,
"active-exit-timestamp"
,
&
u
->
meta
.
active_exit_timestamp
);
dual_timestamp_serialize
(
f
,
"inactive-enter-timestamp"
,
&
u
->
meta
.
inactive_enter_timestamp
);
dual_timestamp_serialize
(
f
,
"condition-timestamp"
,
&
u
->
meta
.
condition_timestamp
);
if
(
dual_timestamp_is_set
(
&
u
->
meta
.
condition_timestamp
))
unit_serialize_item
(
u
,
f
,
"condition-result"
,
yes_no
(
u
->
meta
.
condition_result
));
/* End marker */
fputc
(
'\n'
,
f
);
...
...
@@ -2169,6 +2180,16 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
}
else
if
(
streq
(
l
,
"inactive-enter-timestamp"
))
{
dual_timestamp_deserialize
(
v
,
&
u
->
meta
.
inactive_enter_timestamp
);
continue
;
}
else
if
(
streq
(
l
,
"condition-timestamp"
))
{
dual_timestamp_deserialize
(
v
,
&
u
->
meta
.
condition_timestamp
);
continue
;
}
else
if
(
streq
(
l
,
"condition-result"
))
{
int
b
;
if
((
b
=
parse_boolean
(
v
))
<
0
)
log_debug
(
"Failed to parse condition result value %s"
,
v
);
else
u
->
meta
.
condition_result
=
b
;
}
if
((
r
=
UNIT_VTABLE
(
u
)
->
deserialize_item
(
u
,
l
,
v
,
fds
))
<
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment