Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run as a service on UNIX machine #159

Closed
ghost opened this issue Jul 19, 2019 · 7 comments
Closed

Run as a service on UNIX machine #159

ghost opened this issue Jul 19, 2019 · 7 comments

Comments

@ghost
Copy link

ghost commented Jul 19, 2019

Is it possible to run Sonic as system service? In that case, would I be able to append the logs to a ReadWriteFolder instead of the console?

@valeriansaliou
Copy link
Owner

Would that involve running Sonic as root, or is it something else I'm unaware of?

@ghost
Copy link
Author

ghost commented Jul 19, 2019

Don't think you need to run Sonic as root. The purpose is to write a service file to handle the start/restart/stop of Sonic as well as its configuration, in a similar way you can enable Redis as a service. I am not an expert myself in Unix so not sure if what I am saying right now is a kind of idiocy, but as I am trying to use this software together with Laravel, that would be very handy.

@valeriansaliou
Copy link
Owner

Here you go, this is the systemd service we use at Crisp to run Sonic (under user sonic + group sonic): https://github.com/valeriansaliou/sonic/blob/master/examples/config/systemd.service

@ghost
Copy link
Author

ghost commented Jul 24, 2019

Is strange, I added the service file as you post it to my local machine. However sonic is not recognized as a service.

Being the content of the file similar to yours, I added it to the system folder (under the path /etc/systemd/system) and under the name sonic.service. Still getting sonic is unrecognized as service Am I wrong in here, and it needs more configuration?

Sorry to reopen this issue, btw.

@ghost
Copy link
Author

ghost commented Jul 24, 2019

Fix it, had to adjust some configuration from systemd on the server. Thank you.

@valeriansaliou
Copy link
Owner

Yes, in that case you need to reload systemd and then enable the service. And finish by starting the service.

@valeriansaliou
Copy link
Owner

(that's standard procedure for any systemd service)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant