summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2014-11-28core: only override kdbus attach mask when running as PID 1Lennart Poettering
2014-11-28log: fix order of log_unit_struct() to match other logging callsLennart Poettering
Also, while we are at it, introduce some syntactic sugar for creating ERRNO= and MESSAGE= structured logging fields.
2014-11-27kmod-setup: simplify kernel command line parsingLennart Poettering
2014-11-27kdbus: set kernel attach mask before creating the first busLennart Poettering
2014-11-27selinux: log selinux log messages with LOG_AUTH facilityLennart Poettering
2014-11-27log: rearrange log function namingLennart Poettering
- Rename log_meta() → log_internal(), to follow naming scheme of most other log functions that are usually invoked through macros, but never directly. - Rename log_info_object() to log_object_info(), simply because the object should be before any other parameters, to follow OO-style programming style.
2014-11-27log: add an "error" parameter to all low-level logging calls and intrdouce ↵Lennart Poettering
log_error_errno() as log calls that take error numbers This change has two benefits: - The format string %m will now resolve to the specified error (or to errno if the specified error is 0. This allows getting rid of a ton of strerror() invocations, a function that is not thread-safe. - The specified error can be passed to the journal in the ERRNO= field. Now of course, we just need somebody to convert all cases of this: log_error("Something happened: %s", strerror(-r)); into thus: log_error_errno(-r, "Something happened: %m");
2014-11-27core: fix transaction destructiveness check once moreMichal Schmidt
The previous fix e0312f4db "core: fix check for transaction destructiveness" broke test-engine (noticed by Zbyszek). Apparently I had a wrong idea of the intended semantics of --fail. The manpage says the operation should fail if it "conflicts with a pending job (more specifically: causes an already pending start job to be reversed into a stop job or vice versa)". So let's check job_type_is_conflicting, instead of !is_superset. This makes both test-engine and TEST-03-JOBS pass again.
2014-11-26swap: restore support for nofailZbigniew Jędrzejewski-Szmek
systemd stops adding automatic dependencies on swap.target to swap units. If a dependency is required, it has to be added by unit configuration. fstab-generator did that already, except that now it is modified to create a Requires or Wants type dependency, depending on whether nofail is specified in /etc/fstab. This makes .swap units obey the nofail/noauto options more or less the same as .mount units. Documentation is extended to clarify that, and to make systemd.mount(5) and system.swap(5) more similar. The gist is not changed, because current behaviour actually matches existing documentation. https://bugs.freedesktop.org/show_bug.cgi?id=86488
2014-11-26manager: print fatal errors on the console tooZbigniew Jędrzejewski-Szmek
When booting in quiet mode, fatal messages would not be shown at all to the user. https://bugzilla.redhat.com/show_bug.cgi?id=1155468
2014-11-26manager: log some fatal errors at emergency levelZbigniew Jędrzejewski-Szmek
This adds a new log_emergency() function, which is equivalent to log_error() for non-PID-1, and logs at the highest priority for PID 1. Some messages which occur before freezing are converted to use it.
2014-11-26core: make sure we have enough information when doing selinux decisionsLennart Poettering
Let's ask for the security relevant bits in a race-free way, and augment the rest from /proc.
2014-11-26sd-bus: update peeking into receieved messages, with recent kernel change we ↵Lennart Poettering
need to FREE them after all
2014-11-26core: fix check for transaction destructivenessMichal Schmidt
When checking if the transaction is destructive, we need to check if the previously installed job is a superset of the new job (and hence the new job will fold into the installed one without changing it), not the other way around.
2014-11-26core: drop now-redundant special-casing of JOB_NOPMichal Schmidt
job_type_is_conflicting(X, JOB_NOP) correctly gives: false. job_type_allows_late_merge(JOB_NOP) && job_type_is_superset(X, JOB_NOP) correctly gives: true.
2014-11-26core: fix assertion failure in checking a transaction with a JOB_NOPMichal Schmidt
Several functions called from transaction_activate() need to correctly handle the case where a JOB_NOP job is being checked against a unit's pending job. The assumption that JOB_NOP never merges with other job types was correct, but since the job_type_is_*() functions are implemented using the merge lookup, they need to special-case JOB_NOP to avoid hitting assertion failures.
2014-11-26core: reindent mount/kmod tablesLennart Poettering
2014-11-25core: show log message about process triggering kdbus service activationLennart Poettering
2014-11-24smack: introduce new SmackProcessLabel optionWaLyong Cho
In service file, if the file has some of special SMACK label in ExecStart= and systemd has no permission for the special SMACK label then permission error will occurred. To resolve this, systemd should be able to set its SMACK label to something accessible of ExecStart=. So introduce new SmackProcessLabel. If label is specified with SmackProcessLabel= then the child systemd will set its label to that. To successfully execute the ExecStart=, accessible label should be specified with SmackProcessLabel=. Additionally, by SMACK policy, if the file in ExecStart= has no SMACK64EXEC then the executed process will have given label by SmackProcessLabel=. But if the file has SMACK64EXEC then the SMACK64EXEC label will be overridden. [zj: reword man page]
2014-11-23manager: only issue overmount warning when the check succeededZbigniew Jędrzejewski-Szmek
If for any reason the check failed (selinux?), we would still issue the warning. Check the return status.
2014-11-23manager: let manager_free() handle NULLsZbigniew Jędrzejewski-Szmek
This makes the calling code a bit simpler.
2014-11-23dbus: return non-zero return value in the case that prefix won't matchLukas Nykryn
strv_extend returns 0 in the case of success which means that else if (bus_track_deserialize_item(&m->deserialized_subscribed, l) == 0) log_warning("Unknown serialization item '%s'", l); will be printed when value is added correctly.
2014-11-21selinux-access: fix broken ternary operatorLukas Nykryn
it seems to be a typo introduced by ebcf1f97de4f6b1580ae55eb56b1a3939fe6b602 - _r = selinux_access_check(_b, _m, _u->source_path ?:_u->fragment_path, (permission), &_error); \ + ({ Unit *_unit = (unit); selinux_generic_access_check(bus,message, _unit->fragment_path ?: _unit->fragment_path, permission,error); })
2014-11-21build: avoid trailing whitespace in feature stringLennart Poettering
2014-11-20core: watchdog bus properties cannot be both writable and constantLennart Poettering
2014-11-17namespace: unchecked return value from librarySusant Sahani
fix: CID 1237553 (#1 of 6): Unchecked return value from library (CHECKED_RETURN CID 1237553 (#3 of 6): Unchecked return value from library (CHECKED_RETURN) CID 1237553 (#4 of 6): Unchecked return value from library (CHECKED_RETURN) CID 1237553 (#5 of 6): Unchecked return value from library (CHECKED_RETURN CID 1237553 (#6 of 6): Unchecked return value from library (CHECKED_RETURN)
2014-11-14kmod-setup: improve for "kdbus" word on the kernel cmdlineLennart Poettering
We really shouldn't check for words with "strstr()"...
2014-11-14kmod: move #ifdef checks for kmod-setup out of main.c into kmod-setup.cLennart Poettering
2014-11-14mount-setup: remove mount_setup_late()Daniel Mack
Turns out we can just do kmod_setup() earlier, before we do mount_setup(), so there's no need for mount_setup_late() anymore. Instead, put kdbusfs in mount_table[].
2014-11-13sd-bus: sync with kdbus upstream (ABI break)Daniel Mack
kdbus has seen a larger update than expected lately, most notably with kdbusfs, a file system to expose the kdbus control files: * Each time a file system of this type is mounted, a new kdbus domain is created. * The layout inside each mount point is the same as before, except that domains are not hierarchically nested anymore. * Domains are therefore also unnamed now. * Unmounting a kdbusfs will automatically also detroy the associated domain. * Hence, the action of creating a kdbus domain is now as privileged as mounting a filesystem. * This way, we can get around creating dev nodes for everything, which is last but not least something that is not limited by 20-bit minor numbers. The kdbus specific bits in nspawn have all been dropped now, as nspawn can rely on the container OS to set up its own kdbus domain, simply by mounting a new instance. A new set of mounts has been added to mount things *after* the kernel modules have been loaded. For now, only kdbus is in this set, which is invoked with mount_setup_late().
2014-11-13manager: allow test run to catch SIGCHLD eventsRonny Chevalier
Otherwise we cannot know when a service exited
2014-11-08core: remove unused macro GC_QUEUE_USEC_MAXRonny Chevalier
It is unused since cf1265e188e876dda906dca0029248a06dc80c33
2014-11-07core: unify how we create the notify and private dbus socketLennart Poettering
Use the same robust logic of mkdir + unlink of any existing AF_UNIX socket, ignoring the return value, right before bind().
2014-11-07manager: cast mkdir() result to (void) to make sure coverity is quietLennart Poettering
Also simplify the code a bit by moving mkdir to the common path.
2014-11-07timer: reenable TIMER_ACTIVE timers when restartedMichael Chapman
A timer configured with OnActiveSec will start its associated unit again if the timer is stopped, then started. However, if the timer unit is restarted -- with "systemctl restart", say -- this does not occur. This commit ensures that TIMER_ACTIVE timers are re-enabled whenever the timer is started, even if that's within a restart job.
2014-11-07util: simplify proc_cmdline() to reuse get_process_cmdline()Lennart Poettering
Also, make all parsing of the kernel cmdline non-fatal.
2014-11-06shutdown: fix arguments to /run/initramfs/shutdownMichal Schmidt
Our initrd interface specifies that the verb is in argv[1]. This is where systemd passes it to systemd-shutdown, but getopt permutes argv[]. This confuses dracut's shutdown script: Shutdown called with argument '--log-level'. Rebooting! getopt can be convinced to not permute argv[] by having '-' as the first character of optstring. Let's use it. This requires changing the way non-option arguments (in our case, the verb) are processed. This fixes a bug where the system would reboot instead of powering off.
2014-11-06s/commandline/command line/gHarald Hoyer
2014-11-06shared: rename condition-util.[ch] to condition.[ch]Lennart Poettering
Now that we only have one file with condition implementations around, we can drop the -util suffix and simplify things a bit.
2014-11-06core: get rid of condition.c and move the remaining call into util.cLennart Poettering
That way only one file with condition code remaining, in src/shared/, rather than src/core/. Next step: dropping the "-util" suffix from condition-util.[ch].
2014-11-06core: introduce the concept of AssertXYZ= similar to ConditionXYZ=, but ↵Lennart Poettering
fatal for a start job if not met
2014-11-06condition: record test state internally and beef it up to be a full enumLennart Poettering
2014-11-06condition: unify condition logic in one fileLennart Poettering
2014-11-06condition: properly allow passing back errors from condition checksLennart Poettering
2014-11-05core: introduce new Delegate=yes/no property controlling creation of cgroup ↵Lennart Poettering
subhierarchies For priviliged units this resource control property ensures that the processes have all controllers systemd manages enabled. For unpriviliged services (those with User= set) this ensures that access rights to the service cgroup is granted to the user in question, to create further subgroups. Note that this only applies to the name=systemd hierarchy though, as access to other controllers is not safe for unpriviliged processes. Delegate=yes should be set for container scopes where a systemd instance inside the container shall manage the hierarchies below its own cgroup and have access to all controllers. Delegate=yes should also be set for user@.service, so that systemd --user can run, controlling its own cgroup tree. This commit changes machined, systemd-nspawn@.service and user@.service to set this boolean, in order to ensure that container management will just work, and the user systemd instance can run fine.
2014-11-05manager: Ensure user's systemd runtime directory exists.Colin Guthrie
This mirrors code in dbus.c when creating the private socket and avoids error messages like: systemd[1353]: bind(/run/user/603/systemd/notify) failed: No such file or directory systemd[1353]: Failed to fully start up daemon: No such file or directory
2014-11-04audit: improve the audit messages we generateLennart Poettering
always pass along comm, as documented by audit. Always set the correct comm value.
2014-11-03core: introduce ConditionSecurity=auditLennart Poettering
And conditionalize journald audit support with it
2014-11-02manager: do not print timing when running in test modeZbigniew Jędrzejewski-Szmek
2014-11-02Raise level of 'Found dependency...' linesZbigniew Jędrzejewski-Szmek
This way they always show up together with 'Found ordering cycle...'. Ordering cycles are a serious error and a major pain to debug. If quiet is enabled, only the first and the last line of output are shown: systemd[1]: Found ordering cycle on basic.target/start systemd[1]: Breaking ordering cycle by deleting job timers.target/start systemd[1]: Job timers.target/start deleted to break ordering cycle starting with basic.target/start which isn't particularly enlightening. So just show the whole message at the same level. https://bugzilla.redhat.com/show_bug.cgi?id=1158206