summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2014-10-03core/namespace: remove invalid checkZbigniew Jędrzejewski-Szmek
dir cannot be NULL here, because it was allocated with alloca. CID #1237768.
2014-10-03core/namespace: remove invalid checkZbigniew Jędrzejewski-Szmek
root cannot be NULL here, because it was allocated with alloca. CID #1237769.
2014-10-02Revert "mount: order options before other arguments to mount"Lennart Poettering
This reverts commit 141a1ceaa62578f1ed14f04cae2113dd0f49fd7f. People should fix their libc's getopt(), instead of us using a weird option ordering...
2014-10-02Rename user_runtime to user_runtime_dirZbigniew Jędrzejewski-Szmek
This makes this function name similar to user_config_home() and makes it match the name of the environment variable.
2014-10-02add a transient user unit directorySteven Allen
This patch adds a transient user unit directory under `$XDG_RUNTIME_DIR/systemd/user/` and stores transient user-instance units (such as those created by `systemd-run --user`) under there instead of putting them in $XDG_CONFIG_HOME/systemd/user/. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=67331
2014-10-02core/swap: only make configured units part of swap.targetZbigniew Jędrzejewski-Szmek
We used to make all .swap units either RequiredBy=swap.target or WantedBy=swap.target. But swap.target should be the "configured swap units", either through /etc/fstab or non-generated .swap units. It is surprising when systemd starts treating a swap device that was possibly temporarily enabled as a hard dependency for other units. So do not add dependencies with swap.target for units gleaned from /proc/swaps. Similarly, we added dependencies for all aliases of the device name, which clutters up the dependency graph but does not seem to bring any value, since the status of those following units is consistent with the main one anyway. This should be a fix for [1], and it seems the right thing to do anyway. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1114786
2014-10-01core: limit timestamp to sane precisionZbigniew Jędrzejewski-Szmek
Anything below .1 s is meaningless anyway.
2014-09-30core: execute - don't leak strvTom Gundersen
2014-09-29Do not format USEC_INFINITY as NULLZbigniew Jędrzejewski-Szmek
systemctl would print 'CPUQuotaPerSecUSec=(null)' for no limit. This does not look right. Since USEC_INFINITY is one of the valid values, format_timespan() could return NULL, and we should wrap every use of it in strna() or similar. But most callers didn't do that, and it seems more robust to return a string ("infinity") that makes sense most of the time, even if in some places the result will not be grammatically correct.
2014-09-29core/dbus: simplify handling of CPUQuotaPerSecUSecZbigniew Jędrzejewski-Szmek
No functional change intended.
2014-09-29core/swap: advertise Discard over dbusZbigniew Jędrzejewski-Szmek
2014-09-29core/swap: follow the configured unit by defaultZbigniew Jędrzejewski-Szmek
Phenomenon: parameters configured in /etc/fstab for swap units are ignored. E.g. pri= settings have no effect when systemd starts swap units. What is even more confusing, .swap units for the name used in /etc/fstab initially show proper values for Priority=, but after starting them, they are re-initalized from /proc/swaps and show the -1 value from /proc/swaps. Change swap units to follow the original configured unit. This way proper settings are used when starting the swap.
2014-09-29fstab-generator: properly deal with discard as non-last optionZbigniew Jędrzejewski-Szmek
Previous code would only return correct results when discard was the last option. While at it, avoid incorrect behaviour for (invalid) 'pri' option not followed by '=...', and also do not return -1 as the error code.
2014-09-29swap: introduce Discard propertyJan Synacek
Process possible "discard" values from /etc/fstab.
2014-09-26make utmp/wtmp support configurableEmil Renner Berthing
This adds --disable-utmp option to configure. If it is used, all utmp-related functionality, including querying runlevel support, is removed.
2014-09-25localectl: print warning when there are options given on kernel cmdlineMichal Sekletar
2014-09-19socket: introduce SELinuxContextFromNet optionMichal Sekletar
This makes possible to spawn service instances triggered by socket with MLS/MCS SELinux labels which are created based on information provided by connected peer. Implementation of label_get_child_mls_label derived from xinetd. Reviewed-by: Paul Moore <pmoore@redhat.com>
2014-09-18core: Remove uninitialized warnings from bus-endpoint.cPhilippe De Swert
Gcc is spewing some warnings about uninitialized variables. Let's get rid of the noise.
2014-09-18mount: order options before other arguments to mountEmil Renner Berthing
2014-09-16core: fix resource leak in manager_environment_addAndreas Henriksson
Second error path must free the (potentially) allocated memory in the first code chunk before returning. Found by coverity. Fixes: CID#1237750
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-09-13core: use correct function to free CalendarSpecDave Reisner
2014-09-13core: fix a potential mem leakThomas Hindoe Paaboel Andersen
Found with Coverity. Fixes: CID#996438
2014-09-13core: smack-setup: Actually allow for succesfully loading CIPSO policyPhilippe De Swert
The line under the last switch statement *loaded_policy = true; would never be executed. As all switch cases return 0. Thus the policy would never be marked as loaded. Found with Coverity. Fixes: CID#1237785
2014-09-11manager: use correct cleanup functionThomas Hindoe Paaboel Andersen
Close the dir instead of attempt to free it. Introduced in 874310b7b68c4c0d36ff07397db30a959bb7dae5 Found with coverity. Fixes: CID#996368
2014-09-08execute: silence warningsThomas Hindoe Paaboel Andersen
Mark two function parameters as const
2014-09-08namespace: avoid posible use of uninitialized variableThomas Hindoe Paaboel Andersen
2014-09-08service: hook up custom endpoint logicDaniel Mack
If BusPolicy= was passed, the parser function will have created an ExecContext->bus_endpoint object, along with policy information. In that case, create a kdbus endpoint, and pass its path name to the namespace logic, to it will be mounted over the actual 'bus' node. At endpoint creation time, no policy is updloaded. That is done after fork(), through a separate call. This is necessary because we don't know the real uid of the process earlier than that.
2014-09-08namespace: add support for custom kdbus endpointDaniel Mack
If a path to a previously created custom kdbus endpoint is passed in, bind-mount a new devtmpfs that contains a 'bus' node, which in turn in bind-mounted with the custom endpoint. This tmpfs then mounted over the kdbus subtree that refers to the current bus. This way, we can fake the bus node in order to lock down services with a kdbus custom endpoint policy.
2014-09-08bus: parse BusPolicy directive in service filesDaniel Mack
Add a new directive called BusPolicy to define custom endpoint policies. If one such directive is given, an endpoint object in the service's ExecContext is created and the given policy is added to it.
2014-09-08bus: add kdbus endpoint typesDaniel Mack
Add types to describe endpoints and associated policy entries, and add a BusEndpoint instace to ExecContext.
2014-09-08bus: factor out bus policy itemsDaniel Mack
In order to re-use the policy definitions, factor them out into their own files.
2014-09-05exec: move code executed after fork into exec_child()Daniel Mack
This factors out one conditional branch that has grown way too big, and makes the code more readable by using return statements rather than jump labels.
2014-09-05exec: factor out most function arguments of exec_spawn() to ExecParametersDaniel Mack
This way, the list of arguments to that function gets more comprehensive, and we can get around passing lots of NULL and 0 arguments from socket.c, swap.c and mount.c. It also allows for splitting up the code in exec_spawn(). While at it, make ExecContext const in execute.c.
2014-09-03systemd: fix argument ordering in UnsetAndSetEnvironmentZbigniew Jędrzejewski-Szmek
Fixup for v208-615-g718db96199.
2014-08-31Quote unit names in suggested systemctl commandlinesZbigniew Jędrzejewski-Szmek
The fact that unit names have to be quoted can be a bit surprising. Show quotes in the hint commandline, but only after checking that this is necessary, since quotes are visually heavy and usually not needed. https://bugs.freedesktop.org/show_bug.cgi?id=82832
2014-08-30systemd: fix error messageZbigniew Jędrzejewski-Szmek
2014-08-30Fix a few more typosRuben Kerkhof
2014-08-28use the switch_root function in shutdownHarald Hoyer
removes code duplication also move switch-root to shared
2014-08-26util: make use of newly added reset_signal_mask() call wherever appropriateLennart Poettering
2014-08-22core: split up "starting" manager state into "initializing" and "starting"Lennart Poettering
We'll stay in "initializing" until basic.target has reached, at which point we will enter "starting". This is preparation so that we can change the startip timeout to only apply to the first phase of startup, not the full procedure.
2014-08-22core: introduce "poweroff" as new failure action typesLennart Poettering
Also, change the default action on a system start-up timeout to powering off.
2014-08-22core: print 'startup finished' messages even if we log to consoleLennart Poettering
2014-08-22core: add support for a configurable system-wide start-up timeoutLennart Poettering
When this system-wide start-up timeout is hit we execute one of the failure actions already implemented for services that fail. This should not only be useful on embedded devices, but also on laptops which have the power-button reachable when the lid is closed. This devices, when in a backpack might get powered on by accident due to the easily reachable power button. We want to make sure that the system turns itself off if it starts up due this after a while. When the system manages to fully start-up logind will suspend the machine by default if the lid is closed. However, in some cases we don't even get as far as logind, and the boot hangs much earlier, for example because we ask for a LUKS password that nobody ever enters. Yeah, this is a real-life problem on my Yoga 13, which has one of those easily accessible power buttons, even if the device is closed.
2014-08-21service: allow services of Type=oneshot that specify no ExecStart= commandsLennart Poettering
This is useful for services that simply want to run something on shutdown, but not at bootup. They should only set ExecStop= but leave ExecStart= unset.
2014-08-21service: use the right timeout for stop processes we forkLennart Poettering
2014-08-21execute: explain in a comment, why close_all_fds() is invoked the second ↵Lennart Poettering
time differently
2014-08-21notify: send STOPPING=1 from our daemonsLennart Poettering
2014-08-21core: allow informing systemd about service status changes with RELOADING=1 ↵Lennart Poettering
and STOPPING=1 sd_notify() messages
2014-08-21manager: don#t dispatch sd_notify() messages and SIGCHLD multiple times to ↵Lennart Poettering
the same units