Commit Graph

81 Commits

Author SHA1 Message Date
Djalal Harouni 3448456bb2 hostnamectl: read OS pretty_name and cpe_name from remote 2014-03-11 17:48:45 +01:00
Lennart Poettering e9a2e453bb 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.
2014-02-25 01:03:30 +01:00
Lennart Poettering d9d93745cd hostnamectl: should the sanitized arch, not the native uname() one 2014-02-21 02:43:14 +01:00
Lennart Poettering 39883f622f 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.
2014-02-19 17:53:50 +01:00
David Coppa f20c84c15f Fix typo: SetChasis -> SetChassis 2013-12-04 09:28:19 -05:00
Lennart Poettering a86a47ce1f clients: try to follow roughly the same order in --help texts for common options 2013-11-07 21:31:13 +01:00
Lennart Poettering 5b30bef856 bus: log message parsing errors everywhere with a generalized bus_log_parse_error() 2013-11-07 21:26:31 +01:00
Lennart Poettering 46e65dcc3a polkit: don't spawn local client if we access a remote system 2013-11-07 21:06:44 +01:00
Lennart Poettering eb9da376d7 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.
2013-11-06 18:28:39 +01:00
Lennart Poettering 84f6181c2a clients: various simplifications 2013-11-06 17:32:51 +01:00
Kay Sievers 9f6eb1cd58 bus: update bus_map_all_properties() 2013-11-05 02:57:49 +01:00
Thomas Hindoe Paaboel Andersen fc7689bc9c hostnamectl: H requires an argument, P is no longer used 2013-11-04 17:32:50 +01:00
Simon Peeters b028f3e410 hostnamectl: port to sd-bus
Kay:
 - rebase to new transport logic
 - replaced iteration macro with property map
2013-11-02 02:15:54 +01:00
Zbigniew Jędrzejewski-Szmek 872c8faaf2 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.
2013-10-13 17:56:54 -04:00
Zbigniew Jędrzejewski-Szmek 960787ae27 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.
2013-08-14 19:06:54 -04:00
Daniel Wallace 7085053a43 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.
2013-06-09 18:26:41 -04:00
Jan Janssen 546158bc6f 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.
2013-05-23 00:28:04 -04:00
Jan Janssen 2927b326cc man: Document missing options 2013-05-21 09:23:51 -04:00
Lennart Poettering c0b21b9669 hostnamectl: suppress outputting of pretty hostname field in status if empty 2013-05-07 20:56:41 +02:00
Lennart Poettering e724b0639c 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
2013-05-07 20:56:41 +02:00
Zbigniew Jędrzejewski-Szmek b92bea5d2a 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.
2013-04-05 19:50:57 -04:00
Lennart Poettering fda2c5d28b 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.
2013-04-03 22:06:16 +02:00
Harald Hoyer a5c32cff1f 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
2013-02-14 16:19:38 +01:00
Lennart Poettering bc2708414b build-sys: drop all distribution specfic checks
Yay, we now have a completely generic systemd. No distribution specific checks anymore!
2013-01-04 23:26:21 +01:00
Lennart Poettering 7871c8e932 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.
2012-12-24 19:03:59 +01:00
Lennart Poettering 59f432ea6d hostnamectl: fix parsing of --no-ask-password 2012-11-15 23:07:25 +01:00
Dave Reisner a9cdc94f7f enable localization for common *ctl commands 2012-11-12 14:16:07 -05:00
Kay Sievers f36d7992ef hostnamectl: do not choke on set-hostname with no argument
https://bugzilla.redhat.com/show_bug.cgi?id=871172
2012-10-29 20:56:02 +01:00
Lennart Poettering fe29f9d25b hostnamectl: add more really basic system info to the status output 2012-10-21 03:35:54 +02:00
Lennart Poettering 7591abd480 timedatectl,hostnamectl: rework --help text 2012-10-19 04:51:53 +02:00
Lennart Poettering dbc4fbae58 hostname: add new hostnamectl tool as text client for hostnamed 2012-10-17 21:25:42 +02:00