3

I'm trying to restart a program after a SSL certificate renewal.

My plan was to check the exit code of the acme-tiny script. That script is the main part of a systemd service started daily using a systemd timer.

After reading some man pages I created/etc/systemd/system/acme-tiny.service.d/cert_reload.conf containing just:

[Service]
ExecStopPost=/usr/local/libexec/cert_reload

This part seems to work.

However I have expected that there will be certain environment variables present, namely $SERVICE_RESULT, $EXIT_CODE, and $EXIT_STATUS - see man systemd.exec.

But all the script is getting is this:

SHELL=/sbin/nologin
USER=acme
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
PWD=/
LANG=en_US.UTF-8
SHLVL=1
HOME=/var/lib/acme
LOGNAME=acme
_=/usr/bin/env

Without any information about the acme script result I cannot know if a restart is needed.

What am I doing wrong?

2
  • 1
    What version systemd do you have, as this feature is from 232 onwards.
    – meuh
    Feb 5, 2018 at 17:35
  • 2
    @meuh Only 219 (latest CentOS). I guess that explains everything....thank you for solving my problem!
    – VPfB
    Feb 5, 2018 at 17:44

0

You must log in to answer this question.

Browse other questions tagged .