summaryrefslogtreecommitdiff
path: root/src/core
Commit message (Collapse)AuthorAge
* hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt2014-09-15
| | | | | | | | | 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.
* core: use correct function to free CalendarSpecDave Reisner2014-09-13
|
* core: fix a potential mem leakThomas Hindoe Paaboel Andersen2014-09-13
| | | | Found with Coverity. Fixes: CID#996438
* core: smack-setup: Actually allow for succesfully loading CIPSO policyPhilippe De Swert2014-09-13
| | | | | | | | 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
* manager: use correct cleanup functionThomas Hindoe Paaboel Andersen2014-09-11
| | | | | | | | Close the dir instead of attempt to free it. Introduced in 874310b7b68c4c0d36ff07397db30a959bb7dae5 Found with coverity. Fixes: CID#996368
* execute: silence warningsThomas Hindoe Paaboel Andersen2014-09-08
| | | | Mark two function parameters as const
* namespace: avoid posible use of uninitialized variableThomas Hindoe Paaboel Andersen2014-09-08
|
* service: hook up custom endpoint logicDaniel Mack2014-09-08
| | | | | | | | | | | | 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.
* namespace: add support for custom kdbus endpointDaniel Mack2014-09-08
| | | | | | | | | | 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.
* bus: parse BusPolicy directive in service filesDaniel Mack2014-09-08
| | | | | | 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.
* bus: add kdbus endpoint typesDaniel Mack2014-09-08
| | | | | Add types to describe endpoints and associated policy entries, and add a BusEndpoint instace to ExecContext.
* bus: factor out bus policy itemsDaniel Mack2014-09-08
| | | | | In order to re-use the policy definitions, factor them out into their own files.
* exec: move code executed after fork into exec_child()Daniel Mack2014-09-05
| | | | | | 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.
* exec: factor out most function arguments of exec_spawn() to ExecParametersDaniel Mack2014-09-05
| | | | | | | | | | 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.
* systemd: fix argument ordering in UnsetAndSetEnvironmentZbigniew Jędrzejewski-Szmek2014-09-03
| | | | Fixup for v208-615-g718db96199.
* Quote unit names in suggested systemctl commandlinesZbigniew Jędrzejewski-Szmek2014-08-31
| | | | | | | | 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
* systemd: fix error messageZbigniew Jędrzejewski-Szmek2014-08-30
|
* Fix a few more typosRuben Kerkhof2014-08-30
|
* use the switch_root function in shutdownHarald Hoyer2014-08-28
| | | | | | removes code duplication also move switch-root to shared
* util: make use of newly added reset_signal_mask() call wherever appropriateLennart Poettering2014-08-26
|
* core: split up "starting" manager state into "initializing" and "starting"Lennart Poettering2014-08-22
| | | | | | | | 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.
* core: introduce "poweroff" as new failure action typesLennart Poettering2014-08-22
| | | | Also, change the default action on a system start-up timeout to powering off.
* core: print 'startup finished' messages even if we log to consoleLennart Poettering2014-08-22
|
* core: add support for a configurable system-wide start-up timeoutLennart Poettering2014-08-22
| | | | | | | | | | | | | | | | | | | 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.
* service: allow services of Type=oneshot that specify no ExecStart= commandsLennart Poettering2014-08-21
| | | | | | 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.
* service: use the right timeout for stop processes we forkLennart Poettering2014-08-21
|
* execute: explain in a comment, why close_all_fds() is invoked the second ↵Lennart Poettering2014-08-21
| | | | time differently
* notify: send STOPPING=1 from our daemonsLennart Poettering2014-08-21
|
* core: allow informing systemd about service status changes with RELOADING=1 ↵Lennart Poettering2014-08-21
| | | | and STOPPING=1 sd_notify() messages
* manager: don#t dispatch sd_notify() messages and SIGCHLD multiple times to ↵Lennart Poettering2014-08-21
| | | | the same units
* manager: reuse sockaddr_union instead of redefining our own version of itLennart Poettering2014-08-21
|
* service,strv: introduce strv_find_startswith() and make use of itLennart Poettering2014-08-21
| | | | | | | Unlike strv_find_prefix() the new call will return a pointer to the suffix of the item we found, instead of the whole item. This is more closer inline with what startswith() does, and allows us to simplify a couple of invocations.
* service: don't invoke functions at the same time as declaring variablesLennart Poettering2014-08-21
|
* service: remove some pointless linebreaks, to make things more readableLennart Poettering2014-08-21
|
* service: asynchronous_close() already checks for negative parameters, no ↵Lennart Poettering2014-08-21
| | | | need to duplicate that
* core: unify how we generate the prefix string when dumping unit stateLennart Poettering2014-08-21
|
* machine-id-setup: don't try to read UUID from VM/container manager if we ↵Lennart Poettering2014-08-20
| | | | | | | operate on a root directory that's not / This should make sure no UUID from the host systemd-machine-id-setup is running on leaks onto a disk image that is provisioned with the tool.
* build: remove repeated KMOD sectionTom Gundersen2014-08-20
|
* build: include more optional modules in build stringLennart Poettering2014-08-20
|
* remove unused variablesThomas Hindoe Paaboel Andersen2014-08-19
|
* socket: suffix newly added TCP sockopt time properties with "Sec"Lennart Poettering2014-08-19
| | | | | | This is what we have done so far for all other time values, and hence we should do this here. This indicates the default unit of time values specified here, if they don't contain a unit.
* Revert "socket: introduce SELinuxLabelViaNet option"Lennart Poettering2014-08-19
| | | | | | This reverts commit cf8bd44339b00330fdbc91041d6731ba8aba9fec. Needs more discussion on the mailing list.
* socket: introduce SELinuxLabelViaNet optionMichal Sekletar2014-08-19
| | | | | | | | | | 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_label derived from xinetd. Reviewed-by: Paul Moore <pmoore@redhat.com>
* sysusers: add a new RPM macro for creating users directly from data passed ↵Lennart Poettering2014-08-19
| | | | | | | | | | | | | | | in via stdin This allows encoding users to create directly in %pre, which is necessary so that files owned by the RPM can be assigned to the right users/groups. This new macro does create a redundancy, as user definitions for all users that shall own files need to to be listed twice, once with this new macro, and then secondly, in the sysusers file shipped with the package. But there's little way around that, as the users of this type need to exist before we install the first file, but we actually want to ship the user information in a file.
* core: minor modernizationsLennart Poettering2014-08-18
|
* units: fix BindsTo= logic when applied relative to services with Type=oneshotLennart Poettering2014-08-18
| | | | | | | Start jobs for Type=oneshot units are successful when the unit state transition activating → inactive took place. In such a case all units that BindsTo= on it previously would continue to run, even though the unit they dependet on was actually already gone.
* core: Verify systemd1 DBus method callers via polkitStef Walter2014-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | DBus methods that retrieve information can be called by anyone. DBus methods that modify state of units are verified via polkit action: org.freedesktop.systemd1.manage-units DBus methods that modify state of unit files are verified via polkit action: org.freedesktop.systemd1.manage-unit-files DBus methods that reload the entire daemon state are verified via polkit action: org.freedesktop.systemd1.reload-daemon DBus methods that modify job state are callable from the clients that started the job. root (ie: CAP_SYS_ADMIN) can continue to perform all calls, property access etc. There are several DBus methods that can only be called by root. Open up the dbus1 policy for the above methods. (Heavily modified by Lennart, making use of the new bus_verify_polkit_async() version that doesn't force us to always pass the original callback around. Also, interactive auhentication must be opt-in, not unconditional, hence I turned this off.)
* Merge commit 'b39a2770ba55637da80e2e389222c59dbea73507'Lennart Poettering2014-08-15
|\
| * core: Rename Job.subscribed field to Job.clientsStef Walter2014-08-15
| | | | | | | | | | | | This reflects how this field will be used, to not only track where to send signals, but also which callers (other than root) are allowed to call DBus methods on the Job.
| * core: Common code for DBus methods that Cancel a jobStef Walter2014-08-15
| | | | | | | | | | Both ofs.Job.Cancel() and ofs.Manager.CancelJob() now use same implementation. So we can add caller verify logic appropriately.