Score:0

Linux systemd service not restarting automatically?

cn flag

I have below systemd service:

[Unit]
Description=Python Code
Requisite=mosquitto.service
BindsTo=mosquitto.service

[Service]
Type=simple
User=andrew
ExecStart=/usr/bin/python3 /home/andrew/Documents/main.py
Restart=always
RestartSec=10s
StandardOutput=null

[Install]
WantedBy=multi-user.target

Above service is running fine. As mentioned above, it depends on mosquitto so if mosquitto stops, service also stops. But when I am starting the mosquitto again, service always shows as loaded, inactive(dead) and it is not automatically restarting. Is there anything I am missing in the above service code to make it restart automatically?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.