Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 75db342d authored by Yannick Li's avatar Yannick Li
Browse files

Add instructions on starting the c-service as a service

parent a5ab3d5f
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 #213974 failed
......@@ -78,6 +78,29 @@ export DBNAME=my-test-dbname
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
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