<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    naive question, but why are you not using systemd's handling of
    hardware daemon (see <a class="moz-txt-link-freetext" href="man:system.conf">man:system.conf</a> for how to activate it)<br>
    <br>
    basically, systemd is monitored by the hardware daemon and systemd
    monitors (via its software watchdog) any service that wants to be
    monitored<br>
    <br>
    this creates a better chain of trust (I think) than an external
    daemon and would do what you want...<br>
    <br>
    <div class="moz-cite-prefix">On 19/03/2018 14:39, Alexander 'Leo'
      Bergolth wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:e71db222-fdb6-ad52-4f7b-49915c3d50c6@strike.wu.ac.at">
      <pre wrap="">Hi!

I am using the software watchdog daemon together with a watchdog device in "nowayout" mode.
Thus once started, the watchdog daemon should never be stopped or the box will be rebooted.

watchdog.service is WantedBy multi-user.target and when changing e.g. to rescue.target, it should stay active.

I tried to configure this using IgnoreOnIsolate=true but this doesn't show the desired effect.
On "systemd isolate rescue.target", watchdog.service still gets stopped:
-------------------- 8< --------------------
Mar 19 13:44:02 strike watchdog[1291]: stopping daemon (5.13)
Mar 19 13:44:02 strike systemd[1]: Stopping watchdog daemon...
-------------------- 8< --------------------

What did I do wrong?

Cheers,
--leo


I am using systemd-219-42.el7_4.7.x86_64 on Centos 7.

-------------------- 8< --------------------
# systemctl cat watchdog.service
# /usr/lib/systemd/system/watchdog.service
[Unit]
Description=watchdog daemon
# man systemd.special
# auto added After=basic.target

[Service]
Type=forking
ExecStart=/usr/sbin/watchdog
ControlGroup=cpu:/

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/watchdog.service.d/override.conf
[Unit]
IgnoreOnIsolate=true

-------------------- 8< --------------------
# systemctl status watchdog.service
* watchdog.service - watchdog daemon
   Loaded: loaded (/usr/lib/systemd/system/watchdog.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/watchdog.service.d
           `-override.conf
   Active: inactive (dead) since Mon 2018-03-19 13:44:07 CET; 23min ago
  Process: 1267 ExecStart=/usr/sbin/watchdog (code=exited, status=0/SUCCESS)
 Main PID: 1291 (code=exited, status=0/SUCCESS)

-------------------- 8< --------------------
# systemctl show watchdog.service
Type=forking
Restart=no
NotifyAccess=none
RestartUSec=100ms
TimeoutStartUSec=1min 30s
TimeoutStopUSec=1min 30s
WatchdogUSec=0
WatchdogTimestampMonotonic=0
StartLimitInterval=10000000
StartLimitBurst=5
StartLimitAction=none
FailureAction=none
PermissionsStartOnly=no
RootDirectoryStartOnly=no
RemainAfterExit=no
GuessMainPID=yes
MainPID=0
ControlPID=0
FileDescriptorStoreMax=0
StatusErrno=0
Result=success
ExecMainStartTimestamp=Mon 2018-03-19 13:42:22 CET
ExecMainStartTimestampMonotonic=15052342
ExecMainExitTimestamp=Mon 2018-03-19 13:44:07 CET
ExecMainExitTimestampMonotonic=119544736
ExecMainPID=1291
ExecMainCode=1
ExecMainStatus=0
ExecStart={ path=/usr/sbin/watchdog ; argv[]=/usr/sbin/watchdog ; ignore_errors=no ; start_time=[Mon 2018-03-19 13:42:22 CET] ; stop_time=[Mon 2018-03-19 13:42:22 CET] ; pid=12
Slice=system.slice
MemoryCurrent=18446744073709551615
TasksCurrent=18446744073709551615
Delegate=no
CPUAccounting=no
CPUShares=18446744073709551615
StartupCPUShares=18446744073709551615
CPUQuotaPerSecUSec=infinity
BlockIOAccounting=no
BlockIOWeight=18446744073709551615
StartupBlockIOWeight=18446744073709551615
MemoryAccounting=no
MemoryLimit=18446744073709551615
DevicePolicy=auto
TasksAccounting=no
TasksMax=18446744073709551615
UMask=0022
LimitCPU=18446744073709551615
LimitFSIZE=18446744073709551615
LimitDATA=18446744073709551615
LimitSTACK=18446744073709551615
LimitCORE=18446744073709551615
LimitRSS=18446744073709551615
LimitNOFILE=4096
LimitAS=18446744073709551615
LimitNPROC=63090
LimitMEMLOCK=65536
LimitLOCKS=18446744073709551615
LimitSIGPENDING=63090
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0
Type=forking
Restart=no
NotifyAccess=none
RestartUSec=100ms
TimeoutStartUSec=1min 30s
TimeoutStopUSec=1min 30s
WatchdogUSec=0
WatchdogTimestampMonotonic=0
StartLimitInterval=10000000
StartLimitBurst=5
StartLimitAction=none
FailureAction=none
PermissionsStartOnly=no
RootDirectoryStartOnly=no
RemainAfterExit=no
GuessMainPID=yes
MainPID=0
ControlPID=0
FileDescriptorStoreMax=0
StatusErrno=0
Result=success
ExecMainStartTimestamp=Mon 2018-03-19 13:42:22 CET
ExecMainStartTimestampMonotonic=15052342
ExecMainExitTimestamp=Mon 2018-03-19 13:44:07 CET
ExecMainExitTimestampMonotonic=119544736
ExecMainPID=1291
ExecMainCode=1
ExecMainStatus=0
ExecStart={ path=/usr/sbin/watchdog ; argv[]=/usr/sbin/watchdog ; ignore_errors=no ; start_time=[Mon 2018-03-19 13:42:22 CET] ; stop_time=[Mon 2018-03-19 13:42:22 CET] ; pid=12
Slice=system.slice
MemoryCurrent=18446744073709551615
TasksCurrent=18446744073709551615
Delegate=no
CPUAccounting=no
CPUShares=18446744073709551615
StartupCPUShares=18446744073709551615
CPUQuotaPerSecUSec=infinity
BlockIOAccounting=no
BlockIOWeight=18446744073709551615
StartupBlockIOWeight=18446744073709551615
MemoryAccounting=no
MemoryLimit=18446744073709551615
DevicePolicy=auto
TasksAccounting=no
TasksMax=18446744073709551615
UMask=0022
LimitCPU=18446744073709551615
LimitFSIZE=18446744073709551615
LimitDATA=18446744073709551615
LimitSTACK=18446744073709551615
LimitCORE=18446744073709551615
LimitRSS=18446744073709551615
LimitNOFILE=4096
LimitAS=18446744073709551615
LimitNPROC=63090
LimitMEMLOCK=65536
LimitLOCKS=18446744073709551615
LimitSIGPENDING=63090
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0
LimitRTTIME=18446744073709551615
OOMScoreAdjust=0
Nice=0
IOScheduling=0
CPUSchedulingPolicy=0
CPUSchedulingPriority=0
TimerSlackNSec=50000
CPUSchedulingResetOnFork=no
NonBlocking=no
StandardInput=null
StandardOutput=journal
StandardError=inherit
TTYReset=no
TTYVHangup=no
TTYVTDisallocate=no
SyslogPriority=30
SyslogLevelPrefix=yes
SecureBits=0
CapabilityBoundingSet=18446744073709551615
AmbientCapabilities=0
MountFlags=0
PrivateTmp=no
PrivateNetwork=no
PrivateDevices=no
ProtectHome=no
ProtectSystem=no
SameProcessGroup=no
IgnoreSIGPIPE=yes
NoNewPrivileges=no
SystemCallErrorNumber=0
RuntimeDirectoryMode=0755
KillMode=control-group
KillSignal=15
SendSIGKILL=yes
SendSIGHUP=no
Id=watchdog.service
Names=watchdog.service
Requires=basic.target
Wants=system.slice
WantedBy=multi-user.target
Conflicts=shutdown.target
Before=multi-user.target shutdown.target
After=basic.target systemd-journald.socket system.slice
Description=watchdog daemon
LoadState=loaded
ActiveState=inactive
SubState=dead
FragmentPath=/usr/lib/systemd/system/watchdog.service
DropInPaths=/etc/systemd/system/watchdog.service.d/override.conf
UnitFileState=enabled
UnitFilePreset=disabled
InactiveExitTimestamp=Mon 2018-03-19 13:42:22 CET
InactiveExitTimestampMonotonic=14539954
ActiveEnterTimestamp=Mon 2018-03-19 13:42:22 CET
ActiveEnterTimestampMonotonic=15052358
ActiveExitTimestamp=Mon 2018-03-19 13:44:02 CET
ActiveExitTimestampMonotonic=114543976
InactiveEnterTimestamp=Mon 2018-03-19 13:44:07 CET
InactiveEnterTimestampMonotonic=119544801
CanStart=yes
CanStop=yes
CanReload=no
CanIsolate=no
StopWhenUnneeded=no
RefuseManualStart=no
RefuseManualStop=no
AllowIsolate=no
DefaultDependencies=yes
OnFailureJobMode=replace
IgnoreOnIsolate=yes
IgnoreOnSnapshot=no
NeedDaemonReload=no
JobTimeoutUSec=0
JobTimeoutAction=none
ConditionResult=yes
AssertResult=yes
ConditionTimestamp=Mon 2018-03-19 13:42:22 CET
ConditionTimestampMonotonic=14539719
AssertTimestamp=Mon 2018-03-19 13:42:22 CET
AssertTimestampMonotonic=14539719
Transient=no
[root@strike systemd]# systemctl show watchdog.service | cat 
Type=forking
Restart=no
NotifyAccess=none
RestartUSec=100ms
TimeoutStartUSec=1min 30s
TimeoutStopUSec=1min 30s
WatchdogUSec=0
WatchdogTimestampMonotonic=0
StartLimitInterval=10000000
StartLimitBurst=5
StartLimitAction=none
FailureAction=none
PermissionsStartOnly=no
RootDirectoryStartOnly=no
RemainAfterExit=no
GuessMainPID=yes
MainPID=0
ControlPID=0
FileDescriptorStoreMax=0
StatusErrno=0
Result=success
ExecMainStartTimestamp=Mon 2018-03-19 13:42:22 CET
ExecMainStartTimestampMonotonic=15052342
ExecMainExitTimestamp=Mon 2018-03-19 13:44:07 CET
ExecMainExitTimestampMonotonic=119544736
ExecMainPID=1291
ExecMainCode=1
ExecMainStatus=0
ExecStart={ path=/usr/sbin/watchdog ; argv[]=/usr/sbin/watchdog ; ignore_errors=no ; start_time=[Mon 2018-03-19 13:42:22 CET] ; stop_time=[Mon 2018-03-19 13:42:22 CET] ; pid=1267 ; code=exited ; status=0 }
Slice=system.slice
MemoryCurrent=18446744073709551615
TasksCurrent=18446744073709551615
Delegate=no
CPUAccounting=no
CPUShares=18446744073709551615
StartupCPUShares=18446744073709551615
CPUQuotaPerSecUSec=infinity
BlockIOAccounting=no
BlockIOWeight=18446744073709551615
StartupBlockIOWeight=18446744073709551615
MemoryAccounting=no
MemoryLimit=18446744073709551615
DevicePolicy=auto
TasksAccounting=no
TasksMax=18446744073709551615
UMask=0022
LimitCPU=18446744073709551615
LimitFSIZE=18446744073709551615
LimitDATA=18446744073709551615
LimitSTACK=18446744073709551615
LimitCORE=18446744073709551615
LimitRSS=18446744073709551615
LimitNOFILE=4096
LimitAS=18446744073709551615
LimitNPROC=63090
LimitMEMLOCK=65536
LimitLOCKS=18446744073709551615
LimitSIGPENDING=63090
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0
LimitRTTIME=18446744073709551615
OOMScoreAdjust=0
Nice=0
IOScheduling=0
CPUSchedulingPolicy=0
CPUSchedulingPriority=0
TimerSlackNSec=50000
CPUSchedulingResetOnFork=no
NonBlocking=no
StandardInput=null
StandardOutput=journal
StandardError=inherit
TTYReset=no
TTYVHangup=no
TTYVTDisallocate=no
SyslogPriority=30
SyslogLevelPrefix=yes
SecureBits=0
CapabilityBoundingSet=18446744073709551615
AmbientCapabilities=0
MountFlags=0
PrivateTmp=no
PrivateNetwork=no
PrivateDevices=no
ProtectHome=no
ProtectSystem=no
SameProcessGroup=no
IgnoreSIGPIPE=yes
NoNewPrivileges=no
SystemCallErrorNumber=0
RuntimeDirectoryMode=0755
KillMode=control-group
KillSignal=15
SendSIGKILL=yes
SendSIGHUP=no
Id=watchdog.service
Names=watchdog.service
Requires=basic.target
Wants=system.slice
WantedBy=multi-user.target
Conflicts=shutdown.target
Before=multi-user.target shutdown.target
After=basic.target systemd-journald.socket system.slice
Description=watchdog daemon
LoadState=loaded
ActiveState=inactive
SubState=dead
FragmentPath=/usr/lib/systemd/system/watchdog.service
DropInPaths=/etc/systemd/system/watchdog.service.d/override.conf
UnitFileState=enabled
UnitFilePreset=disabled
InactiveExitTimestamp=Mon 2018-03-19 13:42:22 CET
InactiveExitTimestampMonotonic=14539954
ActiveEnterTimestamp=Mon 2018-03-19 13:42:22 CET
ActiveEnterTimestampMonotonic=15052358
ActiveExitTimestamp=Mon 2018-03-19 13:44:02 CET
ActiveExitTimestampMonotonic=114543976
InactiveEnterTimestamp=Mon 2018-03-19 13:44:07 CET
InactiveEnterTimestampMonotonic=119544801
CanStart=yes
CanStop=yes
CanReload=no
CanIsolate=no
StopWhenUnneeded=no
RefuseManualStart=no
RefuseManualStop=no
AllowIsolate=no
DefaultDependencies=yes
OnFailureJobMode=replace
IgnoreOnIsolate=yes
IgnoreOnSnapshot=no
NeedDaemonReload=no
JobTimeoutUSec=0
JobTimeoutAction=none
ConditionResult=yes
AssertResult=yes
ConditionTimestamp=Mon 2018-03-19 13:42:22 CET
ConditionTimestampMonotonic=14539719
AssertTimestamp=Mon 2018-03-19 13:42:22 CET
AssertTimestampMonotonic=14539719
Transient=no




</pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <div>
        <link href="https://fonts.googleapis.com/css?family=Raleway"
          rel="stylesheet" type="text/css">
        <font face="Raleway, regular">
          <table style="padding:20px;margin-bottom:-10px" border="0">
            <tbody>
              <tr>
                <td style="font-size:13px; color:#ff8054; text-align:
                  center; padding-right:30px"> <a
                    href="http://www.smile.eu/"> <img
                      style="max-width:100%; height:auto"
src="http://ftp.smile.fr/client/Communication/signature/img/Logo-new.png"
                      alt="SMILE"> </a><br>
                  <br>
                  <p style="line-heigth:8px">20 rue des Jardins<br>
                    92600 Asnières-sur-Seine</p>
                </td>
                <td style="border-left: 1px solid #3b7ffe;
                  padding-left:20px; font-size:13px; color:#ff8054;">
                  <div style="color:#ff8054; font-size:14px;"> <b>Jérémy
                      ROSEN</b> </div>
                  <div style="color:#3b7ffe; font-size:13px;">
                    Architecte technique<br>
                    Responsable de l'expertise Smile-ECS </div>
                  <br>
                  <div style="color:#3b7ffe; font-size:13px;"> <span
                      style="white-space: nowrap"><img
                        style="margin-right:5px"
                        src="http://ftp.smile.fr/client/Communication/signature/img/mail.png"
                        alt="email" height="10" width="12"> <a
                        href="mailto:jeremy.rosen@smile.fr"
                        style="color:#3b7ffe; font-size:13px;
                        text-decoration:none;">jeremy.rosen@smile.fr</a>
                    </span> <br>
                    <span style="white-space: nowrap"><img
                        style="margin-right:5px"
                        src="http://ftp.smile.fr/client/Communication/signature/img/phone.png"
                        alt="phone" height="10" width="10"></span>
                    +33141402967 <br>
                    <span style="white-space: nowrap"><img
                        style="margin-right:5px"
                        src="http://ftp.smile.fr/client/Communication/signature/img/web.png"
                        alt="url" height="12" width="12">
                      <a href="http://www.smile.eu"
                        style="color:#3b7ffe; font-size:13px;
                        text-decoration:none;">http://www.smile.eu</a> </span>
                  </div>
                  <br>
                  <div> <span><a style="margin-right:5px"
                        href="https://twitter.com/GroupeSmile"><img
src="http://ftp.smile.fr/client/Communication/signature/img/rs-twitter.png"
                          alt="Twitter" style="max-width:100%;
                          height:auto"></a></span> <span><a
                        style="margin-right:5px"
                        href="https://www.facebook.com/smileopensource"><img
src="http://ftp.smile.fr/client/Communication/signature/img/rs-facebook.png"
                          alt="Facebook" style="max-width:100%;
                          height:auto"></a></span> <span><a
                        style="margin-right:5px"
                        href="https://www.linkedin.com/company/smile"><img
src="http://ftp.smile.fr/client/Communication/signature/img/rs-linkedin.png"
                          alt="LinkedIn" style="max-width:100%;
                          height:auto"></a></span> <span><a
                        style="margin-right:5px"
                        href="https://github.com/Smile-SA"><img
src="http://ftp.smile.fr/client/Communication/signature/img/rs-github.png"
                          alt="Github" style="max-width:100%;
                          height:auto"></a></span> </div>
                </td>
              </tr>
            </tbody>
          </table>
          <br>
          <div> <a
href="http://smile.eu/?utm_source=signature&utm_medium=email&utm_campaign=signature"><img
src="http://signature.smile.eu/assets/img/bandeau_mail_smile2017.gif.gif"
                alt="Découvrez l’univers Smile, rendez-vous sur
                smile.eu" border="0"></a></div>
          <br>
          <div style="color:#a3acb5; font-size:10px;"> <img
              src="http://ftp.smile.fr/client/Communication/signature/img/eco.png"
              alt="eco" height="11" width="13"> Pour la planète,
            n'imprimez ce mail que si c'est nécessaire </div>
        </font>
      </div>
    </div>
  </body>
</html>