If I can suggest, keep it simple.
if the service is disable :
enable start if stopped upgrade stop if was stopped disable
User will find package upgraded but in the same state as he left it.
If it's enabled, just check before if the service is loaded and upgrade.
I think it's important to give users an updated package, ready to use, as he left it.
Thanks for your work!
If I can suggest, keep it simple.
if the service is disable :
enable
start if stopped
upgrade
stop if was stopped
disable
User will find package upgraded but in the same state as he left it.
If it's enabled, just check before if the service is loaded and upgrade.
I think it's important to give users an updated package, ready to use, as he left it.
Thanks for your work!