-
Notifications
You must be signed in to change notification settings - Fork 302
How to update unit? (question related to fleetctl) #914
Comments
@ernado It seems like you've answered your own question. What would you prefer to see? |
@bcwaldon fleetctl upgrade stun.service
# or
fleetctl submit stun.service --force to make it with one command and/or some related docs. Or error instead of warning. Currently it feels like unit gets updated. |
Was there some out-of-band resolution on this request/question? Right now I'm developing a few systemd units. It's really painful to have to go through the "destroy, stop, load, start" cycle over and over. A fleetctl command that facilitates a quicker edit/run cycle would be very useful. I've tried writing a single command that chains together a sequence of fleetctrl commands, but it seems they run too quickly and commands after "destroy" don't seem to take effect. Surely Fleet/CoreOS devs have a better cycle than this when developing unit files... right? |
Maybe it is not very common use-case and CoreOS team think that full cycle of "destroy, submit, start" is acceptable. @lamielle, I've described the desired behavior of offered command "upgrade". |
Given that Fleet explicitly doesn't support "rolling upgrades" I wonder if naming the command 'upgrade' will be contentious? Additionally, I'm all for keeping tools like fleetctl simple, so adding one more top level command may not be desirable by the Fleet team. Maybe a flag to one of the existing commands (like @ernado suggests) would be better. It would be nice to hear from @bcwaldon about the following problem. If it is simply a bug in the client then addressing this issue would satisfy my dev workflow needs AND add no additional complexity to the fleetctl too:
Just being able to "chain" the fleetctl commands using shell && operators would address my biggest complaint. Sure, a built-in command would be nice, but it seems addressing this problem with the tool might be a good first step. @ernado would this approach help you out at all? |
@lamielle, it would be nice to somehow "chain" commands, ie run them synchronously. I'm pretty sure it will help in our use-case. |
You may be right: the fleetctl is probably not running these synchronously and that may be the core issue with this. Which, to me, indicates a problem with the system as a whole: I would think that, if a client submits requests very quickly to the fleet daemon, that they would queue up and execute one-by-one on the host running the daemon. The results I see when chaining produce no logs (via journalctl -f) on the host related to fleet/systemd. But at this point I'm speculating on how fleet works under the hood. As for a new command, what about "fleetctl restart --update "? This says "restart the specified unit AND since you passed --update, the client will destroy/submit the unit as well". Without the --update flag, fleetctl would ONLY stop/start the unit. The unit itself would not be destroyed and re-submitted. I like this approach since it supports two use cases with a single top level command. So you can both restart AND update the unit+restart. What do you think, @ernado? |
@lamielle To address your issue with incorrect behavior of While I'm more than happy to support what users actually want to do, we need to do it the correct way. Simply making |
@lamielle ...and @jonboulle just pointed out to me that |
Running into this issue myself. I consider the ability to update unit files without service interruption to be fairly critical. This is type of action is fully supported by systemd. It's only fleet which prevents it. |
@phemmer can you explain how fleet is preventing it? Essentially, you can achieve what you want today with the following, right?
|
@jonboulle Yes, one can use the above example to achieve what @phemmer is trying to do. The issue I have is that sometimes |
Sometimes I am unable to |
@ernado Yeah, that's a slightly separate issue related to what We have been kicking around some ideas about clarifying this and perhaps tweaking the behaviour slightly to make it more intuitive - I thought there were some issues but perhaps not yet /cc @bcwaldon |
@jonboulle
And updated docs. Is it ok to keep this issue opened? |
@ernado I agree, that's something we need to clear up too. Let's leave it open at least until we're confident we have other issues to track the next steps. |
fleetctl submit -f (or fleetctl start -f) would be great to update existing unit.. |
What should fleet do in this case? Restart service? |
would refresh the unit file and restart the unit.. it would send the updated unit file (including template) and then restart the unit. when debugging startup of units it's very common to do fleetctl destroy web@1 && fleet submit web@1 && fleet start web@1 (to avoid the WARNING: Unit web@.service in registry differs from local unit file web@.service) |
I wrote a shell script that does the trick for me.
Save the script with |
See #760 |
what if i want to update the unit file but don't want to restart the service? Could be there are dependencies and i only want to update the unit file for the next reboot |
For example, when I run
I expect that unit will be updated, but it stays the same version.
Currently I reached the desired effect with
The text was updated successfully, but these errors were encountered: