I am having service running as background service in EC2 instance. but it taking a long time to start a new one or restart a service ( refer to image: I reboot EC2, and a service restart at 9:00, but at the 11:32, a service print the first log ).
Here is my service config file in etc/systemd/system:
[Unit]
Description=file scanner ...
After=network.target
[Service]
User=root
Group=root
WorkingDirectory=/apps/file-scanner
ExecStart=/usr/bin/python3 main.py
StandardOutput=file:/var/log/file-scanner/logs.log
StandardError=file:/var/log/file-scanner/logs.log
[Install]
WantedBy=multi-user.target
Please help.