0

I want to run PhantomJS in webdriver mode as a service on a CentOS box.

I created this systemd file but somehow the command-line argument is not accepted. The error message is Unit phantomjs-webdriver.service failed to load: Invalid argument.

[Unit]
Description=PhantomJS Webdriver
After=syslog.target

[Service]
User=xxxxx
ExecStart=phantomjs --webdriver=4444
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

Is it at all possible to use command-line switches in ExecStart?

1 Answer 1

1

Yes, command-line switches in ExecStart are allowed in unit files. For example:

$ grep ExecStart /usr/lib/systemd/system/sshd.service 
ExecStart=/usr/bin/sshd -D

Your unit is not valid because the first ExecStart= argument must be the a full path of an executable file (reference). You can find it with which phantomjs command.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .