Bug 90897 - systemctl fails with "Invalid argument" when using both --global and --root flags
Summary: systemctl fails with "Invalid argument" when using both --global and --root f...
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-08 13:34 UTC by Pau Espin Pedrol
Modified: 2016-06-18 17:40 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Pau Espin Pedrol 2015-06-08 13:34:36 UTC
I am trying to run systemctl from a script to enable some systemd user session services inside a sysroot which is going to be used by an embedded system later.

I found out, though, that when I run systemctl with both --global (to specify I want to enable a user systemd service) and --root (to specify the sysroot of the target system) parameters, I just get an error. For instance, it can easily be checked like this:

# systemctl --global enable myapp.service
ln -s '/usr/lib/systemd/user/myapp.service' '/etc/systemd/user/default.target.wants/myapp.service'

# systemctl --global --root=/ enable myapp.service
Operation failed: Invalid argument


Is that a bug or an expected behavior? how should I accomplish what I want to do if that's expected?


More information:
~# systemctl --version
systemd 211
+PAM +LIBWRAP -AUDIT -SELINUX +IMA +SYSVINIT -LIBCRYPTSETUP -GCRYPT +ACL +XZ -SECCOMP -APPARMOR
Comment 1 Lennart Poettering 2016-06-09 18:15:14 UTC
This works fine with v230. Closing.
Comment 2 Pau Espin Pedrol 2016-06-18 17:40:59 UTC
I confirm this is fixed for me now too. I'm using systemctl version 229.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.