summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* vconsole: setup_remaining_vcs() - more sanity checksMichal Soltys2016-10-261-19/+40
| | | | | | Check if values filled up by KD_FONT_OP_GET ioctl make sense - dummy driver for example doesn't implement required functionality at all.
* vconsole: skip unnecessary udev call for dummy deviceMichal Soltys2016-10-211-1/+1
| | | | | | | In particular, the font copying has no chance of succeeding as the required functionality is not implemented, see: drivers/video/console/dummycon.c
* Merge pull request #4447 from poettering/oneshotassertfixDaniel Mack2016-10-211-1/+9
|\ | | | | core: if the start command vanishes during runtime don't hit an assert
| * core: if the start command vanishes during runtime don't hit an assertLennart Poettering2016-10-211-1/+9
| | | | | | | | | | | | | | This can happen when the configuration is changed and reloaded while we are executing a service. Let's not hit an assert in this case. Fixes: #4444
* | Merge pull request #4419 from keszybz/install-specifiersLennart Poettering2016-10-211-9/+48
|\ \ | | | | | | Fix expansion of %i, %u, %N, %n install specifiers
| * | shared/install: fix %u expansion when running under sudoZbigniew Jędrzejewski-Szmek2016-10-201-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test case: [Install] DefaultInstance=bond1 WantedBy= foobar-U-%U.device WantedBy= foobar-u-%u.device $ sudo systemctl --root=/ enable testing4@.service (before) Created symlink /etc/systemd/system/foobar-U-0.device.wants/testing4@bond1.service → /etc/systemd/system/testing4@.service. Created symlink /etc/systemd/system/foobar-u-zbyszek.device.wants/testing4@bond1.service → /etc/systemd/system/testing4@.service. (after) Created symlink /etc/systemd/system/foobar-U-0.device.wants/testing4@bond1.service → /etc/systemd/system/testing4@.service. Created symlink /etc/systemd/system/foobar-u-root.device.wants/testing4@bond1.service → /etc/systemd/system/testing4@.service. It doesn't make much sense to use a different user for %U and %u.
| * | shared/install: fix DefaultInstance expansion in %n, %NZbigniew Jędrzejewski-Szmek2016-10-201-4/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should substitute DefaultInstance if the instance is not specified. Test case: [Install] DefaultInstance=bond1 WantedBy= foobar-n-%n.device WantedBy= foobar-N-%N.device $ systemctl --root=/ enable testing4@.service Created symlink /etc/systemd/system/foobar-n-testing4@bond1.service.device.wants/testing4@bond1.service → /etc/systemd/system/testing4@.service. Created symlink /etc/systemd/system/foobar-N-testing4@bond1.device.wants/testing4@bond1.service → /etc/systemd/system/testing4@.service. (before, the symlink would be created with empty %n, %N parts).
| * | shared/install: fix DefaultInstance expansion in %iZbigniew Jędrzejewski-Szmek2016-10-201-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should substitute DefaultInstance if the instance is not specified. Test case: [Install] DefaultInstance=bond1 WantedBy= foobar-i-%i.device $ systemctl --root=/ enable testing4@.service Created symlink /etc/systemd/system/foobar-i-bond1.device.wants/testing4@bond1.service → /etc/systemd/system/testing4@.service. (before, the symlink would be created as /etc/systemd/system/foobar-i-.device.wants/testing4@bond1.service) Fixes #4411.
* | | sysusers: fix memleak (#4443)Evgeny Vereshchagin2016-10-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: Oct 20 09:10:49 systemd-sysusers[144]: Direct leak of 20 byte(s) in 1 object(s) allocated from: Oct 20 09:10:49 systemd-sysusers[144]: #0 0x7f3565a13e60 in malloc (/lib64/libasan.so.3+0xc6e60) Oct 20 09:10:49 systemd-sysusers[144]: #1 0x7f3565526bd0 in malloc_multiply src/basic/alloc-util.h:70 Oct 20 09:10:49 systemd-sysusers[144]: #2 0x7f356552cb55 in tempfn_xxxxxx src/basic/fileio.c:1116 Oct 20 09:10:49 systemd-sysusers[144]: #3 0x7f356552c4f0 in fopen_temporary src/basic/fileio.c:1042 Oct 20 09:10:49 systemd-sysusers[144]: #4 0x7f356555e00e in fopen_temporary_label src/basic/fileio-label.c:63 Oct 20 09:10:49 systemd-sysusers[144]: #5 0x56197c4a1766 in make_backup src/sysusers/sysusers.c:209 Oct 20 09:10:49 systemd-sysusers[144]: #6 0x56197c4a6335 in write_files src/sysusers/sysusers.c:710 Oct 20 09:10:49 systemd-sysusers[144]: #7 0x56197c4ae571 in main src/sysusers/sysusers.c:1817 Oct 20 09:10:49 systemd-sysusers[144]: #8 0x7f3564dee730 in __libc_start_main (/lib64/libc.so.6+0x20730)
* | | Revert "add networkd dbus lease info" (#4435)Zbigniew Jędrzejewski-Szmek2016-10-213-144/+0
| | |
* | | nspawn, NEWS: add missing "s" in --private-users-chown (#4438)Zbigniew Jędrzejewski-Szmek2016-10-211-1/+1
| |/ |/|
* | sysusers: fix memleak (#4430)Evgeny Vereshchagin2016-10-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: ``` ==28075== 64 bytes in 1 blocks are definitely lost in loss record 2 of 3 ==28075== at 0x4C2BAEE: malloc (vg_replace_malloc.c:298) ==28075== by 0x4C2DCA1: realloc (vg_replace_malloc.c:785) ==28075== by 0x4ED40A2: greedy_realloc (alloc-util.c:57) ==28075== by 0x4E90F87: extract_first_word (extract-word.c:78) ==28075== by 0x4E91813: extract_many_words (extract-word.c:270) ==28075== by 0x10FE93: parse_line (sysusers.c:1325) ==28075== by 0x11198B: read_config_file (sysusers.c:1640) ==28075== by 0x111EB8: main (sysusers.c:1773) ==28075== ```
* | update-utmp: let's use STR_IN_SET() where it is prettyLennart Poettering2016-10-201-1/+2
| |
* | logind: don't hit assert when we try to free NULL manager objectLennart Poettering2016-10-201-1/+2
| | | | | | | | Fixes: #4431
* | tests: fix memleak in test-calendarspec (#4424)Evgeny Vereshchagin2016-10-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: ``` ==10750== ==10750== HEAP SUMMARY: ==10750== in use at exit: 96 bytes in 3 blocks ==10750== total heap usage: 1,711 allocs, 1,708 frees, 854,545 bytes allocated ==10750== ==10750== 96 (64 direct, 32 indirect) bytes in 1 blocks are definitely lost in loss record 3 of 3 ==10750== at 0x4C2DA60: calloc (vg_replace_malloc.c:711) ==10750== by 0x4EB3BDA: calendar_spec_from_string (calendarspec.c:771) ==10750== by 0x109675: test_hourly_bug_4031 (test-calendarspec.c:118) ==10750== by 0x10A00E: main (test-calendarspec.c:202) ==10750== ==10750== LEAK SUMMARY: ==10750== definitely lost: 64 bytes in 1 blocks ==10750== indirectly lost: 32 bytes in 2 blocks ==10750== possibly lost: 0 bytes in 0 blocks ==10750== still reachable: 0 bytes in 0 blocks ==10750== suppressed: 0 bytes in 0 blocks ==10750== ==10750== For counts of detected and suppressed errors, rerun with: -v ==10750== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) ```
* | journald,core: add short comments we we keep reopening /dev/console all the timeLennart Poettering2016-10-202-0/+10
| | | | | | | | | | | | | | | | | | Just to make sure the next one reading this isn't surprised that the fd isn't kept open. SAK and stuff... Fix suggested: https://github.com/systemd/systemd/pull/4366#issuecomment-253659162
* | Merge pull request #4417 from keszybz/man-and-rlimitLennart Poettering2016-10-202-4/+4
|\ \ | |/ |/| Two unrelated patches: man page tweaks and rlimit log levels
| * pid1: downgrade some rlimit warningsZbigniew Jędrzejewski-Szmek2016-10-192-4/+4
| | | | | | | | | | | | | | Since we ignore the result anyway, downgrade errors to warning. log_oom() will still emit an error, but that's mostly theoretical, so it is not worth complicating the code to avoid the small inconsistency
* | core: let's upgrade the log level for service processes dying of signal (#4415)Lennart Poettering2016-10-191-1/+8
| | | | | | | | As suggested in https://github.com/systemd/systemd/pull/4367#issuecomment-253670328
* | Merge pull request #4360 from fbuihuu/journald-fix-flush-when-restartingLennart Poettering2016-10-204-160/+198
|\ \ | | | | | | Journald fix flush when restarting (#4190)
| * | journal: rename determine_space_for() into cache_space_refresh()Franck Bui2016-10-191-29/+19
| | | | | | | | | | | | | | | | | | Now that determine_space_for() only deals with storage space (cached) values, rename it so it reflects the fact that only the cached storage space values are updated.
| * | journal: introduce patch_min_use() helperFranck Bui2016-10-193-34/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updating min_use is rather an unusual operation that is limited when we first open the journal files, therefore extracts it from determine_space_for() and create a function of its own and call this new function when needed. determine_space_for() is now dealing with storage space (cached) values only. There should be no functional changes.
| * | journal: introduce cache_space_invalidate()Franck Bui2016-10-191-5/+5
| | | | | | | | | | | | Introduce a dedicated helper in order to reset the storage space cache.
| * | journal: cache used vfs stats as wellFranck Bui2016-10-192-20/+30
| | | | | | | | | | | | | | | | | | | | | | | | The set of storage space values we cache are calculated according to a couple of filesystem statistics (free blocks, block size). This patch caches the vfs stats we're interested in so these values are available later and coherent with the rest of the space cached values.
| * | journal: don't emit space usage message when opening the journal (#4190)Franck Bui2016-10-192-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes system_journal_open() stop emitting the space usage message. The caller is now free to emit this message when appropriate. When restarting the journal, we can now emit the message *after* flushing the journal (if required) so that all flushed log entries are written in the persistent journal *before* the status message. This is required since the status message is always younger than the flushed entries. Fixes #4190.
| * | journal: introduce server_space_usage_message()Franck Bui2016-10-192-33/+46
| | | | | | | | | | | | | | | | | | | | | | | | This commit simply extracts from determine_space_for() the code which emits the storage usage message and put it into a function of its own so it can be reused by others paths later. No functional changes.
| * | journal: introduce JournalStorage and JournalStorageSpace structuresFranck Bui2016-10-193-85/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This structure keeps track of specificities for a given journal type (persistent or volatile) such as metrics, name, etc... The cached space values are now moved in this structure so that each journal has its own set of cached values. Previously only one set existed and we didn't know if the cached values were for the runtime journal or the persistent one. When doing: determine_space_for(s, runtime_metrics, ...); determine_space_for(s, system_metrics, ...); the second call returned the cached values for the runtime metrics.
| * | journal: introduce determine_path_usage()Franck Bui2016-10-191-30/+46
| | | | | | | | | | | | | | | | | | | | | | | | This commit simply extracts from determine_space_for() the code which determines the FS usage where the passed path lives (statvfs(3)) and put it into a function of its own so it can be reused by others paths later. No functional changes.
* | | Merge pull request #4390 from keszybz/install-specifiersLennart Poettering2016-10-193-33/+67
|\ \ \ | | | | | | | | Various install-related tweaks
| * | | shared/install: report invalid unit files slightly betterZbigniew Jędrzejewski-Szmek2016-10-182-16/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a unit file is invalid, we'd return an error without any details: $ systemctl --root=/ enable testing@instance.service Failed to enable: Invalid argument. Fix things to at least print the offending file name: $ systemctl enable testing@instance.service Failed to enable unit: File testing@instance.service: Invalid argument $ systemctl --root=/ enable testing@instance.service Failed to enable unit, file testing@instance.service: Invalid argument. A real fix would be to pass back a proper error message from conf-parser. But this would require major surgery, since conf-parser functions now simply print log errors, but we would need to return them over the bus. So let's just print the file name, to indicate where the error is. (Incomplete) fix for #4210.
| * | | shared/install: resolve specifiers in Also=Zbigniew Jędrzejewski-Szmek2016-10-181-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test case: [Install] WantedBy= default.target Also=getty@%p.service $ ./systemctl --root=/ enable testing@instance.service Created symlink /etc/systemd/system/default.target.wants/testing@instance.service → /etc/systemd/system/testing@.service. Created symlink /etc/systemd/system/getty.target.wants/getty@testing.service → /usr/lib/systemd/system/getty@.service. $ ./systemctl --root=/ disable testing@instance.service Removed /etc/systemd/system/getty.target.wants/getty@testing.service. Removed /etc/systemd/system/default.target.wants/testing@instance.service. Fixes part of #4210. Resolving specifiers in DefaultInstance seems to work too: [Install] WantedBy= default.target DefaultInstance=%u $ systemctl --root=/ enable testing3@instance.service Created symlink /etc/systemd/system/default.target.wants/testing3@instance.service → /etc/systemd/system/testing3@.service. $ systemctl --root=/ enable testing3@.service Created symlink /etc/systemd/system/default.target.wants/testing3@zbyszek.service → /etc/systemd/system/testing3@.service.
| * | | shared/install: provide more info if install_info_traverse_failsZbigniew Jędrzejewski-Szmek2016-10-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test case: [Install] WantedBy= default.target Also=foobar-unknown.service Before: $ systemctl --root=/ enable testing2@instance.service Failed to enable: No such file or directory. After $ ./systemctl --root=/ enable testing2@instance.service Failed to enable unit, file foobar-unknown.service: No such file or directory.
| * | | shared/install: in install_context_mark_for_removal ignore not found unitsZbigniew Jędrzejewski-Szmek2016-10-182-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the following test case: [Install] WantedBy= default.target Also=foobar-unknown.service disabling would fail with: $ ./systemctl --root=/ disable testing.service Cannot find unit foobar-unknown.service. # this is level debug Failed to disable: No such file or directory. # this is the error After the change we proceed: $ ./systemctl --root=/ disable testing.service Cannot find unit foobar-unknown.service. Removed /etc/systemd/system/default.target.wants/testing.service. This does not affect specifying a missing unit directly: $ ./systemctl --root=/ disable nosuch.service Failed to disable: No such file or directory.
| * | | shared/install: do not break loop when we enounter a dangling symlinkZbigniew Jędrzejewski-Szmek2016-10-171-1/+1
| | | | | | | | | | | | | | | | We should ignore that unit, but otherwise continue.
* | | | bootctl: don't try to remove esp_path (#4407)Evgeny Vereshchagin2016-10-191-1/+1
| | | | | | | | | | | | This is a follow-up for 9ee051b9c7623
* | | | boot: fix `bootctl install` segfault (#4404)Yu Watanabe2016-10-191-1/+2
| | | |
* | | | Merge pull request #4382 from keszybz/unit-type-underlineLennart Poettering2016-10-182-71/+88
|\ \ \ \ | | | | | | | | | | systemctl: use underlines to seperate unit types in listing
| * | | | terminal-util: helper macro for highlighting functionsZbigniew Jędrzejewski-Szmek2016-10-171-47/+18
| | | | |
| * | | | systemctl: ditto for list-unit-filesZbigniew Jędrzejewski-Szmek2016-10-171-13/+24
| | | | |
| * | | | systemctl: use underlines to seperate unit types in listingZbigniew Jędrzejewski-Szmek2016-10-172-27/+62
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | (printf("%.*s", -1, "…") is the same as not specifying the precision at all.) v2: also underline highlighted (failing) units Fixes #4137.
* | | | networkd: use proper cast to access VTI6 (#4399)Susant Sahani2016-10-171-1/+7
| | | | | | | | | | | | Fixes #4371.
* | | | core/exec: add a named-descriptor option ("fd") for streams (#4179)Luca Bruno2016-10-177-27/+282
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a `fd` option to `StandardInput=`, `StandardOutput=` and `StandardError=` properties in order to connect standard streams to externally named descriptors provided by some socket units. This option looks for a file descriptor named as the corresponding stream. Custom names can be specified, separated by a colon. If multiple name-matches exist, the first matching fd will be used.
* | | Merge pull request #4392 from keszybz/running-timersLennart Poettering2016-10-172-1/+26
|\ \ \ | | | | | | | | Fix for display of elapsed timers
| * | | core/timer: reset next_elapse_*time when timer is not waitingZbigniew Jędrzejewski-Szmek2016-10-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the unit that is triggered by a timer is started and running, we transition to "running" state, and the timer will not elapse again until the unit has finished running. In this state "systemctl list-timers" would display the previously calculated next elapse time, which would now of course be in the past, leading to nonsensical values. Simply set the next elapse to infinity, which causes list-timers to show n/a. We cannot specify when the next elapse will happen, possibly never. Fixes #4031.
| * | | test-calendarspec: test that hourly timers are incremented properlyZbigniew Jędrzejewski-Szmek2016-10-171-1/+24
| |/ / | | | | | | | | | Apparently this works just fine, so the issue in #4031 is elsewhere.
* | | Merge pull request #4387 from keszybz/loginctl-ttyLennart Poettering2016-10-171-23/+67
|\ \ \ | |_|/ |/| | loginctl: print TTY field in the session listing
| * | loginctl: report tty in session listingsZbigniew Jędrzejewski-Szmek2016-10-161-17/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without the tty it's really hard to tell which session is which. New output: $ ./loginctl SESSION UID USER SEAT TTY 13 1002 zbyszek seat0 tty3 c1 42 gdm seat0 /dev/tty1 11 1002 zbyszek seat0 tty4 3 1002 zbyszek seat0 /dev/tty2 17 1002 zbyszek seat0 tty5 18 1002 zbyszek seat0 tty6 6 sessions listed.
| * | loginctl: drop casts in printfZbigniew Jędrzejewski-Szmek2016-10-161-7/+7
| |/
* | pid1: do not use mtime==0 as sign of masking (#4388)Zbigniew Jędrzejewski-Szmek2016-10-171-8/+12
| | | | | | | | | | | | | | It is allowed for unit files to have an mtime==0, so instead of assuming that any file that had mtime==0 was masked, use the load_state to filter masked units. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1384150.
* | tree-wide: introduce free_and_replace helperZbigniew Jędrzejewski-Szmek2016-10-168-42/+20
| | | | | | | | | | | | It's a common pattern, so add a helper for it. A macro is necessary because a function that takes a pointer to a pointer would be type specific, similarly to cleanup functions. Seems better to use a macro.