launch/service: unify service_watch_unit() calls
Now that all data is cached on `Service`, we can unify the calls to
service_watch_unit() and move them into service_start().
@@ -616,10 +616,6 @@ static int service_start_unit(Service *service) {
_c_cleanup_(sd_bus_message_unrefp) sd_bus_message *method_call = NULL;
int r;
- r = service_watch_unit(service, service->active_unit);
- if (r)
- return error_trace(r);
-
r = sd_bus_message_new_method_call(launcher->bus_regular, &method_call,
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
@@ -644,10 +640,6 @@ static int service_start_transient_unit(Service *service) {
_c_cleanup_(sd_bus_message_unrefp) sd_bus_message *method_call = NULL;
int r;
- r = service_watch_unit(service, service->active_unit);
- if (r)
- return error_trace(r);
-
r = sd_bus_message_new_method_call(launcher->bus_regular, &method_call,
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
@@ -868,6 +860,10 @@ static int service_start(Service *service) {
if (r)
return error_trace(r);
+ r = service_watch_unit(service, service->active_unit);
+ if (r)
+ return error_trace(r);
+
if (service->is_transient)
r = service_start_transient_unit(service);
else
