I've installed GlassFish 4 on one of my virtual machines which is CentOS 7 with minimal install. I want to start GlassFish when I start the virtual machine.
I've created /usr/lib/systemd/system/glassfish4.service
, which contains:
[Service]
Type=simple
ExecStart=/opt/glassfish4/bin/asadmin start-domain domain1
[Install]
WantedBy=multi-user.target
I ran the command to add it to start automatically:
sudo systemctl enable glassfish4.service
But when I start the virtual machine, nothing happens. GlassFish does not run. What should I do to run it on boot?
Thanks.