summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2012-05-21units: introduce new Documentation= field and make use of it everywhereLennart Poettering
This should help making the boot process a bit easier to explore and understand for the administrator. The simple idea is that "systemctl status" now shows a link to documentation alongside the other status and decriptionary information of a service. This patch adds the necessary fields to all our shipped units if we have proper documentation for them.
2012-05-21dbus-unit: always load the unit before handling a message for itMichal Schmidt
We need to be able to show the properties even of inactive units. systemctl loads the unit before getting its properties, but this is racy as the garbage collector may kick in right after the loading. Fix it by always loading the unit before handling a message for it. https://bugzilla.redhat.com/show_bug.cgi?id=814966#c6
2012-05-16switch-root: check for absolute pathsLennart Poettering
2012-05-14namespace: make PrivateTmp= apply to both /tmp and /var/tmpLennart Poettering
2012-05-14core: add extra safety check before switching rootLennart Poettering
2012-05-14job: info message if JOB_VERIFY_ACTIVE detects an inactive unitMichal Schmidt
2012-05-14job: report the status of first half of JOB_RESTART the same as JOB_STOPMichal Schmidt
2012-05-14unit: unit type dependent status messagesMichal Schmidt
Instead of generic "Starting..." and "Started" messages for all unit use type-dependent messages. For example, mounts will announce "Mounting..." and "Mounted". Add status messages to units of types that used to be entirely silent (automounts, sockets, targets, devices). For unit types whose jobs are instantaneous, report only the job completion, not the starting event. Socket units with non-instantaneous jobs are rare (Exec*= is not used often in socket units), so I chose not to print the starting messages for them either. This will hopefully give people better understanding of the boot.
2012-05-14unit: print the color status marks on the leftMichal Schmidt
The alignment of the "[ OK ]" and "[FAILED]" status marks to the right side of the terminal makes it difficult to link them with the messages on the left if your console is wide. I considered the options: 1. Align them to the 80th column regardless of the console width. Disadvantage - either: - truncating messages needlessly, not using available space; or - If the message is long, write the mark over it. => ugly 2. Write them to the 80th column for short messages, and further to the right for longer ones. Disadvantage: - jagged look 3. Write the marks on the left, before the message. Disadvantage: - Breaks tradition from RHL. Advantages: + slightly simpler code + Will annoy holy-traditionalists. I chose option 3. BTW, Debian now uses similar marks on the left with its makefile-style boot. Special values of the "status" argument to status_vprintf are: NULL - no status mark, no message indentation "" - no status mark, message indented as if the mark was there
2012-05-14job: change red [ABORT] status to yellow [DEPEND]Michal Schmidt
The red "[ABORT]" for a dependency failure is too scary. It suggests a crash. And it suggests a problem with the unit itself. Change it to a yellow "[DEPEND]" message. The color communicates the level of seriousness better.
2012-05-14job: only jobs on the runqueue can be runMichal Schmidt
2012-05-09dbus-manager: fix tainted stringMichal Schmidt
The pointer to the end of the string was not advanced after adding the "cgroups-missing" taint. If "local-hwclock" was detected too, it would overwrite the previous string. With 'e' always pointing to the end of the string, removing the last delimiter is easier.
2012-05-09main: fix uninitialized variableMichal Schmidt
2012-05-09main: fix assertion failure due to use of ELEMENTSOF on a non-arrayMichal Schmidt
2012-05-09manager: introduce SwitchRoot bus call for initrd/main transitionLennart Poettering
2012-05-08main: simplify+unify logic for parsing runtime booleansLennart Poettering
2012-05-08sleep: implement suspend/hibernate as first class targetsLennart Poettering
2012-05-08util: split-out path-util.[ch]Kay Sievers
2012-05-08util: split-out hwclock.[ch]Kay Sievers
2012-05-03dbus: include unit name in JobNew/JobRemoved signalsLennart Poettering
This breaks D-Bus interface slightly, but since the D-Bus API isn't covered by the interface stability promise this should be OK.
2012-05-03service: explicitly remove control/ subcgroup after each control commandLennart Poettering
The kernel will only notify us of cgroups running empty if no subcgroups exist anymore. Hence make sure we don't leave our own control/ subcgroup around longer than necessary. https://bugzilla.redhat.com/show_bug.cgi?id=818381
2012-05-03hwclock: add taint flag for non-local hwclockLennart Poettering
2012-05-03service: default to Type=dbus if BusName= is specifiedLennart Poettering
2012-05-03service: warn if a dbus name is specified but the service type is not dbusLennart Poettering
2012-04-30unit: add new dependency type RequiresMountsFor=Lennart Poettering
RequiresMountsFor= is a shortcut for adding requires and after dependencies to all mount units neeed for the specified paths. This solves a couple of issues regarding dep loop cycles for encrypted swap.
2012-04-25core: add NOP jobs, job type collapsingMichal Schmidt
Two of our current job types are special: JOB_TRY_RESTART, JOB_RELOAD_OR_START. They differ from other job types by being sensitive to the unit active state. They perform some action when the unit is active and some other action otherwise. This raises a question: when exactly should the unit state be checked to make the decision? Currently the unit state is checked when the job becomes runnable. It's more sensible to check the state immediately when the job is added by the user. When the user types "systemctl try-restart foo.service", he really intends to restart the service if it's running right now. If it isn't running right now, the restart is pointless. Consider the example (from Bugzilla[1]): sleep.service takes some time to start. hello.service has After=sleep.service. Both services get started. Two jobs will appear: hello.service/start waiting sleep.service/start running Then someone runs "systemctl try-restart hello.service". Currently the try-restart operation will block and wait for sleep.service/start to complete. The correct result is to complete the try-restart operation immediately with success, because hello.service is not running. The two original jobs must not be disturbed by this. To fix this we introduce two new concepts: - a new job type: JOB_NOP A JOB_NOP job does not do anything to the unit. It does not pull in any dependencies. It is always immediately runnable. When installed to a unit, it sits in a special slot (u->nop_job) where it never conflicts with the installed job (u->job) of a different type. It never merges with jobs of other types, but it can merge into an already installed JOB_NOP job. - "collapsing" of job types When a job of one of the two special types is added, the state of the unit is checked immediately and the job type changes: JOB_TRY_RESTART -> JOB_RESTART or JOB_NOP JOB_RELOAD_OR_START -> JOB_RELOAD or JOB_START Should a job type JOB_RELOAD_OR_START appear later during job merging, it collapses immediately afterwards. Collapsing actually makes some things simpler, because there are now fewer job types that are allowed in the transaction. [1] Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=753586
2012-04-24shutdown: don't complain if we cannot lock memory, to make container ↵Lennart Poettering
shutdowns clean
2012-04-24remount: consolidate remount-api-vfs and remount-rootfs into oneLennart Poettering
This has the advantage of removing a confusing warning by mount if the root directory is not listed in fstab.
2012-04-24service: introduce Type=idle and use it for gettysLennart Poettering
Type=idle is much like Type=simple, however between the fork() and the exec() in the child we wait until PID 1 informs us that no jobs are left. This is mostly a cosmetic fix to make gettys appear only after all boot output is finished and complete. Note that this does not impact the normal job logic as we do not delay the completion of any jobs. We just delay the invocation of the actual binary, and only for services that otherwise would be of Type=simple.
2012-04-24manager: drop MountAuto= and SwapAuto= optionsLennart Poettering
The ability to set MountAuto=no and SwapAuto=no was useful during the adoption phase of systemd, so that distributions could stick to their classic mount scripts a bit longer. It is about time to get rid of it now.
2012-04-23transaction: cancel jobs non-recursively on isolateMichal Schmidt
Recursive cancellation of jobs would trigger OnFailure actions of dependent jobs. This is not desirable when isolating. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=798328
2012-04-24job: serialize jobs properlyMichal Schmidt
Jobs were not preserved correctly over a daemon-reload operation. A systemctl process waiting for a job completion received a job removal signal. The job itself changed its id. The job timeout started ticking all over again. This fixes the deficiencies.
2012-04-24transaction: abort does not need to use recursive deletionMichal Schmidt
Recursion is unnecessary, because we're deleting all transaction jobs anyway. And the recursive deletion produces debug messages that are pointless in transaction abort.
2012-04-24transaction: fix detection of cycles involving installed jobsMichal Schmidt
A transaction can be acyclic, but when it's added to installed jobs, a cycle may result. transaction_verify_order_one() attempts to detect these cases, but it fails because the installed jobs often have the exact generation number that makes them look as if they were walked already. Fix it by resetting the generation numbers of all installed jobs before detecting cycles. An alternative fix could be to add the generation counter to the Manager and use it instead of starting always from 1 in transaction_activate(). But I prefer not having to worry about it wrapping around.
2012-04-24transaction: improve readabilityMichal Schmidt
The functions looked complicated with the nested loops with breaks, continues, and "while (again)". Here using goto actually makes them easier to understand. Also correcting the comment about redundant jobs.
2012-04-22shutdown: don't try to shut down DM devices in a containerLennart Poettering
2012-04-22hostname: if there's already a hostname set when PID 1 is invoked, don't ↵Lennart Poettering
complain
2012-04-22job: the status messages are proper sentences, hence end them with a full stopLennart Poettering
2012-04-22mount: don't fail if fstab doesn't existLennart Poettering
2012-04-22transaction: downgrade warnings about masked unitsLennart Poettering
2012-04-22transaction: add missing emacs and license headersLennart Poettering
2012-04-22machine-id: fix spellingLennart Poettering
2012-04-22util: unify getenv() logic for other PIDLennart Poettering
2012-04-22util: fix tty_is_vc_resolve() in a container where ↵Lennart Poettering
/sys/class/tty/console/active is misleading
2012-04-22mount-setup: ignore common container bind mountsLennart Poettering
2012-04-21watchdog: fix default configuration fragment for watchdogLennart Poettering
2012-04-20transaction: add starting requirements for JOB_RESTARTMichal Schmidt
While having a Requires= dependency between units, the dependency is started automatically on "systemctl start", but it's not started on "systemctl restart". JOB_RESTART jobs did not pull the dependencies for starting into the transaction. https://bugzilla.redhat.com/show_bug.cgi?id=802770 Note that the other bug noted in comment #2 has been fixed already by avoiding the deletion of anchor jobs.
2012-04-20dbus-job: allow multiple bus clientsMichal Schmidt
Merging of jobs can result in more than one client being interested in a job.
2012-04-20transaction: remove checks for installedMichal Schmidt
Transactions cannot contain installed jobs anymore. Remove the now pointless checks.
2012-04-20transaction: rework merging with installed jobsMichal Schmidt
Previously transactions could reference installed jobs. It made some issues difficult to fix. This sets new rules for jobs: A job cannot be both a member of a transaction and installed. When jobs are created, they are linked to a transaction. The whole transaction is constructed (with merging of jobs within, etc.). When it's complete, all the jobs are unlinked from it one by one and let to install themselves. It is during the installation when merging with previously installed jobs (from older transactions) is contemplated. Merging with installed jobs has different rules than merging within a transaction: - An installed conflicting job gets cancelled. It cannot be simply deleted, because someone might be waiting for its completion on DBus. - An installed, but still waiting, job can be safely merged into. - An installed and running job can be tricky. For some job types it is safe to just merge. For the other types we merge anyway, but put the job back into JOB_WAITING to allow it to run again. This may be suboptimal, but it is not currently possible to have more than one installed job for a unit. Note this also fixes a bug where the anchor job could be deleted during merging within the transaction.