I have a python3 web service written using cherrpy framework. This script works fine when run inside a screen session or just directly from shell. This script rotates logs daily using TimedRotatingFileHandler from python's logging module. This works fine.
I have written a simple systemd unit file to make this script run as a service. Code below:
[Unit]
Description=RCS API Server
After=multi-user.target
[Service]
Type=simple
WorkingDirectory=/home/ubuntu/rcs-sender/
ExecStart=/usr/bin/python3 /home/ubuntu/rcs-sender/rcs_api_server.py
[Install]
WantedBy=multi-user.target
Once the script is run using this until file, it no longer rotates logs, and appends everything to current logging file. I've watched it roll through midnight and not change log files. What is systemd doing that would prevent the script from rotating log files, and how can this be prevented?