![]() |
Systemd fails to start same script with different name
So, I am pulling my hair on this. The OS is:
Code:
$ cat /etc/os-release Code:
$ ls -al Code:
$ sudo cat /etc/systemd/system/planealert.service Code:
systemd[1]: Started aircraftdbcheck.php. So, what the heck is different on aircraftdbcheck.php file that makes it unfindable by systemd? Please help as I am gonna lose my mind. |
Systemd is stating that it cannot find the file.
Double check your spelling and ensure everything is spelled the same in '/home/pi/PlaneAlert/'. |
Does journalctl provide any more information?
|
Yeah. I checked the paths like 10 times. They look alright to me. Also, I ran journalctl and watched for any logs generated while I attempt to start the service. There is no logs related to the service.
|
I have kept an eye on journalctl while I attempt to start the service. There were no logs.
|
Output from the following command:
Code:
ls -l /home/pi/PlaneAlert/ |
Quote:
Quote:
|
Quote:
Quote:
Just from the difference in file size they can not be the same unless you have already restored them back to originals. I assume the original aircraftdbcheck.php works from the command line? |
Quote:
Yes. Forgot to mention that. I restored the original content of aircraftdbcheck. Also, it works flawlessly when i run $php aircraftdbcheck.php from the terminal directly. No issues whatsoever. Quote:
Code:
$ ls -l /home/pi/PlaneAlert/ |
Quote:
Code:
$ cat /etc/systemd/system/aircraftdbcheck.service I attempted to start the service. Got the same file not found error from syslog. I checked the contents of the following files, they are blank. $ cat /var/log/air_err.log $ cat /var/log/air_out.log --Above commands return nothing, files are empty-- |
I don't get it..
You copied planealert.php to aircraftdbcheck.php and it works only as planealert and not as aircraftdbcheck? Well, look at the files. Why is aircraftdbcheck.php a completely different size than planealert if it is a copy? |
I have also just tried to move aircraftdb to a new folder under /usr/local/bin/airdb and recreate the service from scratch using the new location. Same error. This does not make sense whatsoever.
|
Quote:
Code:
$ sudo service planealert status Code:
$ sudo service aircraftdbcheck status |
Yah, I understood that. But I would go back to that situation rather than the original situation.
As far as I can understand, the problem is somewhere in the script. If you now go back to testing the same script (copied) under a different name, we can figure the reason for the problem out easier, if it is still there. But now you have taken us back to a situation with 2 different scripts, where 1 run and 1 don't. That's a PHP problem IMO. If you copy the same script into a different name and have an issue, the problem is not IN the script, but in GNU somewhere, and then we can find out. |
Right, what everyone so far has missed is that you're not starting your new file properly.
You are trying to execude a php file directly, however in your example when you say it's working from the command line you show that you're actually running it with: Quote:
Change: Code:
ExecStart=/home/pi/PlaneAlert/aircraftdbcheck.php Code:
ExecStart=/the/path/to/php /home/pi/PlaneAlert/aircraftdbcheck.php |
All times are GMT -5. The time now is 04:41 PM. |