summaryrefslogtreecommitdiff
path: root/src/core/unit-printf.c
Commit message (Collapse)AuthorAge
* Always check asprintf return codeKarel Zak2014-07-26
| | | | | | | 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.
* Remove unnecessary casts in printfsZbigniew Jędrzejewski-Szmek2014-05-15
| | | | No functional change expected :)
* doc: corrections to words and formsJan Engelhardt2014-05-07
| | | | | This patch exchange words which are inappropriate for a situation, deletes duplicated words, and adds particles where needed.
* core: refuse doing %h, %s, %U specifier resolving in PID 1Lennart Poettering2013-12-16
| | | | | | These specifiers require NSS lookups to work, and we really shouldn't do them from PID 1 hence. With this change they are now only supported for user systemd instance, or when the configured user for a unit is root.
* specifier: rework specifier calls to return proper error messageLennart Poettering2013-09-17
| | | | | | Previously the specifier calls could only indicate OOM by returning NULL. With this change they will return negative errno-style error codes like everything else.
* core: add %v specifierZbigniew Jędrzejewski-Szmek2013-07-19
|
* logind: add infrastructure to keep track of machines, and move to slicesLennart Poettering2013-06-20
| | | | | | | | | | | | | | | | | | | | - This changes all logind cgroup objects to use slice objects rather than fixed croup locations. - logind can now collect minimal information about running VMs/containers. As fixed cgroup locations can no longer be used we need an entity that keeps track of machine cgroups in whatever slice they might be located. Since logind already keeps track of users, sessions and seats this is a trivial addition. - nspawn will now register with logind and pass various bits of metadata along. A new option "--slice=" has been added to place the container in a specific slice. - loginctl gained commands to list, introspect and terminate machines. - user.slice and machine.slice will now be pulled in by logind.service, since only logind.service requires this slice.
* move _cleanup_ attribute in front of the typeHarald Hoyer2013-04-18
| | | | http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
* Simplify the meaning of %sZbigniew Jędrzejewski-Szmek2013-03-26
| | | | | | | | | | | | | | | | | | | The rules governing %s where just too complicated. First of all, looking at $SHELL is dangerous. For systemd --system, it usually wouldn't be set. But it could be set if the admin first started a debug shell, let's say /sbin/sash, and then launched systemd from it. This shouldn't influence how daemons are started later on, so is better ignored. Similar reasoning holds for session mode. Some shells set $SHELL, while other set it only when it wasn't set previously (e.g. zsh). This results in fragility that is better avoided by ignoring $SHELL totally. With $SHELL out of the way, simplify things by saying that %s==/bin/sh for root, and the configured shell otherwise. get_shell() is the only caller, so it can be inlined. Fixes one issue seen with 'make check'.
* install: allow specifiers in WantedBy/RequiredBy/AliasZbigniew Jędrzejewski-Szmek2013-01-29
| | | | | | | | | | | | | | | | | This allows one templated unit to refer to another templated unit at installation time. Examples: > grep WantedBy ~/.config/systemd/user/mpop@.timer WantedBy=services@%i.target > srv disable mpop@iit.timer rm '/home/alxchk/.config/systemd/user/services@iit.target.wants/mpop@iit.timer' > srv enable mpop@iit.timer ln -s '/home/alxchk/.config/systemd/user/mpop@.timer' '/home/alxchk/.config/systemd/user/services@iit.target.wants/mpop@iit.timer' Based-on-patch-by: Oleksii Shevchuk <alxchk@gmail.com>
* core: fix %U when no User= usedZbigniew Jędrzejewski-Szmek2013-01-29
| | | | | When the username was not explicitly specified, both %U and %u would print the username. Make %U always print UID.
* Move generic specifier functions to sharedZbigniew Jędrzejewski-Szmek2013-01-29
| | | | No functional change. This makes it possible to use them in install.c.
* unit: add %U for uids in unitsDaniel Wallace2012-12-19
|
* core: fix %h, %s, %p handling in templates in user sessionOleksii Shevchuk2012-11-15
|
* core: move ManagerRunningAs to sharedZbigniew Jędrzejewski-Szmek2012-09-18
| | | | | | | Note: I did s/MANAGER/SYSTEMD/ everywhere, even though it makes the patch quite verbose. Nevertheless, keeping MANAGER prefix in some places, and SYSTEMD prefix in others would just lead to confusion down the road. Better to rip off the band-aid now.
* unit-printf: add specifiers for the host name, machine id, boot idLennart Poettering2012-09-18
|
* unit-printf: before resolving exec context specifiers check whether the ↵Lennart Poettering2012-09-18
| | | | object actually has an exec context
* unit: split unit_printf() and friends into its own .c fileLennart Poettering2012-09-18