summaryrefslogtreecommitdiff
path: root/src/core/manager.c
AgeCommit message (Collapse)Author
2012-10-02audit: turn the audit fd into a static variableLennart Poettering
As audit is pretty much just a special kind of logging we should treat it similar, and manage the audit fd in a static variable. This simplifies the audit fd sharing with the SELinux access checking code quite a bit.
2012-09-18core: move ManagerRunningAs to sharedZbigniew Jędrzejewski-Szmek
Note: I did s/MANAGER/SYSTEMD/ everywhere, even though it makes the patch quite verbose. Nevertheless, keeping MANAGER prefix in some places, and SYSTEMD prefix in others would just lead to confusion down the road. Better to rip off the band-aid now.
2012-09-18selinux: use existing library calls for audit dataLennart Poettering
2012-09-17main: newer kernels return EINVAL if we invoke reboot() in a container ↵Lennart Poettering
lacking perms, deal with it
2012-09-13manager: fix the buildLennart Poettering
2012-09-13manager: extend performance measurement interface to include firmware/loader ↵Lennart Poettering
times This only adds the fields to the D-Bus interfaces but doesn't fill them in with anything useful yet. Gummiboot exposes the necessary bits of information to use however and as soon as I get my fingers on a proper UEFI laptop I'll hook up the remaining bits. Since we want to stabilize the D-Bus interface soon and include it in the stability promise we should get the last fixes in, hence this change now.
2012-09-03journal: suppress structured messages if they'd go to the consoleLennart Poettering
2012-09-03journal: generate structured journal messages for a number of eventsLennart Poettering
2012-07-26log.h: new log_oom() -> int -ENOMEM, use itShawn Landden
also a number of minor fixups and bug fixes: spelling, oom errors that didn't print errors, not properly forwarding error codes, few more consistency issues, et cetera
2012-07-25use "Out of memory." consistantly (or with "\n")Shawn Landden
glibc/glib both use "out of memory" consistantly so maybe we should consider that instead of this. Eliminates one string out of a number of binaries. Also fixes extra newline in udev/scsi_id
2012-07-19manager: use a private notify sockets in containers to avoid problems with ↵Lennart Poettering
shared abstract socket namespaces
2012-07-18unit: don't serialize job state, only unit state across switch-rootLennart Poettering
2012-07-13util: rename join() to strjoin()Lennart Poettering
This is to match strappend() and the other string related functions.
2012-07-10unit-name: remove unit_name_is_valid_no_type() and move unit_name_is_valid() ↵Lennart Poettering
to unit-name.h
2012-07-02core: mention if we are run from an initial RAM diskLennart Poettering
2012-07-02manager: turn notify socket into abstract namespace socket againLennart Poettering
sd_notify() should work for daemons that chroot() as part of their initilization, hence it's a good idea to use an abstract namespace socket which is not affected by chroot.
2012-06-29manager: serialize/deserialize job counters across reexec/reloadLennart Poettering
2012-06-26core: make systemd.confirm_spawn=1 actually workLennart Poettering
This adds a timeout if the TTY cannot be acquired and makes sure we always output the question to the console, never to the TTY of the respective service.
2012-05-31mkdir: append _label to all mkdir() calls that explicitly set the selinux ↵Kay Sievers
context
2012-05-23manager: rework generator logicLennart Poettering
Previously generated units were always placed at the end of the search path. With this change there will be three unit dirs instead of one, to place generated entries at the beginning, in the middle and at the end of the search path: beginning: for units that need to override all configuration, regardless of user or vendor. Example use: system-update-generator uses this to temporarily redirect default.target. middle: for units that need to override vendor configuration, but not vendor configuration. Example use: /etc/fstab should override vendor supplied configuration (think /tmp), but should not override native user configuration. end: does not override anything but is available as well. Possible usage might be to convert D-Bus bus service files to native units but allowing vendor supplied native units to win.
2012-05-21main: allow system wide limits for servicesFrederic Crozat
2012-05-21manager: only serialize the timestamps for the initramfs if in_initrd()Harald Hoyer
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-09manager: introduce SwitchRoot bus call for initrd/main transitionLennart Poettering
2012-05-08util: split-out path-util.[ch]Kay Sievers
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-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-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-20transaction: maintain anchor_jobMichal Schmidt
Track which job is the anchor in the transaction.
2012-04-20manager: split transaction.[ch]Michal Schmidt
manager.c takes care of the main loop, unit management, signal handling, ... transaction.c computes transactions. After split: manager.c: 65 KB transaction.c: 40 KB
2012-04-20manager: Transaction as an objectMichal Schmidt
This makes it obvious that transactions are short-lived. They are created in manager_add_job() and destroyed after the application of jobs. It also prepares for a split of the transaction code to a new source.
2012-04-20job: job_uninstall()Michal Schmidt
Split the uninstallation of the job from job_free() into a separate function. Adjust the callers. job_free() now only works on unlinked and uninstalled jobs. This enforces clear thinking about job lifetimes.
2012-04-20manager: simplify transaction_abort()Michal Schmidt
This is equivalent.
2012-04-20job: allow job_free() only on already unlinked jobsMichal Schmidt
job_free() is IMO too helpful when it unlinks the job from the transaction. The callers should ensure the job is already unlinked before freeing. The added assertions check if anyone gets it wrong.
2012-04-20manager: fix commentMichal Schmidt
2012-04-16logind: remove redundant entries from logind's default controller lists tooLennart Poettering
2012-04-16manager: remove unavailable/redundant entries from default controllers listLennart Poettering
2012-04-13watchdog: make watchdog dbus properties writableLennart Poettering
2012-04-13audit: ignore if we get EPERMLennart Poettering
if auditing access is not available, then don't complain about it, in order to play nice with systems lacking CAP_SYS_AUDIT
2012-04-13manager: support systems lacking /dev/tty0Lennart Poettering
2012-04-13fix a couple of things found with the llvm static analyzerLennart Poettering
2012-04-12relicense to LGPLv2.1 (with exceptions)Lennart Poettering
We finally got the OK from all contributors with non-trivial commits to relicense systemd from GPL2+ to LGPL2.1+. Some udev bits continue to be GPL2+ for now, but we are looking into relicensing them too, to allow free copy/paste of all code within systemd. The bits that used to be MIT continue to be MIT. The big benefit of the relicensing is that closed source code may now link against libsystemd-login.so and friends.
2012-04-11move libsystemd_core.la sources into core/Kay Sievers