Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 81fb9104 authored by Florent Coriat's avatar Florent Coriat
Browse files

Merge branch '46-provide-systemd-config-file-to-run-c-service-as-a-service' into 'dev'

Resolve "Provide systemd config file to run c-service as a service"

Closes #46

See merge request !44
parents e4356c35 75db342d
No related branches found
No related tags found
2 merge requests!48Release v1.1.4,!44Resolve "Provide systemd config file to run c-service as a service"
Pipeline #216923 failed
...@@ -78,6 +78,29 @@ export DBNAME=my-test-dbname ...@@ -78,6 +78,29 @@ export DBNAME=my-test-dbname
npm test npm test
``` ```
### Setup C-Service as a Systemd service
Before starting C-Service, ensure CouchDB is running as a systemd service named "couchdb.service" or adapt the name in c-service.service file.
Put the c-service folder in /opt/ or adapt the c-service.service file.
Put the provided file c-service.service in the repository /etc/systemd/system/.
Create the file /etc/systemd/system/c-service.conf containing:
```shell
COUCHDB_USER=<couchdb_id>
COUCHDB_PASSWORD=<couchdb_password>
```
(replace <couchdb_id> and <couchdb_pass> with a CouchDB admin username and password)
Start the service :
```shell
systemctl start c-service
```
### Test C-Service using curl ### Test C-Service using curl
The C-Service exposes a REST API on `/api`, The C-Service exposes a REST API on `/api`,
......
[Unit]
Description=Concordant Service
Wants=couchdb.service
After=network.target couchdb.service
[Service]
WorkingDirectory=/opt/c-service
EnvironmentFile=/etc/systemd/system/c-service.conf
ExecStart=/usr/bin/npm start
Restart=on-failure
[Install]
WantedBy=multi-user.target
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment