It seems that systemd-run does not start the process in the specified slice
when starting a transient scope instead of a service.


I have created a test.slice, and started it:

       # systemctl status test.slice
       ● test.slice - Test slice
          Loaded: loaded (/usr/lib/systemd/system/test.slice; static;
vendor preset: disabled)
          Active: active since Tue 2016-04-05 16:50:26 EDT; 2min 27s ago
          Memory: 0B

       Apr 05 16:50:26 abrand04 systemd[1]: Created slice Test slice.
       Apr 05 16:50:26 abrand04 systemd[1]: Starting Test slice.

When running a process using systemd-run,

       # systemd-run --scope --slice=test --unit=test sleep 60 &
       [1] 52359
       # Running scope as unit test.scope.


the process is placed in the system.slice instead of the test.slice as
specified in the systemd-run command.

       # systemctl status test.scope
       ● test.scope - /usr/bin/sleep 60
          Loaded: loaded (/run/systemd/system/test.scope; static; vendor
preset: disabled)
         Drop-In: /run/systemd/system/test.scope.d
                  └─50-Description.conf
          Active: active (running) since Tue 2016-04-05 16:56:04 EDT; 11s
ago
          Memory: 92.0K
          CGroup: /system.slice/test.scope
                  └─52359 /usr/bin/sleep 60

       Apr 05 16:56:04 abrand04 systemd[1]: Started /usr/bin/sleep 60.
       Apr 05 16:56:04 abrand04 systemd[1]: Starting /usr/bin/sleep 60.


I am running the latest version of CentOS 7, which ships systemd 219. A
quick scan of the run.c history in github made it seem like there have been
no changes since the introduction of this feature. Am I doing something
wrong here? When starting the process as a service, and not a transient
scope, the process is correctly placed in the specified slice.


Thanks,


Alexander Brand
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to