1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

139 Commits

Author SHA1 Message Date
Michal Schmidt
ac155bb885 unit: remove union Unit
Now that objects of all unit types are allocated the exact amount of
memory they need, the Unit union has lost its purpose. Remove it.

"Unit" is a more natural name for the base unit class than "Meta", so
rename Meta to Unit.

Access to members of the base class gets simplified.
2012-01-16 13:34:42 +01:00
Michal Schmidt
7d17cfbc46 unit: reduce heap usage for unit objects
The storage of the unit objects on the heap is currently not very
efficient. For every unit object we allocate a chunk of memory as large
as the biggest unit type, although there are significant differences in
the units' real requirements.
pahole shows the following sizes of structs:
488  Target
496  Snapshot
512  Device
528  Path
560  Timer
576  Automount
1080 Socket
1160 Swap
1168 Service
1280 Mount

Usually there aren't many targets or snapshots in the system, but Device
is one of the most common unit types and for every one we waste
1280 - 512 = 768 bytes.

Fix it by allocating only the right amount for the given unit type.
On my machine (x86_64, with 39 LVM volumes) this decreases systemd's
USS (unique set size) by more than 300 KB.
2012-01-16 13:34:42 +01:00
Lennart Poettering
4cfa2c999d core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
Lennart Poettering
4dcc1cb415 unit: implement new PropagateReloadTo=/PropagateReloadFrom= operations 2012-01-11 02:52:34 +01:00
Lennart Poettering
57020a3abf unit: properly update references to units which are merged
When we merge units that some kind of object points to, those pointers
might become invalidated, and needs to be updated. Introduce a UnitRef
struct which links up all the unit references, to ensure corrected
references.

At the same time, drop configured_sockets in the Service object, and
replace it by proper UNIT_TRIGGERS resp. UNIT_TRIGGERED_BY dependencies,
which allow us to simplify a lot of code.
2012-01-06 23:08:54 +01:00
Lennart Poettering
706343f492 journal: introduce log target 'journal' for executed processes 2012-01-06 02:48:38 +01:00
Lennart Poettering
54fe0cdbe3 execute: talk directly to the journald, instead to the stdout-syslog-bridge 2012-01-05 21:39:08 +01:00
Lennart Poettering
67e5cc4f3e util: never ellipsize welcome message 2012-01-05 15:39:07 +01:00
Lennart Poettering
81beb7508e util: when printing status updates during boot, take terminal width into account 2012-01-05 14:55:35 +01:00
Michal Schmidt
cd0504d0a1 unit: check for unneeded dependencies even when unit stop was expected
systemd did not stop units marked as "StopWhenUnneeded=yes" when the requiring
unit was stopped on user's request.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=704197
2011-12-09 15:25:29 +01:00
Michal Schmidt
f60c2665f9 unit: fix false positive in check for unneeded unit
A freshly started unit A was immediately considered unneeded just because
unit B, which Requires A, was starting later in the transaction.
Fix it by looking not only at the state of B, but also at its pending job.

Also fix a copied&pasted comment.
2011-12-09 15:24:04 +01:00
Michal Schmidt
9a46fc3b90 unit: garbage collect units with load error
Units that failed to load were never cleaned up. It was possible to
reach the 128K limit of units by attempting to load a bunch of nonsense.

Bug observed by Reartes Guillermo in
https://bugzilla.redhat.com/show_bug.cgi?id=680122
2011-12-06 00:52:37 +01:00
Thomas Jarosch
085c98af4e Fix same expression on both sides of '&&'
The code should probably look like the statements above it.
Please verify, I just detected it using cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
2011-11-14 18:08:27 +01:00
Michal Schmidt
5831e9b726 job: colored status messages on boot
The lack or green/red status marks on boot has been described by some
users as "critical", "dramatic", "dealbreaker", "showstopper". Seriously.
2011-11-11 00:27:02 +01:00
Michal Schmidt
a65cb51f29 unit: fix complementing of requirement deps with After deps for targets
'man systemd.target' says:
  Unless DefaultDependencies= is set to false, target units will
  implicitly complement all configured dependencies of type
  Wants=, Requires=, RequiresOverridable= with dependencies of type
  After=  if the units in question also have DefaultDependencies=true.

It did not work because of a forgotten negation.
2011-09-23 16:28:27 +02:00
Lennart Poettering
a82e5507a6 unit: don't recheck conditions when a unit is already starting but unit_start() is invoked 2011-09-22 21:32:18 +02:00
Lennart Poettering
27d340c772 fsck: show progress while fscking at boot 2011-09-01 21:05:06 +02:00
Lennart Poettering
346bce1f4c stdout-bridge: rename logger to stdout-syslog-bridge to make it more descriptive 2011-08-30 22:42:49 +02:00
Lennart Poettering
d8bbda9141 cgroup: expose cgroup attributes as unit properties on the bus 2011-08-21 20:07:08 +02:00
Lennart Poettering
ab1f063390 exec: optionally apply cgroup attributes to the cgroups we create 2011-08-20 00:22:02 +02:00
Lennart Poettering
cd0ed1db9b util: more join() optimizations 2011-08-01 02:45:51 +02:00
Lennart Poettering
a43757462a dbus: export unit file state 2011-07-31 18:28:02 +02:00
Lennart Poettering
a755605296 manager: merge serialization and desrialization counter into one, and increase it when reexecuting
Instead of having individual counters n_serializing and n_deserializing
have a single one n_reloading, which should be sufficient.

Set n_reloading when we are about to go down for reexecution to avoid
cgroup trimming when we free the units for reexecution.
2011-07-06 00:47:42 +02:00
Lennart Poettering
0aef434548 unit: add three new specifiers to use in unit files 2011-07-01 00:41:18 +02:00
Lennart Poettering
e025b4c306 unit: consider all cgroups in the name=systemd hierarchy, even when the user has specified an explicit path in it 2011-06-30 02:41:01 +02:00
Lennart Poettering
5f4b19f4bc service: check whether sysv scripts where changed 2011-06-21 19:29:45 +02:00
Lennart Poettering
ab5c3e3ff1 english: s/_per_/_by_/ 2011-06-21 19:29:44 +02:00
Lennart Poettering
7a6000a682 unit: make ignoring in snapshots a per unit property, instead of a per unit type property 2011-05-05 10:58:55 +02:00
Lennart Poettering
796ba55494 unit: fix assert when trying to load unit instances for uninstanciable types
http://lists.freedesktop.org/archives/systemd-devel/2011-April/001910.html
2011-04-28 01:26:42 +02:00
Lennart Poettering
38c52d4606 cgroup: don't accidentaly trim on reload
https://bugzilla.redhat.com/show_bug.cgi?id=678555
2011-04-20 03:53:12 +02:00
Lennart Poettering
c8f4d7642b manager: introduce IgnoreOnIsolate flag so that we can keep systemd-logger around when isolating 2011-04-16 02:03:34 +02:00
Lennart Poettering
df18d8c895 unit: skip default cgroup setup if we have no hierarchy to work on 2011-04-13 04:35:34 +02:00
Lennart Poettering
cc93c1b286 unit: fix dump output 2011-04-10 03:27:27 +02:00
Lennart Poettering
20c03b7be2 don't make up buffer sizes, use standard LINE_MAX instead 2011-04-07 18:48:50 +02:00
Lennart Poettering
f68319bbb8 unit: disallow configuration of more than one on_failure dependencies if OnFailureIsolate= is on 2011-04-07 18:47:35 +02:00
Lennart Poettering
ffd73e3599 unit: pull in logger unit only when running in system mode 2011-04-07 18:47:11 +02:00
Lennart Poettering
222ae6a8d7 unit: introduce OnFailureIsolate= 2011-04-07 04:11:31 +02:00
Lennart Poettering
cebe0d41e4 job: fix deserialization of jobs: do not ignore ordering 2011-04-06 19:09:33 +02:00
Lennart Poettering
da19d5c19f src: our lord is coverity 2011-03-31 15:35:40 +02:00
Lennart Poettering
3b2775c5ce unit: when deserializing do reconnect to dbus/syslog when they show up 2011-03-30 20:16:07 +02:00
Lennart Poettering
bdbf995180 unit: don't override timestamps due to state changes when deserializing 2011-03-30 20:04:20 +02:00
Lennart Poettering
6faa11140b status: show status messages unconditionally if plymouth is around 2011-03-30 02:21:48 +02:00
Lennart Poettering
efbac6d29c unit: fix parsing of condition-result 2011-03-29 23:32:31 +02:00
Lennart Poettering
d325ef27a7 unit: don't complain about failed units when deserializing 2011-03-29 23:32:10 +02:00
Lennart Poettering
e6402d1077 unit: when deserializing jobs, don't pull in dependencies 2011-03-29 13:11:13 +02:00
Lennart Poettering
f1dd0c3f9b syslog: rework syslog detection so that we need no compile-time option what the name of the syslog implementation is 2011-03-18 04:53:31 +01:00
Lennart Poettering
2791a8f8dc unit: serialize condition test results 2011-03-17 04:36:19 +01:00
Lennart Poettering
90bbc9469e condition: take a timestamp and store last result of conditions 2011-03-09 23:58:17 +01:00
Lennart Poettering
21256a2b3b unit: don't accidently create ordering links to targets when default deps are off for either target and unit 2011-03-08 03:24:42 +01:00
Harald Hoyer
35b8ca3aaf Spelling Corrections
Just some lame spelling corrections with no functionality.
2011-02-28 22:47:38 +01:00