summaryrefslogtreecommitdiff
path: root/src/core/hostname-setup.c
AgeCommit message (Collapse)Author
2015-05-19hostname: Allow comments in /etc/hostnameMartin Pitt
The hostname(1) tool allows comments in /etc/hostname. Introduce a new read_hostname_config() in hostname-util which reads a hostname configuration file like /etc/hostname, strips out comments, whitespace, and cleans the hostname. Use it in hostname-setup.c and hostnamed and remove duplicated code. Update hostname manpage. Add tests. https://launchpad.net/bugs/1053048
2015-05-18util: split all hostname related calls into hostname-util.cLennart Poettering
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
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.
2014-11-28treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
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().
2014-10-27util: introduce sethostname_idempotentMichal Sekletar
Function queries system hostname and applies changes only when necessary. Also, migrate all client of sethostname to sethostname_idempotent while at it.
2013-05-07hostname: only suppress setting of pretty hostname if it is non-equal to the ↵Lennart Poettering
static hostname and if the static hostname is set, too https://bugzilla.redhat.com/show_bug.cgi?id=957814
2013-02-14honor SELinux labels, when creating and writing config filesHarald Hoyer
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-01-04core: drop support for old per-distro configuration files for console, ↵Lennart Poettering
hostname, locale, timezone This simplifies the upstream system code quite a bit. If downstream distributions want to maintain compatibility with their old configuration files, they are welcome to do so, but need to maintain this as patches downstream. The burden needs to be on the distributions to maintain differences here. Our suggestion however is to just convert the old configuration files on upgrade, as multiple distributions already do.
2012-11-03drop Arch Linux support for reading /etc/rc.confDave Reisner
2012-10-24remove Fedora hostname, locale, vconsole legacy file supportKay Sievers
2012-09-13macro: introduce _cleanup_free_ macro for automatic freeing of scoped vars ↵Lennart Poettering
and make use of it
2012-07-09MeeGo: Remove build support for MeeGo distribution.Auke Kok
The MeeGo distribution is still a supported distribution, but will probably not see an updated version of systemd anymore. Most of the development is focussing on Tizen now, and the generic support for building --with-distro=other is more than adequate enough. This patch removes the support as a custom configuration build target in systemd. People who are still building this for the MeeGo distribution should build as "other" distro.
2012-05-21hostname-setup: also consider (ńone) an unset hostnameLennart Poettering
2012-04-22hostname: if there's already a hostname set when PID 1 is invoked, don't ↵Lennart Poettering
complain
2012-04-12hostname-setup: move to core/Lennart Poettering