b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
266f3e269d173f104aa2a5e3ceac9b6979ea5039 |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
bus-util: rename bus_open_transport() to bus_connect_transport()
In sd-bus, the sd_bus_open_xyz() family of calls allocates a new bus,
while sd_bus_default_xyz() family tries to reuse the thread's default
bus. bus_open_transport() sometimes internally uses the former,
sometimes the latter family, but suggests it only calls the former via
its name. Hence, let's avoid this confusion, and generically rename the
call to bus_connect_transport().
Similar for all related calls.
And while we are at it, also change cgls + cgtop to do direct systemd
connections where possible, since all they do is talk to systemd itself. |
3f6fd1ba65f962702753c4ad284b588e59689a23 |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
util: introduce common version() implementation and use it everywhere
This also allows us to drop build.h from a ton of files, hence do so.
Since we touched the #includes of those files, let's order them properly
according to CODING_STYLE. |
ae691c1d9382995ea7e28317f5c37023229c27ee |
|
06-Aug-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
hostname-util: get rid of unused parameter of hostname_cleanup()
All users are now setting lowercase=false. |
17eb9a9ddba3f03fcba33445c1c1eedeb948da04 |
|
06-Aug-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
hostnamectl: allow trailing dot on fqdn
When the user requests to set hostname, and we are setting both
pretty and static hostnames, and the name is a valid FQDN, we
use it as the static hostname, and unset the pretty hostname.
The change is that a FQDN with a trailing dot is accepted and ignored.
https://bugzilla.redhat.com/show_bug.cgi?id=1238246
Lowercasing of the static name is not done anymore.
$ hostnamectl set-hostname Foobar.
=> static is "Foobar", pretty is "Foobar."
$ hostnamectl set-hostname Foobar.org.
=> static is "Foobar.org", pretty is unset
$ hostnamectl set-hostname Foobar.org..
=> static is "Foobar.org", pretty is "Foobar.org.." |
03976f7b4a84b8b1492a549a3470b2bba8f37008 |
|
03-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: introduce new sd_bus_flush_close_unref() call
sd_bus_flush_close_unref() is a call that simply combines sd_bus_flush()
(which writes all unwritten messages out) + sd_bus_close() (which
terminates the connection, releasing all unread messages) +
sd_bus_unref() (which frees the connection).
The combination of this call is used pretty frequently in systemd tools
right before exiting, and should also be relevant for most external
clients, and is hence useful to cover in a call of its own.
Previously the combination of the three calls was already done in the
_cleanup_bus_close_unref_ macro, but this was only available internally.
Also see #327 |
958b66ea16deddd794b3a52643bd44633e165ead |
|
18-May-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split all hostname related calls into hostname-util.c |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
de33fc625725d199629ed074d6278504deb23deb |
|
24-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()
Pretty much everywhere else we use the generic term "machine" when
referring to containers in API, so let's do though in sd-bus too. In
particular, since the concept of a "container" exists in sd-bus too, but
as part of the marshalling system. |
5567fafbc9d83a1391f23ecdbe698a3c03929370 |
|
28-Nov-2014 |
Martin Pitt <martin.pitt@ubuntu.com> |
hostnamectl: Exit with zero on success
In show_all_names(), bus_map_all_properties() returns 1 on success which is
then used as the return code of show_all_names() and eventually main(). Exit
with zero in main() on all nonnegative results to guard against similar errors. |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'
Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno(). |
41414fed519e2699b52c7e3eb0876a1feb3ef68c |
|
15-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
hostnamectl: actually implement location support |
249968612f16a71df909d6e73785c18a9ff36a65 |
|
04-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
bus: always explicitly close bus from main programs
Since b5eca3a2059f9399d1dc52cbcf9698674c4b1cf0 we don't attempt to GC
busses anymore when unsent messages remain that keep their reference,
when they otherwise are not referenced anymore. This means that if we
explicitly want connections to go away, we need to close them.
With this change we will no do so explicitly wherver we connect to the
bus from a main program (and thus know when the bus connection should go
away), or when we create a private bus connection, that really should go
away after our use.
This fixes connection leaks in the NSS and PAM modules. |
601185b43da638b1c74153deae01dbd518680889 |
|
04-Aug-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Unify parse_argv style
getopt is usually good at printing out a nice error message when
commandline options are invalid. It distinguishes between an unknown
option and a known option with a missing arg. It is better to let it
do its job and not use opterr=0 unless we actually want to suppress
messages. So remove opterr=0 in the few places where it wasn't really
useful.
When an error in options is encountered, we should not print a lengthy
help() and overwhelm the user, when we know precisely what is wrong
with the commandline. In addition, since help() prints to stdout, it
should not be used except when requested with -h or --help.
Also, simplify things here and there. |
799298d6513e7d40125c19d46578bb870d047db4 |
|
11-Jul-2014 |
Jóhann B. Guðmundsson < <johannbg@gmail.com> |
Add DEPLOYMENT to hostnamectl
[zj: remove the check against a fixed list of environments.] |
24efb112451413c1013d5f7fe27d7e2cd407647a |
|
24-May-2014 |
Kay Sievers <kay@vrfy.org> |
shared: rename hwclock.[ch] to clock-util.[ch] |
fa4f8f9bc1fbef6a658cff39ac185bbedea6caf4 |
|
23-Apr-2014 |
Djalal Harouni <tixxdz@opendz.org> |
hostnamectl: read kernel name and release from remote |
3448456bb20384987a5a6335518072f7c35ba32b |
|
11-Mar-2014 |
Djalal Harouni <tixxdz@opendz.org> |
hostnamectl: read OS pretty_name and cpe_name from remote |
e9a2e453bbe3522db4341e4a2a49ae8aab8eb5a3 |
|
25-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
hostnamectl: read virtualization/architecture from remote side
This way we make this more network/container transparent and also do not
require any client side privileges. |
d9d93745cd2efcdfca8f82d798e61e0ee70cef5c |
|
21-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
hostnamectl: should the sanitized arch, not the native uname() one |
39883f622f392d8579f4428fc5a789a102efbb10 |
|
19-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
make gcc shut up
If -flto is used then gcc will generate a lot more warnings than before,
among them a number of use-without-initialization warnings. Most of them
without are false positives, but let's make them go away, because it
doesn't really matter. |
f20c84c15f3fea2f6767cdd7dd50d5273773b044 |
|
04-Dec-2013 |
David Coppa <dcoppa@gmail.com> |
Fix typo: SetChasis -> SetChassis |
a86a47ce1f63476631635fbcbc10af8877172114 |
|
07-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
clients: try to follow roughly the same order in --help texts for common options |
5b30bef856e89a571df57b7b953e9a1409d9aced |
|
07-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: log message parsing errors everywhere with a generalized bus_log_parse_error() |
46e65dcc3a522b5e992e165b5e61d14254026859 |
|
07-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
polkit: don't spawn local client if we access a remote system |
eb9da376d76b48585b3b63b4f91903b54f7abd36 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
clients: unify how we invoke getopt_long()
Among other things this makes sure we always expose a --version command
and show it in the help texts. |
84f6181c2ac99a0514ca5e0c8fc8c8e284caf789 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
clients: various simplifications |
9f6eb1cd58f2ddf2eb6ba0e4de056e13d938af75 |
|
05-Nov-2013 |
Kay Sievers <kay@vrfy.org> |
bus: update bus_map_all_properties() |
fc7689bc9ccf9b94f9a9f666f84c79b8f5b84791 |
|
04-Nov-2013 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
hostnamectl: H requires an argument, P is no longer used |
b028f3e410a7b9ba6b6291a79164d3de2638eb0b |
|
02-Nov-2013 |
Simon Peeters <peeters.simon@gmail.com> |
hostnamectl: port to sd-bus
Kay:
- rebase to new transport logic
- replaced iteration macro with property map |
872c8faaf2009422a91d227ae0b5c6f04c9d2c69 |
|
13-Oct-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Fix write-only use of a few variables
Since the invention of read-only memory, write-only memory has been
considered deprecated. Where appropriate, either make use of the
value, or avoid writing it, to make it clear that it is not used. |
960787ae27af395c28fb1ce9de5a575ebfb27a4d |
|
15-Aug-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
hostnamectl: show only specific hostname when requested
Existing --pretty, --transient, --static options, used previously
for 'set-hostname' verb, are reused for the 'status' verb. If one
of them is given, only the specified hostname is printed. This
way there's no need to employ awk to get the hostname in a script. |
7085053a437456ab87d726f3697002dd811fdf7a |
|
10-Jun-2013 |
Daniel Wallace <danielwallace@gtmanfred.com> |
Allow for the use of @ in remote host calls
Without this you have to use %40 with the -H flag because dbus doesn't
like the @ sign being unescaped. |
546158bc6f46f8004cc11e81d19d223e0da56730 |
|
23-May-2013 |
Jan Janssen <medhefgo@web.de> |
Fix --no-ask-password
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. |
2927b326ccf67236e148444679f582ea1437ef5a |
|
21-May-2013 |
Jan Janssen <medhefgo@web.de> |
man: Document missing options |
c0b21b9669a86a5e404b73865080494063ee8351 |
|
07-May-2013 |
Lennart Poettering <lennart@poettering.net> |
hostnamectl: suppress outputting of pretty hostname field in status if empty |
e724b0639c43c2821613fc4f7f755f87c49a22e8 |
|
07-May-2013 |
Lennart Poettering <lennart@poettering.net> |
hostname: only suppress setting of pretty hostname if it is non-equal to the static hostname and if the static hostname is set, too
https://bugzilla.redhat.com/show_bug.cgi?id=957814 |
b92bea5d2a9481de69bb627a7b442a9f58fca43d |
|
06-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Use initalization instead of explicit zeroing
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. |
fda2c5d28bdf5c6ac1ff1ba504fa884c48ed1439 |
|
03-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
hostnamectl: if somebody invokes 'hostnamectl set-hostname' with a valid internet hostname unset the pretty name
If people are unaware or uninterested in the concept of pretty host
names, and simply invoke "hostnamectl set-hostname" for a valid internet
host name, then use this as indication to unset the pretty host name and
only set the static/dynamic one.
This also allows fqdn, hence "hostnamectl set-hostname www.foobar.com"
will just work if people really insist on using fqdns as hostnames. |
a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7 |
|
14-Feb-2013 |
Harald Hoyer <harald@redhat.com> |
honor SELinux labels, when creating and writing config files
Also split out some fileio functions to fileio.c and provide a SELinux
aware pendant in fileio-label.c
see https://bugzilla.redhat.com/show_bug.cgi?id=881577 |
bc2708414babc5c99bb8000e63c84e87606cc15d |
|
04-Jan-2013 |
Lennart Poettering <lennart@poettering.net> |
build-sys: drop all distribution specfic checks
Yay, we now have a completely generic systemd. No distribution specific checks anymore! |
7871c8e9327e4e5b18de9d8081b0f32fa38c2c1f |
|
24-Dec-2012 |
Lennart Poettering <lennart@poettering.net> |
hostnamed: make chassis type configurable via /etc/machine-info
For many usecases it is useful to store the chassis type somewhere, and
/etc/machine-info sounds like a good place. Ideally we could always
detect the chassis type from firmware, but frequently that's not
available and in many embedded devices probably entirely unrealistic.
This patch adds a configurable setting CHASSIS= to /etc/machine-info and
exposes this via hostnamectl/hostnamed. hostnamed will guess the chassis
type from DMI if nothing is set explicitly. I also added support for
detecting it from ACPI, which should be more useful as ACPI 5.0 actually
knows a "tablet" chassis type, which neither DMI nor previous ACPI
versions knew.
This also enables DMI-based and ACPI-based detection for non-x86 systems
as ACPI is apparently coming to ARM platforms soon.
I tried to minimize the vocabulary of chassis types understood and
added: desktop, laptop, server, tablet, handset. This is much less than
either APCI or DMI know. If we need more types later on we can easily
add them. |
59f432ea6d6d441d0af7c76c37e80730c8df473a |
|
15-Nov-2012 |
Lennart Poettering <lennart@poettering.net> |
hostnamectl: fix parsing of --no-ask-password |
a9cdc94f7ff40f22a3cf9472f612a80730a1b010 |
|
12-Nov-2012 |
Dave Reisner <dreisner@archlinux.org> |
enable localization for common *ctl commands |
f36d7992ef9588e24feaae5bb3d103ca63af71bd |
|
29-Oct-2012 |
Kay Sievers <kay@vrfy.org> |
hostnamectl: do not choke on set-hostname with no argument
https://bugzilla.redhat.com/show_bug.cgi?id=871172 |
fe29f9d25bb58b9d5c5581a2991d40358d2c8b31 |
|
21-Oct-2012 |
Lennart Poettering <lennart@poettering.net> |
hostnamectl: add more really basic system info to the status output |
7591abd48079edc1f2adbd922e4b83eb73abeabe |
|
19-Oct-2012 |
Lennart Poettering <lennart@poettering.net> |
timedatectl,hostnamectl: rework --help text |
dbc4fbae58e39cb0d33738f0a4d1e74511ed1fb5 |
|
17-Oct-2012 |
Lennart Poettering <lennart@poettering.net> |
hostname: add new hostnamectl tool as text client for hostnamed |