Add LOGFILE configuration
This commit is contained in:
parent
74f82154c4
commit
5eebcb6815
|
@ -16,7 +16,7 @@ script like:
|
|||
```
|
||||
|
||||
Rigel will listen to the tcp port provided by HOST and PORT vars in `.env`(at the root of
|
||||
project) and converts any text messages that gets into speech on the fly.
|
||||
project. Checkout `env.example`) and converts any text messages that gets into speech on the fly.
|
||||
|
||||
The protocol is pretty simple. The packet should start with 32 bit unsigned
|
||||
integer that contains the length of the string that comes after it. That's it.
|
||||
|
|
|
@ -36,6 +36,9 @@ if __name__ == "__main__":
|
|||
config = dotenv.dotenv_values(sys.argv[1])
|
||||
action = sys.argv[2]
|
||||
pfile = config.get("PID_FILE", "/var/run/rigel.pid")
|
||||
logs = config.get("LOGFILE")
|
||||
logfile = open(logs, 'a+') if logs else sys.stdout
|
||||
|
||||
pidlock = pidfile.PIDFile(pfile)
|
||||
|
||||
if action == "status":
|
||||
|
@ -50,8 +53,8 @@ if __name__ == "__main__":
|
|||
print("Not running.")
|
||||
elif action == "start":
|
||||
|
||||
with daemon.DaemonContext(stdout=sys.stdout,
|
||||
stderr=sys.stderr,
|
||||
with daemon.DaemonContext(stdout=logfile,
|
||||
stderr=logfile,
|
||||
pidfile=pidlock):
|
||||
|
||||
main(config)
|
||||
|
|
Loading…
Reference in New Issue