Install the app
How to install the app on iOS

Follow along with the video below to see how to install our site as a web app on your home screen.

Note: This feature may not be available in some browsers.

Restarting docker container from command line without trigger System Event Notifications

As an Amazon Associate, we may earn commissions from qualifying purchases. Learn more...

3
0
NAS
DS1515+
Operating system
  1. Linux
  2. Windows
Hello,

I have set up a couple of docker containers on my DiskStation DS1515+ wiuth DSM 6.2.3-25426 Update 3.
These containers include:
- Reverse proxy nginx
- LetsEncrypt
- Gitea

When my LetsEncrypt container renews the SSL certificates, I need to restart my Gitea container to have it actually use the new certificates.
I couldn't find a way in the docker GUI to schedule this, so I looked to the next-best thing: the Task Scheduler.

It is easy enough to create a task that calls docker restart <gitea container name>, but this always results in a System Event notificaction saying that the container stopped unexpectedly.
Is there a way to stop/restart docker containers from the CLI without triggering these events?

Thanks in advance.
 
Well that command is the docker command to do it. Why is it a problem that it is registered that way in the log?
 
My issue has to do with cluttering the System Events with "unexpected stop" messages when they are very much expected.
I prefer a clean log where only actual issues are shown.

When a container is stopped through the GUI these events don't happen.
I was hoping to do something similar from the command line / Task Scheduler.
 
Do you get similar problem with stop/start docker commands from cli?
 
I do get them for stopping the container.

Code:
thijs@DT_Server:~$ sudo docker ps | grep gitea
fb74eec91ead        gitea/gitea:1.13.0            "/usr/bin/entrypoint…"   6 weeks ago         Up 6 hours          0.0.0.0:23022->22/tcp, 0.0.0.0:23080->80/tcp, 0.0.0.0:23000->3000/tcp   gitea-1.13.0
thijs@DT_Server:~$ sudo docker stop gitea-1.13.0
gitea-1.13.0
thijs@DT_Server:~$ sudo tail -n1 /var/log/sysnotify.log
2021-01-20T17:31:03+01:00 DT_Server notify: sysnotify_send_notification.c:615 SYSNOTIFY: [docker_container_unexpected_exit] was sent to desktop

I have never seen any notifications for starting a container.

Just to be on the safe side, also some version information.
Code:
thijs@DT_Server:~$ sudo docker version
Client:
 Version:           18.09.8
 API version:       1.39
 Go version:        go1.11
 Git commit:        bfed4f5
 Built:             Fri Mar 13 06:46:11 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.09.8
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.11
  Git commit:       3a371f3
  Built:            Fri Mar 13 06:44:35 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Popular tags from this forum

Similar threads

Thanks for your advice, I was able to figure it out. There was two folders located in /var/packages. One...
Replies
2
Views
688

Thread Tags

Tags Tags
docker

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending content in this forum

Back
Top