Autor Thema: FHEM startet nicht "automatisch" neu  (Gelesen 477 mal)

Offline Bartimaus

  • Hero Member
  • *****
  • Beiträge: 1269
FHEM startet nicht "automatisch" neu
« am: 13 Februar 2021, 15:43:07 »
Hallo Zusammen,

ich beschäftige mich gerade mit "Systemd" um z.b. diverse Cronjobs abzulösen.

Dabei ist mir aufgefallen, das mein FHEM nicht automatisch neu startet, nachdem man es per "sudo service fhem stop" heruntergefahren hat.

Hier meine fhem.service:

# $Id: fhem.service 19235 2019-04-21 13:26:17Z betateilchen $
[Unit]
Description=FHEM Home Automation
After=network.target
Wants=hmland.service

[Service]
Type=forking
User=fhem
Group=dialout
WorkingDirectory=/opt/fhem
ExecStart=/usr/bin/perl fhem.pl fhem.cfg
ExecStop=/usr/bin/pkill -U fhem perl
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Hier mal ein Log nachdem ich FHEM in der Konsole gestoppt habe, dort sieht man, das FHEM erst neu startet, nachdem ich es manuell gestartet habe.

pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2021-02-13 15:26:21 CET; 1min 51s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
 Main PID: 2892 (perl)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/fhem.service
           └─2892 /usr/bin/perl fhem.pl fhem.cfg

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
pi@RPi4FHEM:~ $ htop
pi@RPi4FHEM:~ $ sudo service fhem stop
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 5s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 12s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 14s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 15s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 19s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 23s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 25s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 26s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 28s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 29s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 30s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 32s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 32s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 34s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 36s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 41s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 42s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 44s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 1min 5s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 1min 12s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo nano /etc/systemd/system/fhem.service
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2021-02-13 15:31:33 CET; 1min 32s ago
  Process: 2890 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStop=/usr/bin/pkill -U fhem perl (code=exited, status=0/SUCCESS)
 Main PID: 2892 (code=exited, status=0/SUCCESS)

Feb 13 15:26:21 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:26:21 RPi4FHEM systemd[1]: Started FHEM Home Automation.
Feb 13 15:31:32 RPi4FHEM systemd[1]: Stopping FHEM Home Automation...
Feb 13 15:31:33 RPi4FHEM systemd[1]: fhem.service: Succeeded.
Feb 13 15:31:33 RPi4FHEM systemd[1]: Stopped FHEM Home Automation.
pi@RPi4FHEM:~ $ sudo service fhem start
pi@RPi4FHEM:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
   Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2021-02-13 15:33:14 CET; 3s ago
  Process: 3290 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
 Main PID: 3292 (perl)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/fhem.service
           └─3292 /usr/bin/perl fhem.pl fhem.cfg

Feb 13 15:33:14 RPi4FHEM systemd[1]: Starting FHEM Home Automation...
Feb 13 15:33:14 RPi4FHEM systemd[1]: Started FHEM Home Automation.

Hat jemand ne Idee ?
LG
B.


RaspberryP4-4G - Raspbian-Buster, RootFS@256GB-USB-SSD, FHEM SVN rev.20353, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs

Offline MadMax-FHEM

  • Hero Member
  • *****
  • Beiträge: 10033
  • NIVEAu ist keine Creme...
Antw:FHEM startet nicht "automatisch" neu
« Antwort #1 am: 13 Februar 2021, 15:52:10 »
Warum soll denn fhem automatisch starten, wenn du den Dienst MANUELL stoppst!!?

Es sollte automatisch nach einem REBOOT wieder laufen...
...sonst nicht!

Das "autostart" im Service-Script sorgt nur dafür, dass es bei einem ABSTURZ o.ä. (oder auch shutdown [restart] per fhemWeb) wieder autom. gestartet wird.

Bei einem MANUELLEN Stopp ist die "Arbeit" des Scripts "auf Anwender-Wunsch" beendet... ;)

Also ein "Fehler" ist es nur, wenn auch nach einem REBOOT fhem nicht autom. läuft/gestartet wird/wurde...

Gruß, Joachim
FHEM PI3B+ Buster: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)
FHEM PI3 Stretch (Test)
Zustimmung Zustimmung x 1 Liste anzeigen

Offline Bartimaus

  • Hero Member
  • *****
  • Beiträge: 1269
Antw:FHEM startet nicht "automatisch" neu
« Antwort #2 am: 13 Februar 2021, 18:04:30 »
Hi Joachim,

danke für die schnelle Antwort.

Ich hatte

"Restart=always" halt als "immer" interpretiert.
"Restart=on-failure" hätte ich der reinen Übersetzung nach als das vermutet was Du beschrieben hast.

FHEM startet automatisch nach einem reboot, da der Service via " sudo systemctl enable fhem.service" aktiviert wurde.

Dann schaue ich jetzt mal, ob FHEM bei mir wirklich neu startet, wenn ich es aus FHEM aus beende.....


Edith: Du hast Recht, FHEM startet via service neu, wenn ich es aus FHEM heraus beende....  ;D
« Letzte Änderung: 13 Februar 2021, 18:12:13 von Bartimaus »
LG
B.


RaspberryP4-4G - Raspbian-Buster, RootFS@256GB-USB-SSD, FHEM SVN rev.20353, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs

Offline Wernieman

  • Developer
  • Hero Member
  • ****
  • Beiträge: 7163
Antw:FHEM startet nicht "automatisch" neu
« Antwort #3 am: 15 Februar 2021, 10:35:50 »
Das ist eben so auch Absicht. Bei der Serverwartung ist es manchmal wichtig, ein Prozess Manuell dauerhaft beenden zu können. Dann macht man aber auch ein manuellen start (oder ein Reboot)
« Letzte Änderung: 15 Februar 2021, 14:47:14 von Wernieman »
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Offline betateilchen

  • Developer
  • Hero Member
  • ****
  • Beiträge: 17095
  • s/fhem\.cfg/configDB/g
Antw:FHEM startet nicht "automatisch" neu
« Antwort #4 am: 15 Februar 2021, 12:41:43 »
Helau!
Kamelle statt Popcorn!
-----------------------
Unaufgeforderte Anfragen per email werden von mir nicht beantwortet. Dafür ist das Forum da.
-----------------------
Lesen gefährdet die Unwissenheit!