On Fri, May 27, 2016 at 8:28 AM, Andrew Lutomirski <luto(a)mit.edu> wrote:
Either the scope code is buggy or has IMO very strange behavior:
$ systemd-run --user --scope echo foo
Running scope as unit run-4980.scope.
$ systemctl --user status run-4980.scope
● run-4980.scope - /usr/bin/echo foo
Loaded: loaded (/run/user/1000/systemd/user/run-4980.scope; static;
vendor preset: enabled)
Active: active (running) since Fri 2016-05-27 08:16:03 PDT; 14s ago
I played with this a bit. At least for now, I can get useful behavior
$ systemd-run --user --service-type=forking /bin/bash -c "/bin/sleep 20 &"
Running as unit run-7737.service.
The service will continue to exist until the whole process tree goes
away. Shouldn't this be the *default* for --scope (and for tmux,
screen, and nohup)?
Also, ISTM someone (systemd?) should supply a really simple DSO that
programs can use to indicate their desire to create a long-running
process tree like this.