lephisto / pfsense-analytics

Pfsense Analytics w/ Graylog, Elasticsearch, InfluxDB and Grafana fully dockerized for Firewall and DPI..
GNU General Public License v3.0
157 stars 56 forks source link

No instructions included on how to start with system #38

Closed cypherstream closed 3 years ago

cypherstream commented 4 years ago

There are no instructions in the readme on how to get this package to automatically start with system boot. I can never remember cd pfsense-analytics/Docker sudo docker-compose up -d

LookingSharp commented 4 years ago

I think I fixed this with two changes. I am on Ubuntu 18.04. First, you have to tell the docker daemon to start on boot. To do this, run these commands. In the first status, you should see disabled, and then enabled for the second.

systemctl status docker
systemctl enable docker
systemctl status docker

Next you'll need to edit the docker-compose.yml file then restart your containers. In this file, for each service, add a restart policy of always. You set restart:always under each service (unless-stopped may also work?). You can see this in my commit.

Then restart the containers in your Docker directory (I think this is necessary)

sudo docker-compose down
sudo docker-compose up -d

Lastly if you like you could inspect your container

sudo docker container ls
sudo docker inspect pfanalytics_graylog_1

And look for RestartPolicy

cypherstream commented 4 years ago

Thanks, I did that and see this in the inspect

        "RestartPolicy": {
            "Name": "always",
            "MaximumRetryCount": 0
        },

I'll have to see next time I restart for whatever reason that it comes up with the system.