summaryrefslogtreecommitdiff
path: root/src/run
Commit message (Collapse)AuthorAge
* nspawn: when connected to pipes for stdin/stdout, pass them as-is to PID 1Lennart Poettering2015-02-18
| | | | | | | | | | | Previously we always invoked the container PID 1 on /dev/console of the container. With this change we do so only if nspawn was invoked interactively (i.e. its stdin/stdout was connected to a TTY). In all other cases we directly pass through the fds unmodified. This has the benefit that nspawn can be added into shell pipelines. https://bugs.freedesktop.org/show_bug.cgi?id=87732
* run: if we fail to set a property assignment then really failLennart Poettering2015-02-18
|
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-03
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* notify,firstboot,analyze,run: trim --help output to 80 linesZbigniew Jędrzejewski-Szmek2015-01-27
|
* machinectl: make sure that "machinectl login" exits immediately when the ↵Lennart Poettering2015-01-07
| | | | machine it is connected to dies
* run: uninitialized variableZbigniew Jędrzejewski-Szmek2014-12-25
|
* sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()Lennart Poettering2014-12-24
| | | | | | | Pretty much everywhere else we use the generic term "machine" when referring to containers in API, so let's do though in sd-bus too. In particular, since the concept of a "container" exists in sd-bus too, but as part of the marshalling system.
* systemd-run: support -t mode when combined with -MLennart Poettering2014-12-23
| | | | For that, ask machined for a container PTY and use that.
* systemd-run: add --quiet mode to suppress informational message on TTY usageLennart Poettering2014-12-23
|
* run: add a new "-t" mode for invoking a binary on an allocated TTYLennart Poettering2014-12-23
|
* run: introduce timer support optionWaLyong Cho2014-12-09
| | | | | | | | | | | | | Support timer options --on-active=, --on-boot=, --on-startup=, --on-unit-active=, --on-unit-inactive=, --on-calendar=. Each options corresponding with OnActiveSec=, OnBootSec=, OnStartupSec=, OnUnitActiveSec=, OnUnitInactiveSec=, OnCalendar= of timer respectively. And OnCalendar= and WakeSystem= supported by --timer-property= option like --property= of systemd-run. And if --unit= option and timer options are specified the command can be omitted. In this case, systemd-run assumes the target service is already loaded. And just try to generate transient timer unit only.
* treewide: another round of simplificationsMichal Schmidt2014-11-28
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | 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.
* treewide: yet more log_*_errno + return simplificationsMichal Schmidt2014-11-28
| | | | | | | | | | | | | Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
* treewide: more log_*_errno() conversions, multiline callsMichal Schmidt2014-11-28
| | | | | | | | | | | | Basically: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \ $f; done Plus manual indentation fixups.
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | 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().
* Do not check for existence of remote binariesZbigniew Jędrzejewski-Szmek2014-11-22
| | | | | | | | | | | | | | systemd-run would fail when run with -M or -H and an absolute path, if this path did not exists locally. Allow it to continue, since we don't have a nice way of checking if the binary exists remotely. The case where -M or -H is used and a local path is unchanged, and we still iterate over $PATH to find the binary. We need to convert to an absolute path, and we don't have a nice mechanism to check remotely, so we assume that the binary will be located in the same place locally and remotely. http://lists.freedesktop.org/archives/systemd-devel/2014-November/025418.html
* bus: always explicitly close bus from main programsLennart Poettering2014-08-04
| | | | | | | | | | | | | | Since b5eca3a2059f9399d1dc52cbcf9698674c4b1cf0 we don't attempt to GC busses anymore when unsent messages remain that keep their reference, when they otherwise are not referenced anymore. This means that if we explicitly want connections to go away, we need to close them. With this change we will no do so explicitly wherver we connect to the bus from a main program (and thus know when the bus connection should go away), or when we create a private bus connection, that really should go away after our use. This fixes connection leaks in the NSS and PAM modules.
* Unify parse_argv styleZbigniew Jędrzejewski-Szmek2014-08-03
| | | | | | | | | | | | | | | | 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.
* 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.
* analyze/run: use bus_open_transport_systemd instead of bus_open_transportThomas Bächler2014-05-26
| | | | | | | | | Both systemd-analyze and systemd-run only access org.freedesktop.systemd1 on the bus. This patch allows using systemd-run --user and systemd-analyze --user even if the user session's bus is not properly integrated with the systemd user unit. https://bugs.freedesktop.org/show_bug.cgi?id=79252 and other reports...
* Remove unnecessary casts in printfsZbigniew Jędrzejewski-Szmek2014-05-15
| | | | No functional change expected :)
* systemd-run: don't print error messages twiceLennart Poettering2014-03-05
|
* systemd-run: make sure --nice=, --uid=, --gid=, --setenv= also work in ↵Lennart Poettering2014-03-05
| | | | --scope mode
* systemd-run: add some extra safety checksLennart Poettering2014-03-05
|
* systemd-run: add new --property= switch that can set arbitrary properties ↵Lennart Poettering2014-03-05
| | | | | | | | for the unit that is created The code for parsing these properties is shared with "systemctl set-property", which means all the resource control settings are immediately available.
* api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering2014-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | first (or second) Previously the returned object of constructor functions where sometimes returned as last, sometimes as first and sometimes as second parameter. Let's clean this up a bit. Here are the new rules: 1. The object the new object is derived from is put first, if there is any 2. The object we are creating will be returned in the next arguments 3. This is followed by any additional arguments Rationale: For functions that operate on an object we always put that object first. Constructors should probably not be too different in this regard. Also, if the additional parameters might want to use varargs which suggests to put them last. Note that this new scheme only applies to constructor functions, not to all other functions. We do give a lot of freedom for those. Note that this commit only changes the order of the new functions we added, for old ones we accept the wrong order and leave it like that.
* nspawn: add --quiet switch for turning off any output noiseLennart Poettering2014-02-06
|
* core: allow User=, Group=, Nice=, Environment=, Type= to be passed when ↵Lennart Poettering2014-02-05
| | | | creating a transient service
* run: drop mistakenly committed test codeLennart Poettering2014-01-31
|
* core: introduce new stop protocol for unit scopesLennart Poettering2014-01-31
| | | | | | | | | By specifiy a Controller property when creating the scope a client can specify a bus name that will be notified with a RequestStop bus signal when the scope has been asked to shut down, instead of sending SIGTERM to the scope processes themselves. https://bugzilla.redhat.com/show_bug.cgi?id=1032695
* Use enums to make it obvious what boolean params meanZbigniew Jędrzejewski-Szmek2013-12-26
| | | | Suggested-by: Russ Allbery <rra@debian.org>
* systemctl: allow globbing in commands which take multiple unit namesZbigniew Jędrzejewski-Szmek2013-12-26
|
* logind,machined,run: properly invoke StartTransientUnit() bus callLennart Poettering2013-11-21
|
* bus: rename sd_bus_send_with_reply_and_block() to sd_bus_call()Lennart Poettering2013-11-12
| | | | | | The call is one of the most important ones we expose, where we place major emphasis on. We should make sure to give it a short, memorable name.
* bus: port remaining code over to use bus_error_message()Lennart Poettering2013-11-08
|
* localectl: port over to bus_log_create_error()Lennart Poettering2013-11-08
|
* clients: unify how we invoke getopt_long()Lennart Poettering2013-11-06
| | | | | Among other things this makes sure we always expose a --version command and show it in the help texts.
* run: support --system to match other commands, even if redundantLennart Poettering2013-11-06
|
* run: add support for executing commands remotely via SSH or in a containerLennart Poettering2013-10-30
| | | | | Also, unify the transport logic a bit, since we reuse the same scheme in many of our client tools.
* timedated: use libsystemd-bus instead of libdbus for bus communicationLennart Poettering2013-10-16
| | | | | | | | | | | | | | | Among other things this also adds a few things necessary for the change: - Considerably more powerful error returning APIs in libsystemd-bus - Adapter for connecting an sd_bus to an sd_event - As I reworked the PolicyKit logic to the new library I also made it asynchronous, so that PolicyKit requests of one user cannot block out another user anymore. - We always use the macro names for common bus error. That way it is harder to mistype them since the compiler will notice
* Fix two compiler warningsZbigniew Jędrzejewski-Szmek2013-09-09
|
* run: allow non-absolute paths as commandZbigniew Jędrzejewski-Szmek2013-09-09
|
* core: open up SendSIGHUP property for transient unitsLennart Poettering2013-07-30
|
* core: allow setting RemainAfterExit= for transient servicesLennart Poettering2013-07-26
|
* man: extend systemd-run man page a littleLennart Poettering2013-07-19
|
* core: add support to run transient units in arbitrary slicesLennart Poettering2013-07-01
|
* core: allow setting of the description string for transient unitsLennart Poettering2013-07-01
|
* core: add new "scope" unit type for making a unit of pre-existing processesLennart Poettering2013-07-01
| | | | | | | | | | | | | | | | | "Scope" units are very much like service units, however with the difference that they are created from pre-existing processes, rather than processes that systemd itself forks off. This means they are generated programmatically via the bus API as transient units rather than from static configuration read from disk. Also, they do not provide execution-time parameters, as at the time systemd adds the processes to the scope unit they already exist and the parameters cannot be applied anymore. The primary benefit of this new unit type is to create arbitrary cgroups for worker-processes forked off an existing service. This commit also adds a a new mode to "systemd-run" to run the specified processes in a scope rather then a transient service.