From d9fbad6a6bbba292f31fe50e57af893062c7a584 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Sat, 23 May 2020 07:33:47 +0100 Subject: systemd: T2494: use Type=notify with daemon Notify systemd via the notify API when the python daemon are ready to take connection https://github.com/torfsen/python-systemd-tutorial --- src/systemd/vyos-http-api.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/systemd/vyos-http-api.service') diff --git a/src/systemd/vyos-http-api.service b/src/systemd/vyos-http-api.service index 4fa68b4ff..636973be7 100644 --- a/src/systemd/vyos-http-api.service +++ b/src/systemd/vyos-http-api.service @@ -6,7 +6,7 @@ Requires=vyos-router.service [Service] ExecStartPre=/usr/libexec/vyos/init/vyos-config ExecStart=/usr/bin/python3 -u /usr/libexec/vyos/services/vyos-http-api-server -Type=idle +Type=notify KillMode=process SyslogIdentifier=vyos-http-api -- cgit v1.2.3 From 8d50cb7a4044049b8287ce9b076fbc6b7bb1cfef Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Sat, 23 May 2020 07:52:31 +0100 Subject: http-api: T2494: remove inaccurate systemd comment --- src/systemd/vyos-http-api.service | 1 - 1 file changed, 1 deletion(-) (limited to 'src/systemd/vyos-http-api.service') diff --git a/src/systemd/vyos-http-api.service b/src/systemd/vyos-http-api.service index 636973be7..e336ed18b 100644 --- a/src/systemd/vyos-http-api.service +++ b/src/systemd/vyos-http-api.service @@ -14,7 +14,6 @@ SyslogFacility=daemon Restart=on-failure -# Does't work but leave it here User=root Group=vyattacfg -- cgit v1.2.3 From 1ecb1d76cd0b149d6381a143adc9907adee47607 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Sat, 23 May 2020 09:05:43 +0100 Subject: http-api: T2494: remove "barrier" PreExec The PreExec is making sure that the vyos-config-status file exists and blocks until it does. This file is created on boot completion and I can see no reason why the http service has to wait for the end of boot to start. Any barrier to start should be done with systemd itself. --- src/systemd/vyos-http-api.service | 1 - 1 file changed, 1 deletion(-) (limited to 'src/systemd/vyos-http-api.service') diff --git a/src/systemd/vyos-http-api.service b/src/systemd/vyos-http-api.service index e336ed18b..a2920376e 100644 --- a/src/systemd/vyos-http-api.service +++ b/src/systemd/vyos-http-api.service @@ -4,7 +4,6 @@ After=auditd.service systemd-user-sessions.service time-sync.target vyos-router. Requires=vyos-router.service [Service] -ExecStartPre=/usr/libexec/vyos/init/vyos-config ExecStart=/usr/bin/python3 -u /usr/libexec/vyos/services/vyos-http-api-server Type=notify KillMode=process -- cgit v1.2.3 From 8cd23ec0449b3755240b9aebe236fdb66937d7d6 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Sat, 23 May 2020 15:02:47 +0100 Subject: http-api: T2494: systemd http-api has no link getty.target WantedBy is about the service installation and is not related to the boot order, linking to vyos.target instead --- src/systemd/vyos-http-api.service | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/systemd/vyos-http-api.service') diff --git a/src/systemd/vyos-http-api.service b/src/systemd/vyos-http-api.service index a2920376e..74a97d193 100644 --- a/src/systemd/vyos-http-api.service +++ b/src/systemd/vyos-http-api.service @@ -17,6 +17,4 @@ User=root Group=vyattacfg [Install] -# Installing in a earlier target leaves ExecStartPre waiting -WantedBy=getty.target - +WantedBy=vyos.target -- cgit v1.2.3