summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
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-22missing.h: add a cpp warning for __NR_memfd_create on MIPSDaniel Mack
2014-08-22missing.h: add fake __NR_memfd_create for MIPSDaniel Mack
We don't have the correct __NR_memfd_create syscall number yet, so set it to 0xffffffff for now to prevent compile time errors.
2014-08-22shared: add MAXSIZE() and use it in resolvedDavid Herrmann
The MAXSIZE() macro takes two types and returns the size of the larger one. It is much simpler to use than MAX(sizeof(A), sizeof(B)) and also avoids any compiler-extensions, unlike CONST_MAX() and MAX() (which are needed to avoid evaluating arguments more than once). This was suggested by Daniele Nicolodi <daniele@grinta.net>. Also make resolved use this macro instead of CONST_MAX(). This enhances readability quite a bit.
2014-08-22dbus1-generator: properly free the FILE*Lennart Poettering
Also, rework the code to make use of fflush_and_check(). Issue discovered by Simon Danner.
2014-08-21systemctl: in list-unit-files, always show legend, even if we know about no ↵Lennart Poettering
unit files
2014-08-21install: simplify usage of _cleanup_ macrosLennart Poettering
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-21bus: when terminating our bus-actviated services that exit-on-idle send ↵Lennart Poettering
STOPPING=1 via sd_notify() This should fix a race where a service thatis idle drops its name, and is immediately requested by another client, which causes dbus-daemon to ask systemd to activate it again, but since systemd still assumes it is running it won't do anything.
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
2014-08-21manager: reuse sockaddr_union instead of redefining our own version of itLennart Poettering
2014-08-21service,strv: introduce strv_find_startswith() and make use of itLennart Poettering
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.
2014-08-21service: don't invoke functions at the same time as declaring variablesLennart Poettering
2014-08-21service: remove some pointless linebreaks, to make things more readableLennart Poettering
2014-08-21service: asynchronous_close() already checks for negative parameters, no ↵Lennart Poettering
need to duplicate that
2014-08-21core: unify how we generate the prefix string when dumping unit stateLennart Poettering
2014-08-21util: make asynchronous_close() really work like an asynchronous version of ↵Lennart Poettering
safe_close() Save/restore errno, like we do in safe_close(). And don't fork a thread if the parameter is already negative.
2014-08-21util: simplify close_nointr() a bitLennart Poettering
2014-08-21util: change return value of startswith() to non-constLennart Poettering
This way we can use it on non-const strings, and don't end up with a const'ified result. This is similar to libc's strstr() which also takes a const string but returns a non-const one.
2014-08-21journalctl: add "-t --identifier=STRING" optionHarald Hoyer
This turns journalctl to the counterpart of systemd-cat. Messages sent with systemd-cat --identifier foo --prioritiy debug can now be shown with journalctl --identifier foo --prioritiy debug "--identifier" is not merged with "--unit" to make a clear distinction between syslog and systemd units. syslog identifiers can be chosen freely by anyone.
2014-08-20sd-event: add API to access epoll_fdTom Gundersen
This is a prerequisite for integrating sd-event into an external event loop.
2014-08-20resolved: write resolv.conf search - switch argumentsTom Gundersen
Found by Lukáš Nykrýn.
2014-08-20journal-upload: make sure that 'r' is initializedLukas Nykryn
2014-08-20util: return after freeing all members of arrayLukas Nykryn
2014-08-20journal-remote: remove unreachable codeLukas Nykryn
2014-08-20resolved: fix which return codes we checkLennart Poettering
Discovered by Lukas Nykryn
2014-08-20resolved-dns-rr: fix typoLukas Nykryn
a->rrsig.type_covered != a->rrsig.type_covered" is always false regardless of the values of its operands because those operands are identical.
2014-08-20machine-id-setup: don't try to read UUID from VM/container manager if we ↵Lennart Poettering
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.
2014-08-20build: remove repeated KMOD sectionTom Gundersen
2014-08-20systemctl: fail in the case that no unit files were foundLukas Nykryn
Previously systemctl died with message -bash-4.2# systemctl --root /rawhi list-unit-files (src/systemctl/systemctl.c:868) Out of memory. in the case that no unit files were found in the --root or the directory did not exist. So lets return ENOENT in the case that --root does not exist and empty list in the case that there are no unit files.
2014-08-20CONST_MAX breaks gcc on fedora 20 with optimiztationsystemd/v216Lennart Poettering
2014-08-20build: include more optional modules in build stringLennart Poettering
2014-08-20indentation/spurious whitespace fixesLennart Poettering
2014-08-20journal-upload: allow the tool to startLennart Poettering
2014-08-20cmdline: for new tools avoid introduce new negative switches, and properly ↵Lennart Poettering
align --help texts Negative switches are a bad un-normalized thing. We alerady have some, but we should try harder to avoid intrdoucing new ones. Hence, instead of adding two switches: --foobar --no-foobar Let's instead use the syntax --foobar --foobar=yes --foobar=no Where the first two are equivalent. The boolean argument is parsed following the usual rules. Change all new negative switches this way. This patch also properly aligns the --help table, so that single char switches always get a column separate of the long switches.
2014-08-19sysusers: initialize rThomas Hindoe Paaboel Andersen
Needed for the stdin case where it could otherwise end up being used uninitialized.
2014-08-19remove unused variablesThomas Hindoe Paaboel Andersen
2014-08-19memfd: escape the comm field we get from PR_GET_NAME, but assume everything ↵Lennart Poettering
else is proper UTF8
2014-08-19memfd: skip utf-8 escaping if we use a name that was passed inDaniel Mack
If a name was passed in as function argument, trust it, and don't do utf-8 encoding for them. Callers are obliged to check the names themselves, and escape them in case they use anything they got from the outside world.
2014-08-19socket: suffix newly added TCP sockopt time properties with "Sec"Lennart Poettering
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.
2014-08-19memfd: reduce name escaping logic to utf-8 checksDaniel Mack
As memfds are now created by proper kernel API, and not by our functions, we can't rely on names being escaped/unescaped according to our current logic. Thus, the only safe way is to remove the escaping and when reading names, just escape names that are not properly encoded in UTF-8. Also, remove assert(name) lines from the memfd creation functions, as we explictly allow name to be NULL.
2014-08-19memfd: simplify APILennart Poettering
Now, that the memfd stuff is not exported anymore, we can simplify a few things: Use assert() instead of assert_return(), since this is used internally only, and we should be less permissive then. No need to pass an allocated fd back by call-by-reference, we can just directly return it.
2014-08-19Revert "socket: introduce SELinuxLabelViaNet option"Lennart Poettering
This reverts commit cf8bd44339b00330fdbc91041d6731ba8aba9fec. Needs more discussion on the mailing list.
2014-08-19tmpfiles: add new 'r' line type to add UIDs/GIDs to the pool to allocate ↵Lennart Poettering
UIDs/GIDs from This way we can guarantee a limited amount of compatibility with login.defs, by generate an appopriate "r" line out of it, on package installation.
2014-08-19networkd: don't consider deprecated or tentative addresses when determining ↵Tom Gundersen
operstate https://bugs.freedesktop.org/show_bug.cgi?id=81287
2014-08-19socket: introduce SELinuxLabelViaNet 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_label derived from xinetd. Reviewed-by: Paul Moore <pmoore@redhat.com>