From fc2cc0f9b660408d5fc0cffcaffc33bfbc8ca5f2 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 16 Jun 2019 21:26:38 +0200 Subject: T1431: initial implementation of the HTTP API. --- src/systemd/vyos-http-api.service | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/systemd/vyos-http-api.service (limited to 'src/systemd') diff --git a/src/systemd/vyos-http-api.service b/src/systemd/vyos-http-api.service new file mode 100644 index 000000000..f0665e3d5 --- /dev/null +++ b/src/systemd/vyos-http-api.service @@ -0,0 +1,16 @@ +[Unit] +Description=VyOS HTTP API service +After=auditd.service systemd-user-sessions.service time-sync.target + +[Service] +ExecStart=/usr/libexec/vyos/services/vyos-http-api-server +ExecReload=/bin/kill -TERM $MAINPID +KillMode=process + +# Does't work but leave it here +User=root +Group=vyattacfg + +[Install] +WantedBy=multi-user.target + -- cgit v1.2.3 From 2c12af330c51468927df3e85ca23aaf9098ff4f8 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 17 Jun 2019 14:04:58 +0200 Subject: T1431: Fix vyos-http-server logging to journald. --- src/systemd/vyos-http-api.service | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/systemd') diff --git a/src/systemd/vyos-http-api.service b/src/systemd/vyos-http-api.service index f0665e3d5..53322a84f 100644 --- a/src/systemd/vyos-http-api.service +++ b/src/systemd/vyos-http-api.service @@ -3,10 +3,12 @@ Description=VyOS HTTP API service After=auditd.service systemd-user-sessions.service time-sync.target [Service] -ExecStart=/usr/libexec/vyos/services/vyos-http-api-server -ExecReload=/bin/kill -TERM $MAINPID +ExecStart=/usr/bin/python3 -u /usr/libexec/vyos/services/vyos-http-api-server KillMode=process +SyslogIdentifier=vyos-http-api +SyslogFacility=daemon + # Does't work but leave it here User=root Group=vyattacfg -- cgit v1.2.3 From 62822413b20a82c4738897c16d3120c04fbf27d6 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 17 Jun 2019 19:58:29 +0200 Subject: [HTTP API] T1431: make systemd restart the HTTP API service on failure. --- src/systemd/vyos-http-api.service | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/systemd') diff --git a/src/systemd/vyos-http-api.service b/src/systemd/vyos-http-api.service index 53322a84f..509af4816 100644 --- a/src/systemd/vyos-http-api.service +++ b/src/systemd/vyos-http-api.service @@ -9,6 +9,8 @@ KillMode=process SyslogIdentifier=vyos-http-api SyslogFacility=daemon +Restart=on-failure + # Does't work but leave it here User=root Group=vyattacfg -- cgit v1.2.3 From 2abd3cf50c6fedf79ce0f01337ef8bb1eb44116e Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Mon, 1 Jul 2019 13:44:34 -0500 Subject: [HTTP API] T1431: check init/vyos-config before starting HTTP API service --- src/systemd/vyos-http-api.service | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/systemd') diff --git a/src/systemd/vyos-http-api.service b/src/systemd/vyos-http-api.service index 509af4816..4fa68b4ff 100644 --- a/src/systemd/vyos-http-api.service +++ b/src/systemd/vyos-http-api.service @@ -1,9 +1,12 @@ [Unit] Description=VyOS HTTP API service -After=auditd.service systemd-user-sessions.service time-sync.target +After=auditd.service systemd-user-sessions.service time-sync.target vyos-router.service +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 KillMode=process SyslogIdentifier=vyos-http-api @@ -16,5 +19,6 @@ User=root Group=vyattacfg [Install] -WantedBy=multi-user.target +# Installing in a earlier target leaves ExecStartPre waiting +WantedBy=getty.target -- cgit v1.2.3