1

I have a oneshot service that looks like this

[Unit]
Description=My Service
After=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/myservice.sh start
ExecStop=/usr/local/bin/myservice.sh stop
RemainAfterExit=true

[Install]
WantedBy=multi-user.target

The docker image I'm running has

STOPSIGNAL SIGRTMIN+3
ENTRYPOINT ["/sbin/init"]

The service is started as expected when I start the container. If I manually run systemctl stop myservice it works as expected, but when I run docker stop mycontainer, the stop is not called. Is this a stop signal issue or service configuration issue?

1 Answer 1

0

The service and signal were correct, but systemd-halt service must be running for this to work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .