Running a Service at Boot
Your .service
file should look like this:
Now, take a few more steps to enable and use the .service
file:
Place it in
/etc/systemd/system
folder with say a name ofmyfirst.service
Make sure that your script executable with:
Start it:
Enable it to run at boot:
Stop it:
Notes
You don't need to launch Spark with
sudo
in your service, as the default service user is already root.Look at the links below for more
systemd
options.
Moreover
Now what we have above is just rudimentary, here is a complete setup for spark:
To setup the service:
Further reading
Please read through the following links. Spark is a complex setup, so you should understand how it integrates with Ubuntu's init service.
Last updated