I have a PHP script I'm trying to create a service for. I've created the service however I can't get it to start. The weird thing is, the exact same service UNIT works on my other server of the same setup. The PHP script is set to be ran daemonized with the -d switch. The command itself works just fine but not through systemd.
This is what I get
● serverio.service - Socket Server Service
Loaded: loaded (/etc/systemd/system/multi-user.target.wants/serverio.service)
Active: inactive (dead) since Wed 2017-01-18 23:41:49 UTC; 2s ago
Process: 22921 ExecStop=/usr/bin/php /opt/sockets/server.php stop (code=exited, status=0/SUCCESS)
Process: 22917 ExecStart=/usr/bin/php /opt/sockets/server.php start -d (code=exited, status=0/SUCCESS)
Main PID: 22917 (code=exited, status=0/SUCCESS)
Jan 18 23:41:49 hostname systemd[1]: Started SocketIO Server Service.
Jan 18 23:41:49 hostname systemd[1]: Starting SocketIO Server Service...
Here is my service file.
[Unit]
Description=SocketIO Server Service
[Service]
Type=simple
PIDFile=/opt/sockets/phpio.pid
ExecStart=/usr/bin/php /opt/sockets/server.php start -d
ExecStop=/usr/bin/php /opt/sockets/server.php stop
[Install]
WantedBy=multi-user.target
Any idea of on how to get this to work?