summaryrefslogtreecommitdiff
path: root/src/timedate
Commit message (Collapse)AuthorAge
...
* event: rework sd-event exit logicLennart Poettering2013-12-13
| | | | | | | | | | | | | With this change a failing event source handler will not cause the entire event loop to fail. Instead, we just disable the specific event source, log a message at debug level and go on. This also introduces a new concept of "exit code" which can be stored in the event loop and is returned by sd_event_loop(). We also rename "quit" to "exit" everywhere else. Altogether this should make things more robus and keep errors local while still providing a way to return event loop errors in a clear way.
* bus: remove explicit activator-specific flags, the kdbus supports it nowKay Sievers2013-12-12
|
* timedatectl: work with old timedatedShawn Landden2013-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Which does have TimeUSec. Should we specifically check for this method instead of assuming time=0 means it doesn't exist? Before: shawn@debian-T61:~/git/systemd$ ./timedatectl Local time: Wed 1969-12-31 16:00:00 PST Universal time: Thu 1970-01-01 00:00:00 UTC RTC time: n/a Timezone: America/Los_Angeles (PST, -0800) NTP enabled: n/a NTP synchronized: no RTC in local TZ: no DST active: no Last DST change: DST ended at Sun 1969-10-26 01:59:59 PDT Sun 1969-10-26 01:00:00 PST Next DST change: DST begins (the clock jumps one hour forward) at Sun 1970-04-26 01:59:59 PST Sun 1970-04-26 03:00:00 PDT After: shawn@debian-T61:~/git/systemd$ ./timedatectl Local time: Wed 2013-12-11 14:03:21 PST Universal time: Wed 2013-12-11 22:03:21 UTC RTC time: n/a Timezone: America/Los_Angeles (PST, -0800) NTP enabled: n/a NTP synchronized: no RTC in local TZ: no DST active: no Last DST change: DST ended at Sun 2013-11-03 01:59:59 PDT Sun 2013-11-03 01:00:00 PST Next DST change: DST begins (the clock jumps one hour forward) at Sun 2014-03-09 01:59:59 PST Sun 2014-03-09 03:00:00 PDT
* bus: add SD_BUS_NAME_REPLACE_EXISTING to all activatable services, fix one ↵Kay Sievers2013-12-12
| | | | flags conversion
* bus: instead of exposing the dbus1 flags when acquiring a name use our own ↵Lennart Poettering2013-12-12
| | | | | | | that are closer to kdbus This turns around DO_NOT_QUEUE into QUEUE which implies a more useful default. (And negative options are awful anyway.)
* timedated: make sure GetAll() succeeds in systems lacking /dev/rtc (such as ↵Lennart Poettering2013-12-12
| | | | containers)
* event: hook up sd-event with the service watchdog logicLennart Poettering2013-12-11
| | | | | | | | | | | | | Adds a new call sd_event_set_watchdog() that can be used to hook up the event loop with the watchdog supervision logic of systemd. If enabled and $WATCHDOG_USEC is set the event loop will ping the invoking systemd daemon right after coming back from epoll_wait() but not more often than $WATCHDOG_USEC/4. The epoll_wait() will sleep no longer than $WATCHDOG_USEC/4*3, to make sure the service manager is called in time. This means that setting WatchdogSec= in a .service file and calling sd_event_set_watchdog() in your daemon is enough to hook it up with the watchdog logic.
* bus: introduce "trusted" bus concept and encode access control in object vtablesLennart Poettering2013-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduces a new concept of "trusted" vs. "untrusted" busses. For the latter libsystemd-bus will automatically do per-method access control, for the former all access is automatically granted. Per-method access control is encoded in the vtables: by default all methods are only accessible to privileged clients. If the SD_BUS_VTABLE_UNPRIVILEGED flag is set for a method it is accessible to unprivileged clients too. By default whether a client is privileged is determined via checking for its CAP_SYS_ADMIN capability, but this can be altered via the SD_BUS_VTABLE_CAPABILITY() macro that can be ORed into the flags field of the method. Writable properties are also subject to SD_BUS_VTABLE_UNPRIVILEGED and SD_BUS_VTABLE_CAPABILITY() for controlling write access to them. Note however that read access is unrestricted, as PropertiesChanged messages might send out the values anyway as an unrestricted broadcast. By default the system bus is set to "untrusted" and the user bus is "trusted" since per-method access control on the latter is unnecessary. On dbus1 busses we check the UID of the caller rather than the configured capability since the capability cannot be determined without race. On kdbus the capability is checked if possible from the attached meta-data of a message and otherwise queried from the sending peer. This also decorates the vtables of the various daemons we ship with these flags.
* Help output spring cleaningZbigniew Jędrzejewski-Szmek2013-12-08
| | | | | Use [brackets] only for optional elements. Use <optional> in XML sources.
* bus: make sd_bus_request_name() and sd_bus_release_name() behave more like ↵Lennart Poettering2013-12-03
| | | | | | | | | | | | other calls Instead of returning an enum of return codes, make them return error codes like kdbus does internally. Also, document this behaviour so that clients can stick to it. (Also rework bus-control.c to always have to functions for dbus1 vs. kernel implementation of the various calls.)
* bus: rework message handlers to always take an error argumentLennart Poettering2013-11-21
| | | | | | | | | | | | | | | | | | | | Message handler callbacks can be simplified drastically if the dispatcher automatically replies to method calls if errors are returned. Thus: add an sd_bus_error argument to all message handlers. When we dispatch a message handler and it returns negative or a set sd_bus_error we send this as message error back to the client. This means errors returned by handlers by default are given back to clients instead of rippling all the way up to the event loop, which is desirable to make things robust. As a side-effect we can now easily turn the SELinux checks into normal function calls, since the method call dispatcher will generate the right error replies automatically now. Also, make sure we always pass the error structure to all property and method handlers as last argument to follow the usual style of passing variables for return values as last argument.
* bus: let's simplify things by getting rid of unnecessary bus parametersLennart Poettering2013-11-21
|
* remove unused variablesThomas Hindoe Paaboel Andersen2013-11-18
|
* bus: introduce concept of a default bus for each thread and make use of it ↵Lennart Poettering2013-11-12
| | | | | | | | everywhere We want to emphasize bus connections as per-thread communication primitives, hence introduce a concept of a per-thread default bus, and make use of it everywhere.
* bus: introduce concept of a "default" event loop per-thread and make use of ↵Lennart Poettering2013-11-12
| | | | | | | | | it everywhere Try to emphasize a bit that there should be a mapping between event loops and threads, hence introduce a logic that there's one "default" event loop for each thread, that can be queried via "sd_event_default()".
* clients: try to follow roughly the same order in --help texts for common optionsLennart Poettering2013-11-07
|
* polkit: don't spawn local client if we access a remote systemLennart Poettering2013-11-07
|
* consistently use "int" when retrieving "bool" from bus messagesKay Sievers2013-11-07
|
* clients: unify how we invoke getopt_long()Lennart Poettering2013-11-06
| | | | | Among other things this makes sure we always expose a --version command and show it in the help texts.
* clients: various simplificationsLennart Poettering2013-11-06
|
* bus: update bus_map_all_properties()Kay Sievers2013-11-05
|
* bus: use internal helper to read org.freedesktop.DBus.Properties::GetAll ↵Kay Sievers2013-11-02
| | | | variables
* timedatectl: remove unused variableThomas Hindoe Paaboel Andersen2013-10-31
|
* Revert "timedated: support --enable-split-usr"Lennart Poettering2013-10-31
| | | | | | | | This reverts commit 36f9f99556b2fd90705a9eda2e8f182b1e63a15e. The ntp unit information is only needed by timedated which runs in late boot only, where all disks are around. Hence there's no point in allowing them to be located in the rootprefix.
* localectl: always print error message when an operation failsLennart Poettering2013-10-31
|
* timedatectl: do not print the time zone for the rtc timeKay Sievers2013-10-31
|
* timedatectl: assorted simplificationsLennart Poettering2013-10-31
|
* timedatectl: get time values from the service instead of the clientKay Sievers2013-10-31
| | | | This allow querying the RTC time from the unprivileged timedatectl.
* timedatectl: port to sd-busThomas Hindoe Paaboel Andersen2013-10-30
|
* timedated: support --enable-split-usrDave Reisner2013-10-30
|
* timedate: handle more nicely if something or somebody keeps open /dev/rtc ↵Lennart Poettering2013-10-29
| | | | | | | | | | and thus blocks out everybody else chrony is appears to keep the RTC open continuously these days which is a bad idea, and /dev/rtc is a single-user device, which is a bad idea too. Together both bad ideas mean that nobody else can access the RTC anymore. That's something to fix, but in the meantime we should handle this more gracefully.
* bus: avoid 'bool' storage when retrieving 'b' from the messageKay Sievers2013-10-22
| | | | | | Just use an unsigned int as a bool type to avoid issues in the public message reading API; sizeof(bool) == 1, but the code copies 4 bytes at the pointers destination.
* bus: automatically flush bus queue when we exit the event loopLennart Poettering2013-10-18
| | | | This way, we do not have to call it manually
* timedated: disable debug loggingLennart Poettering2013-10-18
|
* timedated: expose time and NTP sync flag via the busLennart Poettering2013-10-17
| | | | | This way, timedatectl can be run over the network and determine all properties correctly from the server rather than the client.
* timedate: expose RTC timeLennart Poettering2013-10-16
| | | | | Since access to the RTC is privileged expose the current RTC time as bus property so that unprivileged clients can read it.
* timedated: use libsystemd-bus instead of libdbus for bus communicationLennart Poettering2013-10-16
| | | | | | | | | | | | | | | Among other things this also adds a few things necessary for the change: - Considerably more powerful error returning APIs in libsystemd-bus - Adapter for connecting an sd_bus to an sd_event - As I reworked the PolicyKit logic to the new library I also made it asynchronous, so that PolicyKit requests of one user cannot block out another user anymore. - We always use the macro names for common bus error. That way it is harder to mistype them since the compiler will notice
* man: improve grammar and word formatting in numerous man pagesJason St. John2013-07-02
| | | | | | | | | | Use proper grammar, word usage, adjective hyphenation, commas, capitalization, spelling, etc. To improve readability, some run-on sentences or sentence fragments were revised. [zj: remove the space from 'file name', 'host name', and 'time zone'.]
* Allow for the use of @ in remote host callsDaniel Wallace2013-06-09
| | | | | Without this you have to use %40 with the -H flag because dbus doesn't like the @ sign being unescaped.
* Fix --no-ask-passwordJan Janssen2013-05-23
| | | | | | POSIX_ME_HARDER mode is disabled for localectl. It doesn't make much sense in case of localectl, and there's little reason for localectl to behave specially.
* man: Document missing optionsJan Janssen2013-05-21
|
* move _cleanup_ attribute in front of the typeHarald Hoyer2013-04-18
| | | | http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
* timedated: fixed NTP enabled: n/aHarald Hoyer2013-04-17
|
* Use initalization instead of explicit zeroingZbigniew Jędrzejewski-Szmek2013-04-05
| | | | | | | | | | | | | | | | | | | | | | | Before, we would initialize many fields twice: first by filling the structure with zeros, and then a second time with the real values. We can let the compiler do the job for us, avoiding one copy. A downside of this patch is that text gets slightly bigger. This is because all zero() calls are effectively inlined: $ size build/.libs/systemd text data bss dec hex filename before 897737 107300 2560 1007597 f5fed build/.libs/systemd after 897873 107300 2560 1007733 f6075 build/.libs/systemd … actually less than 1‰. A few asserts that the parameter is not null had to be removed. I don't think this changes much, because first, it is quite unlikely for the assert to fail, and second, an immediate SEGV is almost as good as an assert.
* timedated: fix a few memory leaksZbigniew Jędrzejewski-Szmek2013-04-04
| | | | Contents of /etc/adjtime and more.
* util: rename write_one_line_file() to write_string_file()Lennart Poettering2013-04-03
| | | | | You can write much more than just one line with this call (and we frequently do), so let's correct the naming.
* Remove some dead codeZbigniew Jędrzejewski-Szmek2013-03-31
| | | | Based on coverity report.
* timedated: extra overflow safety check when doing relative time changesLennart Poettering2013-03-22
| | | | | | | | | Ensure clients don't overflow usec_t when doing relative time changes. This is mostly just paranoia and protection against accidents, after all clients are already authenticated, and they can se the time to any value they wish anyway, but better be safe than sorry. https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1152187/comments/14
* timedatectl: show CanNTP fieldLennart Poettering2013-03-22
|
* Use bus_maybe_send_reply() where applicableColin Walters2013-03-18
| | | | | | | | | This is a followup to: commit 1a37b9b9043ef83e9900e460a9a1fccced3acf89 It will fix denial messages from dbus-daemon between gdm and systemd-logind on logging into GNOME due to this. See the previous commit for more details.