LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-07-2018, 09:09 AM   #16
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,764

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931

In addition to the above since the script is executable does it have the proper shebang? Typically the CLI php is located in /usr/bin.

#!/usr/bin/php
 
1 members found this post helpful.
Old 11-07-2018, 09:13 AM   #17
ZiZiL
LQ Newbie
 
Registered: Nov 2018
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
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:



Change:
Code:
ExecStart=/home/pi/PlaneAlert/aircraftdbcheck.php
to:
Code:
ExecStart=/the/path/to/php /home/pi/PlaneAlert/aircraftdbcheck.php
and see how you get on.
: ) That worked.

Code:
 $ sudo service aircraftdbcheck status
● aircraftdbcheck.service - aircraftdbcheck.php
   Loaded: loaded (/etc/systemd/system/aircraftdbcheck.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-11-07 09:11:47 CST; 6s ago
 Main PID: 486 (php)
   CGroup: /system.slice/aircraftdbcheck.service
           └─486 /usr/bin/php /home/pi/PlaneAlert/aircraftdbcheck.php
What I dont understand is that how come planealert does work via service? I do not have /usr/bin/php in its execution path. So weird.
 
1 members found this post helpful.
Old 11-07-2018, 09:13 AM   #18
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,484

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Quote:
Originally Posted by michaelk View Post
In addition to the above since the script is executable does it have the proper shebang? Typically the CLI php is located in /usr/bin.

#!/usr/bin/php
Good point! To be honest I've generally always executed PHP scripts without shebang.
 
Old 11-07-2018, 09:14 AM   #19
ZiZiL
LQ Newbie
 
Registered: Nov 2018
Posts: 9

Original Poster
Rep: Reputation: Disabled
#!/usr/bin/php

I did have this as the first line for both planealert and aircraftdbcheck.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
systemd start job Times Out and Fails pmouse Linux - Software 5 05-06-2016 05:20 AM
custom systemd httpd service fails to start on centos 7 mariogarcia CentOS 3 02-13-2016 02:51 AM
[SOLVED] [arch] ZFS daemon fails to start; Systemd journal not working Weapon S Linux - Software 4 07-10-2015 12:06 AM
systemd startup script fails v3ct0r Linux - Newbie 5 03-04-2014 08:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration