Lennart Poettering [Tue, 5 May 2015 20:48:57 +0000 (13:48 -0700)]
update TODO
Lennart Poettering [Tue, 5 May 2015 20:48:28 +0000 (13:48 -0700)]
man: document that nspawn -x, --template= and machinectl clone leave hostname and machine id unmodified
Lennart Poettering [Tue, 5 May 2015 20:41:31 +0000 (13:41 -0700)]
man: nspawn is used in production these days, admit that
Previously, the man page suggested to only use nspawn for testing,
building, and debugging things. However, it is nowadays used in
production and used as building block for rocket, hence let's just admit
that it's pretty much production ready.
Lennart Poettering [Tue, 5 May 2015 20:39:14 +0000 (13:39 -0700)]
core: be more strict when manipulating slices names and unescaping paths from unit names
Let's better be safe then sorry.
Lennart Poettering [Sat, 2 May 2015 15:42:55 +0000 (17:42 +0200)]
core: bus name units should not allow aliases or instances
Lennart Poettering [Thu, 30 Apr 2015 18:21:00 +0000 (20:21 +0200)]
core: rework unit name validation and manipulation logic
A variety of changes:
- Make sure all our calls distuingish OOM from other errors if OOM is
not the only error possible.
- Be much stricter when parsing escaped paths, do not accept trailing or
leading escaped slashes.
- Change unit validation to take a bit mask for allowing plain names,
instance names or template names or an combination thereof.
- Refuse manipulating invalid unit name
Lennart Poettering [Thu, 30 Apr 2015 17:44:10 +0000 (19:44 +0200)]
util: be a bit safer in path_is_safe()
We should be more strict when verifying paths with path_is_safe() for
potentially dangerous constructs, and that includes lengths of
PATH_MAX-1 and larger. Be more accurate here.
Lennart Poettering [Thu, 30 Apr 2015 17:42:48 +0000 (19:42 +0200)]
cgroup-util: be more strict when processing slice unit names
Kay Sievers [Tue, 5 May 2015 20:05:46 +0000 (22:05 +0200)]
build-sys: remove left-over
Stephen Gallagher [Wed, 29 Apr 2015 12:19:05 +0000 (08:19 -0400)]
Add VARIANT as a standard value for /etc/os-release
Some distributions (such as Fedora) are using the VARIANT field to
indicate to select packages which of several default configurations
they should be using. For example, VARIANT=Server provides a
different default firewall configuration (blocking basically
everything but SSH and the management console) whereas
VARIANT=Workstation opens many other ports for application
compatibility.
By adding this patch to the manual pages, we can standardize on a
cross-distribution mechanism for accomplishing this.
Fedora implementation details are available at
https://fedoraproject.org/wiki/Packaging:Per-Product_Configuration
(David: drop double paranthesis)
Zbigniew Jędrzejewski-Szmek [Sat, 2 May 2015 17:01:29 +0000 (12:01 -0500)]
generators: rename add_{root,usr}_mount to add_{sysroot,sysroot_usr}_mount
This makes it obvious that those functions are only usable in the
initramfs.
Also, add a warning when noauto, nofail, or automount is used for the
root fs, instead of silently ignoring. Using those options would be a
sign of significant misconfiguration, and if we bother to check for
them, than let's go all the way and complain.
Other various small cleanups and reformattings elsewhere.
Patrik Flykt [Fri, 10 Apr 2015 11:03:18 +0000 (14:03 +0300)]
network: Implement fallback DHCPv6 prefix handling for older kernels
When setting IPv6 addresses acquired by DHCPv6, systemd-networkd sets
the IFA_F_NOPREFIXROUTE flag in the IFA_FLAGS netlink attribute. As
the flag and the attribute are present starting with Linux 3.14, older
kernels will need systemd-network to manage prefix route expiry.
By default, DHCPv6 addresses are first assigned setting the
IFA_F_NOPREFIXROUTE flag in the IFA_FLAGS netlink attribute. Should
the address assignment fail, the same assignment is tried without
the IFA_FLAGS attribute. Should also the second attempt fail, an error
is printed and address assignment ends with failure. As successful use
of the IFA_FLAGS netlink attribute is recorded in the Link structure,
the DHCPv6 code will know if the kernel or systemd-network fallback
code handles expiring prefixes.
The prefix expiration and IPv6 address updating fallback code is
resurrected from the parts deleted with commit
47d45d3cde45d6545367570264e4e3636bc9e345.
This patch can be removed once the minimum kernel requirements are
greater than or equal to 3.14.
Zbigniew Jędrzejewski-Szmek [Sat, 2 May 2015 17:01:28 +0000 (12:01 -0500)]
fstab-generator: fix memleak
filtered was used to store an allocated string twice. The first allocation was
thus lost. The string is not needed for anything, so simply skip the allocation.
Fixup for
deb0a77cf0b409141c4.
Zbigniew Jędrzejewski-Szmek [Sat, 2 May 2015 17:01:28 +0000 (12:01 -0500)]
man: use utf-8 in systemd-remount-fs.service(8)
Thomas Hindoe Paaboel Andersen [Thu, 30 Apr 2015 18:10:31 +0000 (20:10 +0200)]
terminal: update for simpler sd-bus api's
Lennart Poettering [Thu, 30 Apr 2015 10:35:15 +0000 (12:35 +0200)]
update TODO
Lennart Poettering [Thu, 30 Apr 2015 10:33:54 +0000 (12:33 +0200)]
core: simplify %r and %R logic a bit
Do not calculate the cgroup path manually, just use normal unit fields
and calls for that.
Lennart Poettering [Thu, 30 Apr 2015 10:33:35 +0000 (12:33 +0200)]
core: catch some special cases in cg_slice_to_path()
Lennart Poettering [Thu, 30 Apr 2015 10:01:19 +0000 (12:01 +0200)]
sym: adding missing symbols to .sym file
Lennart Poettering [Thu, 30 Apr 2015 09:58:06 +0000 (11:58 +0200)]
sd-bus,sd-login: add api for querying the slice within the the user systemd instance of a process
units are organized in slice trees, not only for the system instance,
but also for user systemd instances, expose this properly.
Lennart Poettering [Wed, 29 Apr 2015 23:54:18 +0000 (01:54 +0200)]
update TODO
Lennart Poettering [Wed, 29 Apr 2015 23:52:39 +0000 (01:52 +0200)]
man: update sd_bus_open() documentation
Update for current function prototypes.
Also, document -ESOCKTNOSUPPORT as being returned when protocol version
mismatches are detected.
Lennart Poettering [Wed, 29 Apr 2015 23:29:00 +0000 (01:29 +0200)]
core: simplify unit type detection logic
Introduce a new call unit_type_supported() and make use of it
everywhere.
Also, drop Manager parameter from per-type supported method prototype.
Lennart Poettering [Wed, 29 Apr 2015 23:24:48 +0000 (01:24 +0200)]
sd-bus: when we get ENOTTY on the HELLO ioctl assume incompatible API version
As perparation for future incompatible kdbus kernel API changes.
Lennart Poettering [Wed, 29 Apr 2015 22:49:31 +0000 (00:49 +0200)]
update TODO
Lennart Poettering [Wed, 29 Apr 2015 22:47:41 +0000 (00:47 +0200)]
core: rework cgroup path parse logic
Various cleanups, be stricter when parsing unit paths.
Most importantly: return the root slice "-.slice" when asked for slice
of paths that contain no slice component.
Susant Sahani [Wed, 22 Apr 2015 08:44:56 +0000 (14:14 +0530)]
networkd: add man for vti6 tunnel
Susant Sahani [Wed, 22 Apr 2015 08:44:55 +0000 (14:14 +0530)]
networkd: introduce vti6 tunnel
This patch add support to create vti6 tunnel
test:
vt6.network
[Match]
Name=wlan0
[Network]
Tunnel=ip6vti
vti6.netdev
[NetDev]
Name=ip6vti
Kind=vti6
[Tunnel]
Local=2a00:ffde:4567:edde::4987
Remote=2001:473:fece:cafe::5179
ip link
11: ip6_vti0@NONE: <NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT
group default
link/tunnel6 :: brd ::
12: ip6vti@wlan0: <POINTOPOINT,NOARP> mtu 1500 qdisc noop state DOWN
mode DEFAULT group default
link/tunnel6 2a00:ffde:4567:edde::4987 peer 2001:473:fece:cafe::5179
Susant Sahani [Wed, 22 Apr 2015 08:44:54 +0000 (14:14 +0530)]
networkd: tunnel improve logging
Replaces a lof ot strerror() usage with log_netdev_error_errno()
Lennart Poettering [Wed, 29 Apr 2015 19:45:45 +0000 (21:45 +0200)]
man: document when the various sd-login.h calls return ENXIO
Lennart Poettering [Wed, 29 Apr 2015 19:44:55 +0000 (21:44 +0200)]
man: document when the sd_bus_creds_xxx() calls return ENXIO
Lennart Poettering [Wed, 29 Apr 2015 19:40:54 +0000 (21:40 +0200)]
sd-bus: properly handle creds that are known but undefined for a process
A number of fields do not apply to all processes, including: there a
processes without a controlling tty, without parent process, without
service, user services or session. To distuingish these cases from the
case where we simply don't have the data, always return ENXIO for them,
while returning ENODATA for the case where we really lack the
information.
Also update the credentials dumping code to show this properly. Fields
that are known but do not apply are now shown as "n/a".
Note that this also changes some of the calls in process-util.c and
cgroup-util.c to return ENXIO for these cases.
Mantas Mikulėnas [Wed, 29 Apr 2015 18:29:18 +0000 (21:29 +0300)]
core: fix event source annotations
These looked like a mass-replace gone slightly wrong – two statements
with no { }'s, and no error checking.
Lennart Poettering [Wed, 29 Apr 2015 17:10:09 +0000 (19:10 +0200)]
tree-wide: get rid of a few more explicit bus parameters
Lennart Poettering [Wed, 29 Apr 2015 17:02:08 +0000 (19:02 +0200)]
core: for queued reload message there is no need to store the bus explicitly
After all it can be derived from the message directly, and already is.
Lennart Poettering [Wed, 29 Apr 2015 16:58:30 +0000 (18:58 +0200)]
sd-bus: allow passing NULL as bus parameter to sd_bus_send()
If NULL is specified for the bus it is now automatically derived from
the passed in message.
This commit also changes a number of invocations of sd_bus_send() to
make use of this.
Lennart Poettering [Wed, 29 Apr 2015 16:36:17 +0000 (18:36 +0200)]
update TODO
Lennart Poettering [Wed, 29 Apr 2015 16:35:10 +0000 (18:35 +0200)]
sd-bus: drop bus parameter from message callback prototype
This should simplify the prototype a bit. The bus parameter is redundant
in most cases, and in the few where it matters it can be derived from
the message via sd_bus_message_get_bus().
Lennart Poettering [Wed, 29 Apr 2015 10:04:16 +0000 (12:04 +0200)]
man: avoid line break in url
Lennart Poettering [Wed, 29 Apr 2015 10:03:57 +0000 (12:03 +0200)]
TODO: split out issues to fix before 220
Tom Gundersen [Wed, 29 Apr 2015 15:08:18 +0000 (17:08 +0200)]
test: rename test-bus-kernel-benchmark to test-bus-benchmark
This can now benchmark more than just kdbus.
Tom Gundersen [Wed, 29 Apr 2015 14:05:32 +0000 (16:05 +0200)]
core: annotate event sources
Tom Gundersen [Tue, 28 Apr 2015 19:39:13 +0000 (21:39 +0200)]
sd-bus: benchmark - also support testing non-kdbus transports
We introduce two news types of benchmarks in chart-mode:
- 'legacy' connects using the session bus
- 'direct' connects using a peer-to-peer socket
We should probably also introduce a mode for testing the dbus1-kdbus proxy.
Tom Gundersen [Mon, 27 Apr 2015 13:01:06 +0000 (15:01 +0200)]
libudev: monitor - fix typo in log message
David Herrmann [Wed, 29 Apr 2015 10:57:32 +0000 (12:57 +0200)]
TODO: drop journal blocker
This got fixed via a cleanup by Zbigniew, see:
http://lists.freedesktop.org/archives/systemd-devel/2015-April/031348.html
Lennart Poettering [Tue, 28 Apr 2015 19:33:02 +0000 (21:33 +0200)]
update TODO
Lennart Poettering [Tue, 28 Apr 2015 19:32:42 +0000 (21:32 +0200)]
machined: make PropertiesChanged match more strict
Lennart Poettering [Tue, 28 Apr 2015 19:17:35 +0000 (21:17 +0200)]
machined: make sure to track machine unit states properly
If a unit is stopped for a moment, we need to invalidate our knowledge
of it, otherwise we might be confused by automatic restarts
This makes reboots for nspawn containers run as service work correctly.
https://bugs.freedesktop.org/show_bug.cgi?id=87428
Lennart Poettering [Tue, 28 Apr 2015 18:48:54 +0000 (20:48 +0200)]
bus-util: drop redundant bus argument from bus_message_map_all_properties() and related calls
Lennart Poettering [Tue, 28 Apr 2015 18:46:33 +0000 (20:46 +0200)]
nspawn: when run as a service, don't ask machined for terminatin of ourselves
Lennart Poettering [Tue, 28 Apr 2015 18:46:03 +0000 (20:46 +0200)]
nspawn: make sure we install the device policy if nspawn is run as unit as on the command line
Lennart Poettering [Tue, 28 Apr 2015 18:45:25 +0000 (20:45 +0200)]
service: make restart logic a bit easier to understand
Lennart Poettering [Tue, 28 Apr 2015 16:24:20 +0000 (18:24 +0200)]
exit-status: introduce common exit_status_set_test() call for testing exit status set membership
Thomas Hindoe Paaboel Andersen [Tue, 28 Apr 2015 17:02:49 +0000 (19:02 +0200)]
scope: use correct enum type
Lennart Poettering [Tue, 28 Apr 2015 15:34:35 +0000 (17:34 +0200)]
update TODO
Lennart Poettering [Tue, 28 Apr 2015 15:13:23 +0000 (17:13 +0200)]
fsck: remove fsckd again, but keep the door open for external replacement
For a longer discussion see this:
http://lists.freedesktop.org/archives/systemd-devel/2015-April/030175.html
This introduces /run/systemd/fsck.progress as a simply
AF_UNIX/SOCK_STREAM socket. If it exists and is connectable we'll
connect fsck's -c switch with it. If external programs want to get
progress data they should hence listen on this socket and will get
all they need via that socket. To get information about the connecting
fsck client they should use SO_PEERCRED.
Unless /run/systemd/fsck.progress is around and connectable this change
reverts back to v219 behaviour where we'd forward fsck output to
/dev/console on our own.
Lennart Poettering [Tue, 28 Apr 2015 14:49:43 +0000 (16:49 +0200)]
fsck: minor improvements
Among other smaller fixes, explicitly check if we are invoked on a block
device before making use of st.st_rdev.
Lennart Poettering [Tue, 28 Apr 2015 14:46:06 +0000 (16:46 +0200)]
fsck: parse kernel cmdline booleans the same ways as the rest
Alberto Fanjul Alonso [Tue, 28 Apr 2015 13:44:23 +0000 (15:44 +0200)]
sysv-generator test: Fix assertion
Martin Pitt [Tue, 28 Apr 2015 13:42:18 +0000 (15:42 +0200)]
unit: Drop unused variables
src/core/unit.c: In function 'unit_coldplug':
src/core/unit.c:2884:18: warning: unused variable 'i' [-Wunused-variable]
Iterator i;
^
src/core/unit.c:2883:15: warning: unused variable 'other' [-Wunused-variable]
Unit *other;
^
Zbigniew Jędrzejewski-Szmek [Fri, 17 Apr 2015 01:41:18 +0000 (21:41 -0400)]
units: specify timeouts for more oneshot services
Even trivial service occasionally get stuck, for example when
there's a problem with the journal. There's nothing more annoying
that looking at the cylon eye for a job with an infinite timeout.
Use standard 90s for jobs that do some work, and 30s for those which
should be almost instantenous.
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2015 12:45:02 +0000 (08:45 -0400)]
hwdb: coalesce same pointingstick entries into one
Multiple models in the same hardware series are likely to have similar
specs. We should use organization similar to hwdb/60-evdev.
Hans de Goede [Tue, 28 Apr 2015 09:07:42 +0000 (11:07 +0200)]
udev: hwdb: Add trackpoint sensitivity settings for Lenovo X240 and 540p
Like the T440s these need the sensitity to be set significantly higher
then the default of 128 for the trackpoint to be usable. Like with the
T440s 200 seems to be a good value to get a reasonable but not too high
sensitivity.
Lennart Poettering [Tue, 28 Apr 2015 10:33:19 +0000 (12:33 +0200)]
run: by default, wait until the transient unit finished start-up
Make this blocking behaviour optional with --no-block, similar to
systemctl's switch of this name.
Lennart Poettering [Tue, 28 Apr 2015 10:21:31 +0000 (12:21 +0200)]
run: synchronously wait until the scope unit we create is started
Otherwise it might happen that by the time PID 1 adds our process to the
scope unit the process might already have died, if the process is
short-running (such as an invocation to /bin/true).
https://bugs.freedesktop.org/show_bug.cgi?id=86520
Lennart Poettering [Tue, 28 Apr 2015 10:20:29 +0000 (12:20 +0200)]
core: when we cannot add PID to a scope cgroup, log about it
Also, place the scope unit in failed state.
Lennart Poettering [Tue, 28 Apr 2015 10:12:29 +0000 (12:12 +0200)]
bus-util: print correct warnings for units that fail but for which we have a NULL result only
Lennart Poettering [Tue, 28 Apr 2015 09:44:24 +0000 (11:44 +0200)]
man: clarify that only the first .network file with a matching [Match] matters
http://lists.freedesktop.org/archives/systemd-devel/2015-April/031294.html
Ivan Shapovalov [Mon, 27 Apr 2015 18:19:02 +0000 (21:19 +0300)]
core: coldplug all units which participate in jobs during coldplugging
This is yet another attempt to fix coldplugging order (more especially,
the problem which happens when one creates a job during coldplugging and
it references a not-yet-coldplugged unit).
Now we forcibly coldplug all units which participate in jobs. This
is a superset of previously implemented handling of the UNIT_TRIGGERS
dependencies, so that handling is removed.
http://lists.freedesktop.org/archives/systemd-devel/2015-April/031212.html
https://bugs.freedesktop.org/show_bug.cgi?id=88401 (once again)
Lennart Poettering [Mon, 27 Apr 2015 15:25:57 +0000 (17:25 +0200)]
update-done: ignore nanosecond file timestamp components, they are not reliable
https://bugs.freedesktop.org/show_bug.cgi?id=90192
Lennart Poettering [Mon, 27 Apr 2015 15:22:55 +0000 (17:22 +0200)]
update-done: minor simplification
Lennart Poettering [Mon, 27 Apr 2015 15:22:30 +0000 (17:22 +0200)]
update TODO
Lennart Poettering [Mon, 27 Apr 2015 13:40:30 +0000 (15:40 +0200)]
man: document that nspawn's --bind= switch may be used multiple times
Thomas Hindoe Paaboel Andersen [Sun, 26 Apr 2015 13:57:29 +0000 (15:57 +0200)]
path-util: fix fstat fallback in fd_is_mount_point
Thomas Hindoe Paaboel Andersen [Sun, 26 Apr 2015 12:43:40 +0000 (14:43 +0200)]
sysv-generator: avoid freeing uninitialized variable
Would happen if lookup_paths_init returns an error.
Tom Gundersen [Sat, 25 Apr 2015 23:09:34 +0000 (01:09 +0200)]
libudev: monitor - clarify log messages
Tom Gundersen [Sat, 25 Apr 2015 23:07:42 +0000 (01:07 +0200)]
sd-device: don't retry loading uevent/db files more than once
If for whatever reason there was nothing to load or loading failed, don't keep trying.
Tom Gundersen [Sat, 25 Apr 2015 23:04:33 +0000 (01:04 +0200)]
sd-device: don't complain if the uevent file is missing
Only 'real' devices are required to have an uevent file.
Daniel Mack [Fri, 24 Apr 2015 19:51:43 +0000 (21:51 +0200)]
bootchart: kill newline characters from log_error_errno() calls
Daniel Mack [Fri, 24 Apr 2015 19:50:36 +0000 (21:50 +0200)]
systemctl: kill newline characters from log_error_errno() calls
log_error_errno() already adds a newline, so drop them.
Daniel Mack [Fri, 24 Apr 2015 19:44:51 +0000 (21:44 +0200)]
logind: kill newline characters from log_error_errno() calls
log_error_errno() already adds a newline, so drop them.
Tom Gundersen [Fri, 24 Apr 2015 18:36:02 +0000 (20:36 +0200)]
udevd: worker - log if worker result cannot be sent
If the main daemon is not notified about a worker finishing an event
the refcounting of the worker struct will be wrong, and we will lose
track of the number of children we have to wait for.
This should not happen, but if it does we better complain loudly about
it. Worst case udev will wait for 30 seconsd at shutdown waiting for
nonexistent workers.
Tom Gundersen [Fri, 24 Apr 2015 17:29:53 +0000 (19:29 +0200)]
udevd: worker - warn if unknown worker returns
Tom Gundersen [Tue, 21 Apr 2015 16:55:05 +0000 (18:55 +0200)]
udevd: worker - let the kernel attach the sender pid
No need to include this explicitly, just use SCM_CREDENTIALS.
Lennart Poettering [Fri, 24 Apr 2015 17:56:24 +0000 (19:56 +0200)]
sysctl: minor simplifications
Lennart Poettering [Fri, 24 Apr 2015 17:55:16 +0000 (19:55 +0200)]
sysctl: don't propagate ENOENT sysctl options
We shouldn't fail the sysctl service if an option is missing.
Previously the warning about this was already downgraded to LOG_DEBUG,
but we really shouldn't propagate such errors either.
Lennart Poettering [Fri, 24 Apr 2015 17:54:29 +0000 (19:54 +0200)]
core: minor simplification
Lennart Poettering [Fri, 24 Apr 2015 17:54:14 +0000 (19:54 +0200)]
Update TODO
Lennart Poettering [Fri, 24 Apr 2015 17:53:38 +0000 (19:53 +0200)]
man: extend documentation on IPForward= and IPMasquerade=
Mention the default values, and clarify how this relates to the
underlying sysctls.
Tom Gundersen [Fri, 24 Apr 2015 16:35:58 +0000 (18:35 +0200)]
udevd: don't unref worker objects on SIGSTOP/SIGCONT
We should not be receiving these anyway, but let's be correct.
Tom Gundersen [Fri, 24 Apr 2015 16:04:57 +0000 (18:04 +0200)]
udevd: warn if we receive SIGCHLD from untracked worker
Tom Gundersen [Fri, 24 Apr 2015 15:50:49 +0000 (17:50 +0200)]
udevd: improve logging in SIGCHLD handling
Remove some redundant logging, and reduce the log-level in most cases. The only
case that is really critical is if a worker failed while hanlding an event, so
keep that at error level.
Daniel Mack [Fri, 20 Feb 2015 14:16:02 +0000 (15:16 +0100)]
sd-bus: teach bus_print_property() how to print SD_BUS_TYPE_INT64
Daniel Mack [Thu, 23 Apr 2015 15:30:23 +0000 (17:30 +0200)]
shutdownd: kill the old implementation
Not that all functionality has been ported over to logind, the old
implementation can be removed. There goes one of the oldest parts of
the systemd code base.
Daniel Mack [Thu, 23 Apr 2015 14:03:02 +0000 (16:03 +0200)]
systemctl: talk to logind for scheduled shutdowns
Drop the code which communicates with shutdownd via its private socket,
and use the functionality in logind instead.
The code pathes which talk to logind have to create their own ad-hoc
bus connection because by default, systemctl connects to systemd's
private socket.
Daniel Mack [Thu, 23 Apr 2015 15:11:28 +0000 (17:11 +0200)]
logind: add support for /run/nologin and /run/systemd/shutdown/scheduled
Port over more code from shutdownd and teach logind to write /run/nologin at
least 5 minutes before the system is going down, and
/run/systemd/shutdown/scheduled when a shutdown is scheduled.
Daniel Mack [Wed, 22 Apr 2015 15:20:42 +0000 (17:20 +0200)]
logind: add code for UTMP wall messages
Add a timer to print UTMP wall messages so that it repeatedly informs users
about a scheduled shutdown:
* every 1 minute with less than 10 minutes to go
* every 15 minutes with less than 60 minutes to go
* every 30 minutes with less than 180 minutes (3 hours) to go
* every 60 minutes if more than that to go
This functionality only active if the .EnableWallMessages DBus property
is set to true. Also, a custom string can be added to the wall message,
set through the WallMessagePrefix property.
Daniel Mack [Fri, 24 Apr 2015 13:31:29 +0000 (15:31 +0200)]
shared/utmp-wtmp: add parameter for origin tty and callback userdata
Instead of looking up the tty from STDIN, let utmp_wall() take an argument
to specify an origin tty for the wall message. Only if that argument is
NULL do the STDIN lookup.
Also add an void *userdata argument that is handed back to the callback
function.
Daniel Mack [Mon, 20 Apr 2015 13:27:15 +0000 (15:27 +0200)]
logind: add .ScheduleShutdown and .CancelScheduledShutdown methods
Add a method called ScheduleShutdown in org.freedesktop.login1.Manager
which adds a timer to shut down the system at a later point in time.
The first argument holds the type of the schedule that is about to
happen, and must be one of 'reboot', 'halt' or 'poweroff'.
The second argument specifies the absolute time, based on
CLOCK_REALTIME in nanoseconds, at which the the operation should be
executed.
To cancel a previously scheduled shutdown, the CancelScheduledShutdown()
can be called, which returns a bool, indicating whether a scheduled
timeout was cancelled.
Also add a new property called ScheduledShutdown which returns the
equivalent to what was passed in via ScheduleShutdown, as '(st)' type.
Daniel Mack [Mon, 20 Apr 2015 13:19:26 +0000 (15:19 +0200)]
logind: factor out polkit checks
Factor out the code to ask polkit for authorization from
method_do_shutdown_or_sleep() into an own function called
verify_shutdown_creds().
This is needed in order to also use the same checks when shutdown
operations are scheduled. For that, it's also necessary to allow
NULL values for that action{,_multiple_sessions,_ignore_inhibit)
arguments, which will suppress the call if no action string is
passed.