-
Notifications
You must be signed in to change notification settings - Fork 302
Conversation
Hi and thanks for your attention. So maybe it is too early to work on this for fleet? If you have further insights regarding the future of |
@hmalphettes at a guess, your Aside from that, I have no idea whether the approach is fundamentally feasible. |
@@ -81,6 +81,7 @@ func main() { | |||
cfgset.String("metadata", "", "List of key-value metadata to assign to the fleet machine") | |||
cfgset.String("agent_ttl", agent.DefaultTTL, "TTL in seconds of fleet machine state in etcd") | |||
cfgset.String("units_directory", "/run/fleet/units/", "Path to the fleet units directory") | |||
cfgset.Bool("systemd_system", true, "When false use systemd --user)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not the other way around? I hope it's not just me -- but this looks kinda backwards...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! Thanks for the review!
Fixed here: ade6154
and edited the issue description too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could just squash this into the previous commit, if it's not too much trouble?... If we all agree it's better this way around, there is no need to have the extra churn in permanent history :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! Done.
b3b76da
to
ade6154
Compare
I actually like how simple/clean this patch is, but yeah, might be worth being a little more certain about the future of --user before committing to it. Could you ask systemd-devel upstream? |
ade6154
to
91b35a8
Compare
@jonboulle I did ask the systemd-devel upstream on bugzilla and here is the response from Lukáš Nykrýn:
https://bugzilla.redhat.com/show_bug.cgi?id=1198655#c4 I'll try some other avenues to get more info then. @antrik I did not take the time to test with an absolute path for the |
@hmalphettes I was actually referring to systemd-devel (or the GitHub project) - the bugzilla is just for RH, not really upstream. |
systemd --user
systemd --user
@jonboulle here we go: https://lists.freedesktop.org/archives/systemd-devel/2016-March/036091.html |
Let's punt this until we see what they say. |
Sorry for the noise - didn't get the subject of this thread properly :) |
So far 2 answers on the mailing list of downstream adopters who are interested: I also went on IRC to get this idea reviewed. None of the systemd-devs pitched in. Apologies, I can't find the logs. I'll keep waving my arms and asking questions when the opportunity shows up. |
@jonboulle I can't make it to Berlin for CoreOS Fest. But some of you will be there and Systemd's own Lennart will be too. will it be possible to relay then question then? |
+1 for this PR. |
How about logind and maybe startups without user login |
I strongly believe that using |
23d4b13
to
6fb1256
Compare
@hmalphettes gentle ping. |
@dongsupark thanks for the reminder and cheers to that! |
c97499e
to
711d073
Compare
@@ -35,7 +35,7 @@ func TestSystemdUnitFlow(t *testing.T) { | |||
} | |||
defer os.RemoveAll(uDir) | |||
|
|||
mgr, err := systemd.NewSystemdUnitManager(uDir) | |||
mgr, err := systemd.NewSystemdUnitManager(uDir, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dongsupark Fixed functional/systemd_test.go
here.
Thanks again for the reminder!
@hmalphettes Thanks. LGTM. |
54409ab
to
a1a21b8
Compare
@dongsupark OK, I'll rewrite the commit messages. |
@dongsupark Sorry I had missed https://github.com/coreos/fleet/blob/master/CONTRIBUTING.md#format-of-the-commit-message Thanks again for the review. |
@dongsupark One thing that worries me when reading this PR: the initial description suggests a value for the May I edit the initial description and replace |
The default location of the units directory for fleet is owned by root. When we use `systemd --user` we want this directory to be owned by a different user. Fixes coreos#1393
systemd offers users the ability to manage services under the user's control with a per-user systemd instance. This parameter enables fleet to target such instance of systemd. Fixes coreos#1393
7f8bc58
to
9b83262
Compare
@hmalphettes LGTM. |
@dongsupark ok. Edited. Cheers! |
Support for targeting `systemd --user`
@@ -64,6 +60,13 @@ func NewSystemdUnitManager(uDir string) (*systemdUnitManager, error) { | |||
return &mgr, nil | |||
} | |||
|
|||
func createDbusConnection(systemdUser bool) (*dbus.Conn, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indirection of this function seems unnecessary - I'd just inline the conditional into NewSystemdUnitManager
Let's get dbus connection directly inside NewSystemdUnitManager, instead of calling a separate function createDbusConnection(). Suggested by @jonboulle. See coreos#1393 (comment)
Let's get dbus connection directly inside NewSystemdUnitManager, instead of calling a separate function createDbusConnection(). Suggested by @jonboulle. See coreos#1393 (comment)
Hi! I am looking at using fleet to manage a handful of machines with ssh access but without root access.
It might be a far shot or a misguided idea: please let me know if this is a dead-end.
If this is interesting I added 2 options to fleetd's configuration file to support that:
On archlinux, I can deploy
example/hello.service
but I getAgentReconciler task failed: type=LoadUnit job=hello.service reason="unit scheduled here but not loaded" err=No such file or directory
.Some debugging shows that it comes from dbus's call to
LinkUnitFiles
; I have not figured out which folder it tries to link into yet.Thanks for your attention.