From 970abd7187e4c06540632257f3334c92a242327a Mon Sep 17 00:00:00 2001 From: hexenmeister Date: Mon, 20 Aug 2018 19:10:42 +0000 Subject: [PATCH] fixed: documentation git-svn-id: https://svn.fhem.de/fhem/trunk@17185 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_systemd_watchdog.pm | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/98_systemd_watchdog.pm b/fhem/FHEM/98_systemd_watchdog.pm index e1cabb9bf..128e9ee0f 100644 --- a/fhem/FHEM/98_systemd_watchdog.pm +++ b/fhem/FHEM/98_systemd_watchdog.pm @@ -246,6 +246,11 @@ sub watchdog_client_NotifySystemD($$) { NotifyAccess=all
User=fhem
Group=dialout
+ # Run ExecStartPre with root-permissions
+ PermissionsStartOnly=true
+ ExecStartPre=-/bin/mkdir /var/run/fhem
+ ExecStartPre=/bin/chown -R fhem:dialout /var/run/fhem
+ # Run ExecStart with defined user and group
WorkingDirectory=/opt/fhem
ExecStart=/usr/bin/perl fhem.pl fhem.cfg
#ExecStart=/usr/bin/perl fhem.pl configDB
@@ -257,7 +262,7 @@ sub watchdog_client_NotifySystemD($$) { Restart=on-failure
RestartSec=3
WatchdogSec=180
- PIDFile=/opt/fhem/log/fhem.pid
+ PIDFile=/var/run/fhem/fhem.pid

[Install]
WantedBy=multi-user.target
@@ -267,8 +272,10 @@ sub watchdog_client_NotifySystemD($$) { Anschliessend kann FHEM mit folgendem Befehl gestartet werden: "sudo systemctl start fhem.service".
Wenn in dem Script "Type=notify" verwendet wird, muss global Attribute "nofork=1" gesetzt sein.
+ attr global nofork 1
Bei "Type=forking" muss in Script der korrekte Pfad zu dem PID-Datei angegeben werden, diese Datei muss auch in FHEM mit dem global Attribute "pidfilename" aktiviert sein.
+ attr global pidfilename /var/run/fhem/fhem.pid

@@ -307,6 +314,11 @@ sub watchdog_client_NotifySystemD($$) { NotifyAccess=all
User=fhem
Group=dialout
+ # Run ExecStartPre with root-permissions
+ PermissionsStartOnly=true
+ ExecStartPre=-/bin/mkdir /var/run/fhem
+ ExecStartPre=/bin/chown -R fhem:dialout /var/run/fhem
+ # Run ExecStart with defined user and group
WorkingDirectory=/opt/fhem
ExecStart=/usr/bin/perl fhem.pl fhem.cfg
#ExecStart=/usr/bin/perl fhem.pl configDB
@@ -318,7 +330,7 @@ sub watchdog_client_NotifySystemD($$) { Restart=on-failure
RestartSec=3
WatchdogSec=180
- PIDFile=/opt/fhem/log/fhem.pid
+ PIDFile=/var/run/fhem/fhem.pid

[Install]
WantedBy=multi-user.target
@@ -327,8 +339,10 @@ sub watchdog_client_NotifySystemD($$) { Use "sudo systemctl daemon-reload" to reload systemd configuration. Start fhem with: "sudo systemctl start fhem.service".
- If you like to use Type=notify, you must set fhem global attribute nofork=1.
- If you use Type=forking, please set fhem global pidfilename.
+ If you like to use Type=notify, you must set fhem global attribute nofork=1.
+ attr global nofork 1
+ If you use Type=forking, please set fhem global pidfilename.
+ attr global pidfilename /var/run/fhem/fhem.pid