summaryrefslogtreecommitdiffstats
path: root/src/hostname (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* | hostnamed: minor style cleanupsZbigniew Jędrzejewski-Szmek2020-12-161-7/+4
| |
* | hostnamed: when hostname is set to existing value, suppress notificationsZbigniew Jędrzejewski-Szmek2020-12-161-7/+11
| | | | | | | | | | When the hostname is set through network config or such, let's optimize things a bit by suppressing the logs and dbus notifications.
* | Move hostname setup logic to new shared/hostname-setup.[ch]Zbigniew Jędrzejewski-Szmek2020-12-161-0/+1
| | | | | | | | | | | | | | | | | | | | No functional change, just moving a bunch of things around. Before we needed a rather complicated setup to test hostname_setup(), because the code was in src/core/. When things are moved to src/shared/ we can just test it as any function. The test is still "unsafe" because hostname_setup() may modify the hostname.
* | hostnamed: fix return valueZbigniew Jędrzejewski-Szmek2020-12-161-2/+4
| |
* | hostnamed: expose the fallback-hostname setting as a const dbus propertyZbigniew Jędrzejewski-Szmek2020-12-161-0/+4
| | | | | | | | | | | | Various users want to know what the fallback hostname is. Since it was made configurable in 8146c32b9264a6915d467a5cab1a24311fbede7e, we didn't expose this nicely.
* | hostname-util: flagsify hostname_is_valid(), drop machine_name_is_valid()Lennart Poettering2020-12-152-3/+3
|/ | | | | | | | | | | | Let's clean up hostname_is_valid() a bit: let's turn the second boolean argument into a more explanatory flags field, and add a flag that accepts the special name ".host" as valid. This is useful for the container logic, where the special hostname ".host" refers to the "root container", i.e. the host system itself, and can be specified at various places. let's also get rid of machine_name_is_valid(). It was just an alias, which is confusing and even more so now that we have the flags param.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-096-6/+6
|
* tree-wide: assorted coccinelle fixesFrantisek Sumsal2020-10-091-4/+3
|
* tree-wide: don't needlessly negate error number passed to bus_error_message()Lennart Poettering2020-09-141-1/+1
| | | | | | Like it's customary in our codebase bus_error_message() internally takes abs() of the passed error anyway, hence no need to explicitly negate it. We mostly got this right, but in too many cases we didn't. Fix that.
* hostnamed: add various debugging log messages when we determine chassis typeLennart Poettering2020-09-111-10/+25
| | | | No actual code flow changes, just a bunch of debug messages.
* hostnamed: map 'all-in-one' DMI chassis type to desktoplichangze2020-09-111-0/+1
|
* bus: use bus_log_connect_error to print error messagefangxiuning2020-07-211-1/+1
|
* shared: split out code that maps properties to local structsLennart Poettering2020-06-301-1/+1
| | | | Just some refactoring, no code changes.
* hostnamed: minimize caching of /etc/hostname, /etc/os-release and ↵Lennart Poettering2020-06-251-24/+156
| | | | | | | | | | | | /etc/machine-info Instead of reading these files at startup and never again, let's read them when we need them. As an optimization (in particular as some of these files contain the data for many fields at once) let's cache the results as long as the stat data (i.e. mtime) remains stable. Also, while we are at it, if we can't read any of these props, let's not fail everything, but continue without the data.
* hostnamed: don't cache local hostname eitherLennart Poettering2020-06-251-21/+44
| | | | | Querying the current hostname is cheap, hence let's not cache it. That way it is much less likely we'll return out-of-date data.
* log: introduce log_parse_environment_cli() and log_setup_cli()Filipe Brandenburger2020-06-241-3/+1
| | | | | | | | | | | | | | | | Presently, CLI utilities such as systemctl will check whether they have a tty attached or not to decide whether to parse /proc/cmdline or EFI variable SystemdOptions looking for systemd.log_* entries. But this check will be misleading if these tools are being launched by a daemon, such as a monitoring daemon or automation service that runs in background. Make log handling of CLI tools uniform by never checking /proc/cmdline or EFI variables to determine the logging level. Furthermore, introduce a new log_setup_cli() shortcut to set up common options used by most command-line utilities.
* Make failures of mac_selinux_init() fatalChristian Göttsche2020-06-231-1/+4
|
* hostnamed: call our destructor _destroy(), not _clear()Lennart Poettering2020-05-181-2/+2
|
* hostnamed: don't cache system UUIDLennart Poettering2020-05-181-16/+17
| | | | | | There's no point in caching this. Let's always get this directly from sysfs, so that we can never get out-of-date data here (after all this is going to be cheap, and people might overmount it or so)
* hostnamed: don't cache uname() dataLennart Poettering2020-05-181-15/+19
| | | | | | Let's not cache the uname(), it's very cheap to get it, and just means we might get out of sync with what is current. After all, the data might change IRL, due to setarch and stuff.
* hostnamed: convert to the new scheme and add --bus-introspectZbigniew Jędrzejewski-Szmek2020-05-051-3/+10
|
* importd,logind: add --bus-introspect= optionZbigniew Jędrzejewski-Szmek2020-05-051-0/+1
|
* logind,importd,hostnamed,localed,timedated,machined,resolved: add option ↵Zbigniew Jędrzejewski-Szmek2020-05-031-5/+7
| | | | | | | | parsing stubs --help and --version are implemented in the usual style. help() prints full path, since the program is not expected to be in $PATH.
* Merge pull request #15472 from keszybz/dbus-api-docsLennart Poettering2020-04-232-12/+12
|\ | | | | A few more dbus api documentation updates
| * tree-wide: use "hostname" spelling everywhereZbigniew Jędrzejewski-Szmek2020-04-212-12/+12
| | | | | | | | | | | | | | | | It's not that I think that "hostname" is vastly superior to "host name". Quite the opposite — the difference is small, and in some context the two-word version does fit better. But in the tree, there are ~200 occurrences of the first, and >1600 of the other, and consistent spelling is more important than any particular spelling choice.
* | tree-wide: implement new log control API dbus interface in all our daemonsLennart Poettering2020-04-211-0/+5
|/
* hostnamed: add dbus parameter namesZbigniew Jędrzejewski-Szmek2020-04-121-8/+58
|
* shared: split out polkit stuff from bus-util.c → bus-polkit.cLennart Poettering2020-01-221-1/+1
| | | | | | It's enough, complex stuff to warrant its own source file. No other changes, just splitting out.
* tree-wide: clean up --help texts a bitLennart Poettering2019-11-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleans up and unifies the outut of --help texts a bit: 1. Highlight the human friendly description string, not the command line via ANSI sequences. Previously both this description string and the brief command line summary was marked with the same ANSI highlight sequence, but given we auto-page to less and less does not honour multi-line highlights only the command line summary was affectively highlighted. Rationale: for highlighting the description instead of the command line: the command line summary is relatively boring, and mostly the same for out tools, the description on the other hand is pregnant, important and captions the whole thing and hence deserves highlighting. 2. Always suffix "Options" with ":" in the help text 3. Rename "Flags" → "Options" in one case 4. Move commands to the top in a few cases 5. add coloring to many more help pages 6. Unify on COMMAND instead of {COMMAND} in the command line summary. Some tools did it one way, others the other way. I am not sure what precisely {} is supposed to mean, that uppercasing doesn't, hence let's simplify and stick to the {}-less syntax And minor other tweaks.
* tree-wide: drop string.h when string-util.h or friends are includedYu Watanabe2019-11-031-1/+0
|
* Highlight the synopsis and summary in --helpZbigniew Jędrzejewski-Szmek2019-10-081-2/+5
| | | | | This doesn't cover all the binaries, but I don't know how to script this, and I run out of steam ;)
* Move the Commands section above Options sectionZbigniew Jędrzejewski-Szmek2019-10-081-9/+10
| | | | | | | For executables which take a verb, we should list the verbs first, and then options which modify those verbs second. The general layout of the man page is from general description to specific details, usually Overview, Commands, Options, Return Value, Examples, References.
* Generate stable machine-id and DHCP client ID on POWER KVM.Dimitri John Ledkov2019-08-311-0/+2
|
* tree-wide: get rid of strappend()Lennart Poettering2019-07-121-2/+2
| | | | | It's a special case of strjoin(), so no need to keep both. In particular as typing strjoin() is even shoert than strappend().
* Enable log colors for most of tools in /usr/binZbigniew Jędrzejewski-Szmek2019-05-081-0/+1
| | | | | | | | | | When emitting the calendarspec warning we want to see some color. Follow-up for 04220fda5c. Exceptions: - systemctl, because it has a lot hand-crafted coloring - tmpfiles, sysusers, stdio-bridge, etc, because they are also used in services and I'm not sure if this wouldn't mess up something.
* headers: remove unneeded includes from util.hZbigniew Jędrzejewski-Szmek2019-03-271-0/+2
| | | | | This means we need to include many more headers in various files that simply included util.h before, but it seems cleaner to do it this way.
* util: split out nulstr related stuff to nulstr-util.[ch]Lennart Poettering2019-03-141-0/+1
|
* Merge pull request #11086 from poettering/nscd-cache-flushZbigniew Jędrzejewski-Szmek2018-12-171-0/+3
|\ | | | | flush nscd's caches when we register user/groups/hostnames
| * hostnamed: always flush nscd cache when changing hostnameLennart Poettering2018-12-151-0/+3
| | | | | | | | This way we know that nss-myhostname always serves the correct answer.
* | hostnamed: filter out all-zero and all-0xFF DMI ProductUUIDsLennart Poettering2018-12-151-2/+6
|/ | | | | These UUIDs are considered as wildcard value for "unset" UUIDs typically, and this even makes sense. Let's suppress them hence.
* util: drop missing.h from util.hYu Watanabe2018-12-041-0/+1
|
* util-lib: split out env file parsing code into env-file.cLennart Poettering2018-12-021-0/+2
| | | | | | It's quite complex, let's split this out. No code changes, just some file rearranging.
* util-lib: don't include fileio.h from fileio-label.hLennart Poettering2018-12-021-0/+1
| | | | There's no reason for doing that, hence simply don't.
* Split out pretty-print.c and move pager.c and main-func.h to shared/Zbigniew Jędrzejewski-Szmek2018-11-201-1/+1
| | | | | This is high-level functionality, and fits better in shared/ (which is for our executables), than in basic/ (which is also for libraries).
* hostnamed: use DEFINE_MAIN_FUNCTION() macroYu Watanabe2018-11-201-30/+19
| | | | This also renames context_free() to context_clear().
* log: introduce new helper call log_setup_service()Lennart Poettering2018-11-201-3/+1
| | | | | Let's reduce the common boilerplate and have a single setup function used by all service code to setup logging.
* util-lib: move main() definition macros to its own header fileLennart Poettering2018-11-191-0/+1
| | | | | | | | | This way, we can extend the macro a bit with stuff pulled in from other headers without this affecting everything which pulls in macro.h, which is one of our most basic headers. This is just refactoring, no change in behaviour, in prepartion for later changes.
* hostnamectl: define main through macroZbigniew Jędrzejewski-Szmek2018-11-171-10/+7
|
* fileio: automatically add NULL sentinel to parse_env_file()Lennart Poettering2018-11-141-2/+1
| | | | Let's modernize things a bit.
* fileio: drop "newline" parameter for env file parsersLennart Poettering2018-11-141-2/+2
| | | | | | | Now that we don't (mis-)use the env file parser to parse kernel command lines there's no need anymore to override the used newline character set. Let's hence drop the argument and just "\n\r" always. This nicely simplifies our code.