mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
network-generator: Add logging
We stick to debug logging because in some cases network-generator will fall back to trying another parsing function if one fails, so if we return an error it's not necessarily a failure.
This commit is contained in:
@@ -48,7 +48,7 @@ static int network_save(Network *network, const char *dest_dir) {
|
||||
|
||||
r = conservative_rename(temp_path, p);
|
||||
if (r < 0)
|
||||
return r;
|
||||
return log_error_errno(r, "Failed to rename '%s' to '%s': %m", temp_path, p);
|
||||
|
||||
temp_path = mfree(temp_path);
|
||||
return 0;
|
||||
@@ -79,7 +79,7 @@ static int netdev_save(NetDev *netdev, const char *dest_dir) {
|
||||
|
||||
r = conservative_rename(temp_path, p);
|
||||
if (r < 0)
|
||||
return r;
|
||||
return log_error_errno(r, "Failed to rename '%s' to '%s': %m", temp_path, p);
|
||||
|
||||
temp_path = mfree(temp_path);
|
||||
return 0;
|
||||
@@ -113,7 +113,7 @@ static int link_save(Link *link, const char *dest_dir) {
|
||||
|
||||
r = conservative_rename(temp_path, p);
|
||||
if (r < 0)
|
||||
return r;
|
||||
return log_error_errno(r, "Failed to rename '%s' to '%s': %m", temp_path, p);
|
||||
|
||||
temp_path = mfree(temp_path);
|
||||
return 0;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,7 +49,7 @@ run_network_generator() {
|
||||
|
||||
rm -rf "${WORK_DIR:?}"/*
|
||||
stderr="$WORK_DIR/stderr"
|
||||
if ! "$GENERATOR_BIN" --root "$WORK_DIR" 2>"$stderr"; then
|
||||
if ! SYSTEMD_LOG_LEVEL="info" "$GENERATOR_BIN" --root "$WORK_DIR" 2>"$stderr"; then
|
||||
echo >&2 "Generator failed when parsing $SYSTEMD_PROC_CMDLINE"
|
||||
cat >&2 "$stderr"
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user