summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2014-08-03Unify parse_argv styleZbigniew Jędrzejewski-Szmek
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.
2014-08-03switch-root: umount the old root correctlyDan Dedrick
The unmount occurs after the pivot_root, so the path used to unmount should take into account the new root directory. This will allow the umount to actually succeed.
2014-07-31Always prefer our headers to system headersZbigniew Jędrzejewski-Szmek
In practice this shouldn't make much difference, but sometimes our headers might be newer, and we want to test them.
2014-07-31systemd-analyze verify: improve error messageZbigniew Jędrzejewski-Szmek
There's little sense in telling the user to look at the logs...
2014-07-31core/load-fragment.c: correct argument sign and split up long linesZbigniew Jędrzejewski-Szmek
With everything on one line they are just harder to read.
2014-07-31Properly report invalid quoted stringsZbigniew Jędrzejewski-Szmek
$ systemd-analyze verify trailing-g.service [./trailing-g.service:2] Trailing garbage, ignoring. trailing-g.service lacks ExecStart setting. Refusing. Error: org.freedesktop.systemd1.LoadFailed: Unit trailing-g.service failed to load: Invalid argument. Failed to create trailing-g.service/start: Invalid argument
2014-07-31Reject invalid quoted stringsZbigniew Jędrzejewski-Szmek
String which ended in an unfinished quote were accepted, potentially with bad memory accesses. Reject anything which ends in a unfished quote, or contains non-whitespace characters right after the closing quote. _FOREACH_WORD now returns the invalid character in *state. But this return value is not checked anywhere yet. Also, make 'word' and 'state' variables const pointers, and rename 'w' to 'word' in various places. Things are easier to read if the same name is used consistently. mbiebl_> am I correct that something like this doesn't work mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"' mbiebl_> systemd seems to strip of the quotes mbiebl_> systemctl status shows mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS $RootDir $MountPoint mbiebl_> which is pretty weird
2014-07-29time-util: add and use USEC/NSEC_INFINIYKay Sievers
2014-07-27drop_duplicates: copy full BindMount structAnsgar Burchardt
At least t->ignore = f->ignore; is missing here. Just copy the full struct to be sure.
2014-07-27core: only set the kernel's timezone when the RTC runs in local timeKay Sievers
We can not reliably manage any notion of local time. Every daylight saving time change or time zone change by traveling will make the time jump, and the local time might jump backwards which creates unsolvable problems with file timestamps. We will no longer tell the kernel our local time zone and leave everything set to UTC. This will effectively turn FAT timestamps into UTC timestamps. If and only if the machine is configured to read the RTC in local time mode, the kernel's time zone will be configured, but systemd-timesysnc will disable the kernel's system time to RTC syncing. In this mode, the RTC will not be managed, and external tools like Windows bootups are expected to manage the RTC's time. https://bugs.freedesktop.org/show_bug.cgi?id=81538
2014-07-26Print kdbus path when opening failsZbigniew Jędrzejewski-Szmek
This makes it easier to debug what is going on.
2014-07-26Always check asprintf return codeKarel Zak
There is a small number of the places in sources where we don't check asprintf() return code and assume that after error the function returns NULL pointer via the first argument. That's wrong, after error the content of pointer is undefined.
2014-07-25busname: CLD_KILLED was used twiceLukas Nykryn
2014-07-20systemd-verify: a simple tool for offline unit verificationZbigniew Jędrzejewski-Szmek
This tool will warn about misspelt directives, unknown sections, and non-executable commands. It will also catch the common mistake of using Accept=yes with a non-template unit and vice versa. https://bugs.freedesktop.org/show_bug.cgi?id=56607
2014-07-20path-lookup: make SYSTEMD_UNIT_PATH more flexibleZbigniew Jędrzejewski-Szmek
It can now contain more than one directory, and can be used to only prepend, not totally override, the normal load path.
2014-07-20systemd: return the first error from manager_startup()Zbigniew Jędrzejewski-Szmek
2014-07-20test-engine: fix access to unit load pathZbigniew Jędrzejewski-Szmek
Also add a bit of debugging output to help diagnose problems, add missing units, and simplify cppflags. Move test-engine to normal tests from manual tests, it should now work without destroying the system.
2014-07-20systemd: use pager for --test and --helpZbigniew Jędrzejewski-Szmek
2014-07-18core: show timeouts when watchdog howlsZbigniew Jędrzejewski-Szmek
2014-07-18Be more verbose when bind or listen failsZbigniew Jędrzejewski-Szmek
Also be more verbose in devnode_acl_all().
2014-07-16core: nicer message when inotify watches are exhaustedZbigniew Jędrzejewski-Szmek
inotify_add_watch returns ENOSPC, which translates to "No space left on device", which is misleading. https://bugs.freedesktop.org/show_bug.cgi?id=73628
2014-07-16Let config_parse open file where applicableZbigniew Jędrzejewski-Szmek
Special care is needed so that we get an error message if the file failed to parse, but not when it is missing. To avoid duplicating the same error check in every caller, add an additional 'warn' boolean to tell config_parse whether a message should be issued. This makes things both shorter and more robust wrt. to error reporting.
2014-07-15Constify ConfigTableItem tablesZbigniew Jędrzejewski-Szmek
2014-07-15core: fix oneshot service resource controlUmut Tezduyar Lindskog
Oneshot services's cgroup is removed when the service exits. An assert is hit otherwise.
2014-07-08load-fragment: ConditionFirstBoot wants a bool string, not a pathMichal Schmidt
2014-07-07firstboot: get rid of firstboot generator again, introduce ↵Lennart Poettering
ConditionFirstBoot= instead As Zbigniew pointed out a new ConditionFirstBoot= appears like the nicer way to hook in systemd-firstboot.service on first boots (those with /etc unpopulated), so let's do this, and get rid of the generator again.
2014-07-07service: flush status text and errno values each time a service is startedLennart Poettering
We shouldn't show status texts from previous service starts
2014-07-07service: don't accept negative ERRNO= notification messagesLennart Poettering
2014-07-07service: minor modernizationLennart Poettering
2014-07-07core: Added support for ERRNO NOTIFY_SOCKET message parsing, and added ↵Miguel Angel Ajo
StatusErrno dbus property along StatusText to allow notification of numeric status condition while degraded service operation or any other special situation.
2014-07-07firstboot: add new component to query basic system settings on first boot, ↵Lennart Poettering
or when creating OS images offline A new tool "systemd-firstboot" can be used either interactively on boot, where it will query basic locale, timezone, hostname, root password information and set it. Or it can be used non-interactively from the command line when prepareing disk images for booting. When used non-inertactively the tool can either copy settings from the host, or take settings on the command line. $ systemd-firstboot --root=/path/to/my/new/root --copy-locale --copy-root-password --hostname=waldi The tool will be automatically invoked (interactively) now on first boot if /etc is found unpopulated. This also creates the infrastructure for generators to be notified via an environment variable whether they are running on the first boot, or not.
2014-07-07main: explain our /etc empty check a bit in a commentLennart Poettering
2014-07-04main: change check whether /etc is unpopulated to look for /etc/machine-idLennart Poettering
Previously, we checked whether /etc was completely empty. This makes it difficult though for container managers such as nspawn to install a small number of files (such as /etc/timezone), and have the system otherwise populate its own tree. Hence, change this by looking for /etc/machine-id, which should be a good sign whether /etc is populated or not.
2014-07-03machinectl: show /etc/os-release information of container in status outputLennart Poettering
2014-07-03namespace: make sure /tmp, /var/tmp and /dev are writable in namespaces we ↵Lennart Poettering
set up
2014-07-03namespace: fix uninitialized memory accessLennart Poettering
2014-07-03core: introduce exit_status_set_is_empty() to make things a bit easier to readLennart Poettering
2014-07-03exit-status: rename ExitStatusSet's "code" field to "status"Lennart Poettering
We should follow the naming scheme waitid() uses, not come up with our own reversed one...
2014-07-03core: introduce new RestartForceExitStatus= service settingLennart Poettering
This does the inverse of RestartPreventExitStatus=: it forces a restart of a service when a certain exit status is returned by a service process.
2014-06-30cryptsetup: allow x-systemd.device-timeoutZbigniew Jędrzejewski-Szmek
https://bugs.freedesktop.org/show_bug.cgi?id=54210
2014-06-30Move x-systemd-device.timeout handling from core to fstab-generatorZbigniew Jędrzejewski-Szmek
Instead of adjusting job timeouts in the core, let fstab-generator write out a dropin snippet with the appropriate JobTimeout. x-systemd-device.timeout option is removed from Options= line in the generated unit. The functions to write dropins are moved from core/unit.c to shared/dropin.c, to make them available outside of core. generator.c is moved to libsystemd-label, because it now uses functions defined in dropin.c, which are in libsystemd-label.
2014-06-30pc: no longer expose exec_prefix in .pc fileLennart Poettering
There's little reason to export this, so let's drop it to minimize the file a bit.
2014-06-30pc: expose more drop-in dirs in the .pc fileLennart Poettering
2014-06-30pc: export $libdir in the .pc fileLennart Poettering
This is useful for code that tries to figure out the primary arch's $libdir on the local system, given that is different on the various Linuxes.
2014-06-28doc: grammatical correctionsJan Engelhardt
2014-06-27main: uid_to_name() might fail due to OOM, protect against thatLennart Poettering
2014-06-26timer: name the stamp file consistentlyMichał Bartoszkiewicz
The stamp file for systemd --user timers was named stamp-foo.timer if XDG_DATA_HOME was unset, but foo.timer otherwise.
2014-06-26core/transaction: fix cycle break attempts outside transactionUoti Urpala
Patch fixes some incorrect-looking code in transaction.c. It could fix cases where Debian users with bad package configurations had systemd go into an infinite loop printing messages about breaking an ordering cycle, though I have not reproduced that problem myself. transaction_verify_order_one() considers jobs/units outside current transaction when checking whether ordering dependencies cause cycles. It would also incorrectly try to break cycles at these jobs; this cannot work, as the break action is to remove the job from the transaction, which is a no-op if the job isn't part of the transaction to begin with. The unit_matters_to_anchor() test also looks like it would not work correctly for non-transaction jobs. Add a check to verify that the unit is part of the transaction before considering a job a candidate for deletion. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752259
2014-06-26core: Don't require cgroups xattr supportTom Hirst
Failure to mount cgroups with xattr should not be fatal
2014-06-26core: use correct format string for UIDsMichał Bartoszkiewicz