unispeech / unimrcp

Open source cross-platform implementation of MRCP protocol
http://www.unimrcp.org
Apache License 2.0
380 stars 167 forks source link

How to configure unimrcpserver as a service on systemd for ubuntu #275

Closed DaniloMurbach closed 4 years ago

DaniloMurbach commented 4 years ago

Hi.

What's the right way to configure unimrcpserver to work properly inside systemd. I've tried to create a service here.

/etc/systemd/system/unimrc.service

With the following content:

[Unit]
Description=Linux Unimrcp server
After=syslog.target network.target
Documentation=https://mrcp.paneas.com/asr/docs/latest

[Service]
Type=simple
StandardOutput=null
StandardError=null
RestartSec=2min
TimeoutStartSec=1min
TimeoutStopSec=30s

ExecStart=/usr/local/unimrcp/bin/unimrcpserver -r /usr/local/unimrcp -o 3 

Restart=on-failure
SuccessExitStatus=0 143
RestartPreventExitStatus=0 143

[Install]
WantedBy=multi-user.target

It works, but it takes a hole vCPU when the service starts and keeps using 100% of 1 vCPU as long as the service is up.

Thanks

achaloyan commented 4 years ago

While installing UniMRCP server binaries from the APT reporitory, the systemd unit file is getting installed as follows. Pay attention to the option -w

cat /lib/systemd/system/unimrcp.service

[Unit] Description=UniMRCP Server After=network.target

[Service] Type=simple ExecStart=/opt/unimrcp/bin/unimrcpserver -r /opt/unimrcp -o 2 -w Restart=on-abort

[Install] WantedBy=multi-user.target

DaniloMurbach commented 4 years ago

Hi Arsen, thanks.

I did this setup like your example, now It is running the way that suposed to.

Best Regards Danilo Murbach