| || || || |
With our binary present on the remote servers we need to set up a service that runs that binary so that we can serve our static images. We'll use
systemd as it's what ships with most Linux distributions in this day and age.
All we have to do is upload a pre-configured
systemd configuration file which tells
systemd how our service is to be executed and managed.
First we configure this "unit":
1 2 3
We're supplying a description for our service so that it's clear what it is when it's displayed in the output of various
systemd tools, like
After property determines WHEN the service is started. We need to start after the networking and auditing stacks have started.
Next we configure the service itself:
1 2 3 4 5
Most of the properties we're configuring here are obvious: what to run and where to run it.
Finally we tell
systemd how-to "install" the service into its database:
1 2 3 4 5 6 7 8 9 10 11 12
Committing the Code¶
- Set your working directory to the
- Save the file as
git add httpcats.systemd.serviceto add it to the Git staging area
git commit -am 'ensuring we can manage our app via systemd'to commit the file to our repository
- Push the code to GitLab.com: