/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "dbus-target.h"
#include "log.h"
#include "special.h"
#include "string-util.h"
#include "unit-name.h"
#include "unit.h"
#include "target.h"
[TARGET_DEAD] = UNIT_INACTIVE,
};
assert(t);
log_debug("%s changed %s -> %s",
}
};
Iterator i;
int r;
unsigned k;
assert(t);
/* Imply ordering for requirement dependencies on target
* units. Note that when the user created a contradicting
* ordering manually we won't add anything in here to make
* sure we don't create a loop. */
for (k = 0; k < ELEMENTSOF(deps); k++)
if (r < 0)
return r;
}
/* Make sure targets are unloaded on shutdown */
}
int r;
assert(t);
r = unit_load_fragment_and_dropin(u);
if (r < 0)
return r;
/* This is a new unit? Then let's add in some extras */
r = target_add_default_dependencies(t);
if (r < 0)
return r;
}
return 0;
}
assert(t);
if (t->deserialized_state != t->state)
target_set_state(t, t->deserialized_state);
return 0;
}
assert(t);
assert(f);
fprintf(f,
"%sTarget State: %s\n",
}
assert(t);
return 1;
}
assert(t);
return 1;
}
assert(s);
assert(f);
return 0;
}
assert(u);
if (state < 0)
else
s->deserialized_state = state;
} else
return 0;
}
assert(u);
}
assert(u);
}
.object_size = sizeof(Target),
.sections =
"Unit\0"
"Target\0"
"Install\0",
.load = target_load,
.dump = target_dump,
.start = target_start,
.stop = target_stop,
.finished_start_job = {
[JOB_DONE] = "Reached target %s.",
},
.finished_stop_job = {
[JOB_DONE] = "Stopped target %s.",
},
},
};