SIGKILL is unclean behavior, but it should not cause any harm. The only
state worth worrying about is the database and, there, all writes are done
as transactions. If the SIGKILL happens in the middle of one, it will not
be committed.

Of course, that's the theory!

On Fri, Apr 2, 2021 at 7:36 AM Graham Eddy <graham.e...@gmail.com> wrote:

> using the provided weewx.service on an RPi, ‘sudo systemctl stop weewx’
> sends SIGKILL instantly (twice), which is a very unclean termination of
> weewx and causes me problems. has anyone encountered this and has a proper
> fix?
>
> so far as i can tell from the manuals (particularly ‘systemd.kill' and
> ‘systemd.service’), this is defective behaviour by systemd - it should send
> a SIGTERM followed by a SIGKILL (if necessary) 90 secs later by default.
> instead, i can only stop it sending SIGKILL by setting
> ‘FinalKillSignal=SIGTERM’ in weewx.service, where systemd sends SIGTERM
> twice instead. ‘KillSignal=SIGTERM’ is ignored
>
> my workaround is ‘SendSIGKILL=no’ in weewx.service, which nicely sends
> SIGTERM for clean shutdown, but there is no followup SIGwhatever for
> contingent termination of rogue process(es)
>
> weewx.service with workaround is:
>
> # systemd configuration for weewx
>
> [Unit]
> Description=weewx weather system
> Requires=time-sync.target
> After=time-sync.target
> RequiresMountsFor=/home
>
> [Service]
> ExecStart=/home/weewx/bin/weewxd --daemon --pidfile=/run/weewx/weewx.pid
> /home/weewx/weewx.conf
> ExecReload=/bin/kill -HUP $MAINPID
> Type=forking
> PIDFile=/run/weewx/weewx.pid
> User=weewx
> Group=weewx
> SendSIGKILL=no  # workaround to stop SIGKILL sent instantly (systemd bug)
>
> [Install]
> WantedBy=multi-user.target
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/57F87F51-50BC-4359-A437-F8CDEF455BB3%40gmail.com
> <https://groups.google.com/d/msgid/weewx-user/57F87F51-50BC-4359-A437-F8CDEF455BB3%40gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEC78QJRmK-2_5S9BU2ek%3DPOxFczFUvFmtk35fUhm0epgw%40mail.gmail.com.

Reply via email to