Article 500PK centos 7 getting process to start at boot time

centos 7 getting process to start at boot time

by
tonj
from LinuxQuestions.org on (#500PK)
I'm running centos 7 and I'm trying to get a virtual machine to start up when the server boots. The vm is called windows-server-2012 and has the number 5572b85e-56c2-458e-a5cb-a50fdc8af0ef. The vm was created under the username ratcliffe. I've created a startup script thus:
# nano /usr/lib/systemd/system/windows-server-2012-startup-script.service
Code:[Unit]
Description=windows-server-2012-startup-script
Requires=network.target
After=network.target

[Service]
ExecStart=runuser -l ratcliffe PWD=<hidden> -c 'Vboxmanage startvm 5572b85e-56c2-458e-a5cb-a50fdc8af0ef'

[Install]
WantedBy=multi-user.targetbut when I reboot the machine the vm is not running:
# systemctl status windows-server-2012-startup-script.service
Code:a- windows-server-2012-startup-script.service - windows-server-2012-startup-script
Loaded: error (Reason: Invalid argument)
Active: inactive (dead)

Feb 28 14:13:24 ratcliffe.svr systemd[1]: [/usr/lib/systemd/system/windows-server-2012-startup-script.service:7] Executable path is not absolute, ignoring: runuser -l ratcliffe PWD=<hidden> -c 'Vboxmanage startvm 5572b85e-56c2-458e-a5cb-a50fdc8af0ef'
Feb 28 14:13:24 ratcliffe.svr systemd[1]: windows-server-2012-startup-script.service lacks both ExecStart= and ExecStop= setting. Refusing.
Feb 28 14:13:24 ratcliffe.svr systemd[1]: Cannot add dependency job for unit windows-server-2012-startup-script.service, ignoring: Unit is not loaded properly: Invalid argument.I don't understand whats wrong with my startup script, thanks for any help.latest?d=yIl2AUoC8zA latest?i=7Y-OpTDHpsE:NvTdsrvYPTw:F7zBnMy latest?i=7Y-OpTDHpsE:NvTdsrvYPTw:V_sGLiP latest?d=qj6IDK7rITs latest?i=7Y-OpTDHpsE:NvTdsrvYPTw:gIN9vFw7Y-OpTDHpsE
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments