CodexBloom - Programming Q&A Platform

implementing `systemctl` not recognizing my custom service on Fedora 36 after creating systemd unit file

👀 Views: 834 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-24
linux fedora systemd Python

I'm trying to create a custom service for a Python application on Fedora 36 using systemd, but `systemctl` is not recognizing my service file. I created a unit file named `myapp.service` and placed it in `/etc/systemd/system/`. The contents of the file are as follows: ```ini [Unit] Description=My Python Application After=network.target [Service] Type=simple ExecStart=/usr/bin/python3 /opt/myapp/app.py User=myuser Restart=on-failure [Install] WantedBy=multi-user.target ``` After creating the file, I ran `sudo systemctl daemon-reload` to reload the systemd manager configuration. However, when I run `sudo systemctl start myapp.service`, I get the following behavior: ``` Failed to start myapp.service: Unit myapp.service not found. ``` I have double-checked the file name and its location, and it seems correct. I also ran `systemctl list-units --type=service` but my service is not listed. I've tried reloading the configuration multiple times and even restarted the server, but nothing seems to work. I also verified that the service file has the right permissions: ```bash ls -l /etc/systemd/system/myapp.service ``` The output is: ``` -rw-r--r-- 1 root root 219 Oct 15 11:23 /etc/systemd/system/myapp.service ``` Is there something I might be missing in the unit file or any specific Fedora-related configuration that I need to check to get this service recognized?